ETLayoutItemBuilder

Authors

Quentin Mathe (qmathe@club-internet.fr)
Builder classes that can render document formats or object graphs into a layout item tree.

Copyright: (C) 2007 Quentin Mathe

Software documentation for the ETEtoileUIBuilder class

ETEtoileUIBuilder : ETLayoutItemBuilder

Declared in:
ETLayoutItemBuilder.h

Generates a layout item tree from an AppKit-based application.

For now, NSTabView and NSSplitView are rendered into a ETLayoutItem with a view, and not into a layout when -allowsWidgetLayout returns YES.

Method summary

allowsWidgetLayout 

- (BOOL) allowsWidgetLayout;

Returns whether the receiver should generate ETWidgetLayout subclass instances in -renderView: when possible.

See also -setAllowsWidgetLayout .


renderApplication: 

- (id) renderApplication: (NSApplication*)app;

Returns items built with the elements (windows, pasteboards) that makes up the given application object.


renderMenu: 

- (id) renderMenu: (NSMenu*)menu;
Description forthcoming.

renderPasteboard: 

- (id) renderPasteboard: (NSPasteboard*)pasteboard;

Returns an item built with the given pasteboard (not yet implemented).


renderPasteboards: 

- (id) renderPasteboards: (NSArray*)pasteboards;

Returns items built with the given pasteboards (not yet implemented).

The returned items are not yet decorated by a window item, -renderApplication: handles that.


renderView: 

- (id) renderView: (id)view;

Returns an item built with the given view, by traversing the subview hierarchy recursively.

When we encounter a supervisor view (ETView subclasses), we stop the recursive traversal in the given view hierarchy and return its layout item.
We never render subviews of supervisor views since we expect their content to be a valid layout item tree.

The returned layout item is either the item bound to the view, or the first decorated item when the view is bound to a decorator item.

All other views (other NSView subclasses) are rendered recursively until the end of their view hierachy (-subviews returns an empty arrary).


renderWidgetLayoutView: 

- (id) renderWidgetLayoutView: (NSView*)aView;

Returns a new layout item group using the layout returned by -[ETWidgetLayout initWithLayoutView:]. When no matching layout exists, nil is returned.


renderWindow: 

- (id) renderWindow: (NSWindow*)window;

Returns an item built with the given window.

The returned item is decorated by a window item that reuses this window and returns YES to -[ETWindowItem shouldKeepWindowFrame:].


renderWindows: 

- (id) renderWindows: (NSArray*)windows;

Returns items built with the given windows.


setAllowsWidgetLayout: 

- (void) setAllowsWidgetLayout: (BOOL)allowed;

Sets whether the receiver should generate ETWidgetLayout subclass instances in -renderView: when possible.

For example, let's suppose -renderView: is invoked with an outline view:

  1. if set to YES, -renderView: will return an ETLayoutItemGroup whose layout is an ETOutlineLayout initialized with the NSOutlineView.
  2. if set to NO, -renderView: will return an ETLayoutItem whose view is the NSOutlineView (the outline view won't become EtoileUI-driven).