API Overview
Misc
- ETLayoutItemGroup
A layout item tree node which can contain arbitrary ETLayoutItem subclass instances.
You must never subclass ETLayoutItemGroup.
- NSObject (ETLayoutItemGroupDelegate)
A layout item tree node which can contain arbitrary ETLayoutItem subclass instances.
Informal delegate protocol that can be implemented by the object set with -[ETLayoutItemGroup setDelegate:] .
- NSObject (ETLayoutItemGroupIndexSource)
A layout item tree node which can contain arbitrary ETLayoutItem subclass instances.
Informal source protocol based on child index, which can be implemented by the source object set with -[ETLayoutItemGroup setSource:] .
- NSObject (ETLayoutItemGroupSource)
A layout item tree node which can contain arbitrary ETLayoutItem subclass instances.
Additional methods that makes up the informal source protocol.
- ETPlugInRegistry (Icons)
Description forthcoming.
- ETSelectionAreaItem
Layout item to represent any kind of selection area.
ETSelectionAreaItem is a layout item which can be used to represent any selection area indepently of:
- the tool/tool currently in use and how the selection was created
- the selection shape (rectangular, circle, polygonal etc.)
ETSelectionAreaItem is initialized with a rectangular ETShape, but the shape can be customized with -setStyle: . For example: [selectionAreaItem setStyle: [ETShape ovalShapeWithRect: [selectionAreaItem contentBounds]];
An ETTool subclass is expected to provide a prototype which can be customized (color, shape, opacity etc.). See -[ETSelectionTool selectionAreaItem] and ETShape to learn what you can customize.
ETSelectionTool used ETSelectionAreaItem to implement visual feedback when the selection is underway (aka rubber-banding).
- ETLayoutItem
ETLayoutItem is the base class for all node subclasses that can be used in a layout item tree. ETLayoutItem instances are leaf nodes for the layout item tree structure.
You must never subclass ETLayoutItem.
- NSObject (ETLayoutItemDelegate)
ETLayoutItem is the base class for all node subclasses that can be used in a layout item tree. ETLayoutItem instances are leaf nodes for the layout item tree structure.
Description forthcoming.
- ETBasicHandleStyle
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETBottomHandleActionHandler
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETBottomLeftHandleActionHandler
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETBottomRightHandleActionHandler
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETHandle
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
A handle mediates the interaction between an tool (usually a graphical tool) and a graphical object. The handle is attached to a graphical object by setting the ETHandle manipulatedObject property. The graphical object is commonly a layout item, In future, this might be extended in order to accept other type of objects that conforms to ETManipulatedObject protocol.
The action of a handle when the user manipulates it is defined by setting the EtHandle mediatedTool property.
- ETHandleActionHandler
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETHandleGroup
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Handles are rarely used alone, but in a handle group which organize and present the handles in a way that helps to mediate the tool actions. For example, four handles can be combined in resizing rectangle and makes the resize tool more straightforward to use for the user.
- ETLeftHandleActionHandler
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETResizeRectangle
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETRightHandleActionHandler
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETTopHandleActionHandler
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETTopLeftHandleActionHandler
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETTopRightHandleActionHandler
An ETLayoutItem subclass whose instances represent control points to manipulate the graphical representation of layout items.
Description forthcoming.
- ETLayoutItem (Scrollable)
Syntactic sugar to insert and remove scrollers very easily on a layout item.
This ETLayoutItem category manages ETScrollableAreaItem insertion and removal in the receiver decorator chain. You can use it rather than interacting directly with a scrollable area item you set up and remove manually.
You can set a scrollable area item with -setDecoratorItem: on a layout item and it will be then managed by this category. Which means methods like -[ETLayoutItem setHasVerticalScroller:] can still be used transparently.
The scrollable are item is also automatically removed or inserted, based on wether or not the receiver layout comes with built-in scroll support. e.g. widget layouts such as ETTableLayout or ETBrowserLayout.
By altering the scroller visibility with this category, you can be sure you won't have to reconfigure the scrollable area item even when you remove it or it gets removed. It will be reinserted when scrollers are reenabled, because scrollable area items handed to -[ETLayoutItem setDecoratorItem:] are cached.
Don't use -setScrollable: initially to make the scrollers visible, but -setHasVerticalScroller: or -setHasHorizontalScroller: , -setScrollable: only inserts or removes the scrollable area item.
A new scrollable area item has no visible scrollers.
- ETDecoratorItem
ETUIItem subclass which makes possibe to decorate any layout items, usually with a widget view.
Decorator class which can be subclassed to turn wrapper-like widgets such as scrollers, windows, group boxes etc., provided by the widget backend (e.g. AppKit), into decorator items to be applied to the semantic items that make up the layout item tree.
ETDecoratorItem can be seen as an ETLayoutItem variant with limited abilities and whose instances don't have a semantic role, hence they remain invisible in the layout item tree. They allow EtoileUI to maintain a very tight mapping between the model graph and the layout item tree. By limiting the number of non-semantic nodes in the tree, the feeling of working with real and cohesive objects is greatly enhanced at both code and UI level.
A decorator item must currently not break the following rules (this is subject to change though):- [self displayView] must return [[self decoratorItem] supervisorView]
- [self supervisorView] must return [[[self decoratorItem] supervisorView] wrappedView]
You can write new ETDecoratorItem subclasses. However ETUIItem ivars must be considered private. If you don't present the decorated view as the wrapped view of the supervisor view, you must override -contentRect at least. You might also override -visibleRect and -visibleContentRect in some cases as ETScrollableAreaItem does.
- ETScrollableAreaItem
ETDecoratorItem subclass which makes content scrollable.
A decorator which can be used to make content scrollable.
With the AppKit widget backend, the underlying view is an NSScrollView object.
You must not alter the underlying NSScrollView object with -setContentView: .
Non-flipped coordinates are untested with ETScrollableAreaItem i.e. when the decorated item returns NO to -isFlipped .
- ETWindowItem
ETDecoratorItem subclass which makes possibe to decorate any layout items with a window.
A decorator which can be used to put a layout item inside a window.
With the AppKit widget backend, the window is an NSWindow object.
Once the window is managed by a window item, you must not call the following NSWindow methods: -setDelegate: , -setAcceptsMouseMovedEvents: and -registerForDraggedTypes: .
The NSWindow object is not in the EtoileUI responder chain, but common actions such as -performClose: are forwarded to the NSWindow.
- ETModelDescriptionRenderer
Layout item builder class that generate a UI from a model description.
Description forthcoming.
- ETPropertyCollectionController
Layout item builder class that generate a UI from a model description.
Description forthcoming.
- ETInspector
Inspector protocol and related Inspector representation class which can be used as an inspector view wrapper.
Description forthcoming.
- ETInspectorLayout
Inspector protocol and related Inspector representation class which can be used as an inspector view wrapper.
Description forthcoming.
- ETNibOwner
A mixin class to turn any class into a Nib owner that manages the nib loading and releasing the nib resources once it is not in use.
You can use ETNibOwner or a subclass instance to easily load a nib, the instance will be set as the File's Owner proxy, and when released it will automatically release the Nib resources (e.g. the Nib top-level objects).
Once a nib owner has been instantiated, the nib isn't loaded until -loadNib is invoked.
In the example below, we show how to use ETNibOwner:// First declare a ETNibOwner subclass to manage the nib @interface InspectorNibOwner : ETNibOwner @end @implementation InspectorNibOwner - (void) didLoadNib { NSLog(@"Inspector nib is now loaded and awaken"); } @end// Then use InspectorNibOwner to load the nib InspectorNibOwner *nibOwner = [[InspectorNibOwner alloc] initWithNibName: @"Inspector" bundle: nil]; [nibOwner loadNib]; // Will invoke -didLoadNib
When writing an EtoileUI application, the best choice is usually to use ETController (or a subclass) to manage a Nib rather than ETNibOwner directly.
To finish the Nib loading, e.g. render the AppKit view hierarchy into a layout item tree, retrieve items or views, override some aspects or reorganize the view hierarchy or the item tree, don't override -awakeFromNib but -didLoadNib which will be called once every objects in the Nib has received -awakeFromNib . When a layout item tree is built in this way, both views and windows become owned by the items in the resulting tree. Previously the view/window ownership was in relationships such as top-level objects, subviews or content views.
To render an AppKit view hierarchy packaged in a Nib into a layout item tree, -rebuildTopLevelObjectsWithBuilder: can be used.
For example, ETController overrides -didLoadNib in a vein similar to:- (void) didLoadNib { [self rebuildTopLevelObjectsWithBuilder: [ETEtoileUIBuilder builderWithObjectGraphContext: [self objectGraphContext]]]; }For every top-level object, when -render: on the builder returns a new object, -rebuildTopLevelObjectsWithBuilder: substitutes the initial object with the new one in the top-level object array (see -topLevelObjects).
When the AppKit view hierarchy to render is in the main Nib, see [ETApplication -rebuildMainNib].On instantiation with a nil Nib name, an object which inherits from ETNibOwner automatically loads the Nib file which is named just like the concrete ETNibOwner subclass it is an instance of.
For example, a direct instance of the ETNibOwner subclass "PreferencesPanel" would try to load the Nib file named "PreferencesPanel.nib".
- NSObject (ETNibOwnerBuilder)
A mixin class to turn any class into a Nib owner that manages the nib loading and releasing the nib resources once it is not in use.
ETNibOwner requires a builder that implements this protocol. For example, see ETEtoileUIBuilder.
ETNibOwner subclasses that overrides -rebuildTopLevelObjectsWithBuilder: or -rebuiltObjectForObject:builder: might have other requirements.See also ETTransform in EtoileFoundation.
- ETTitleBarItem
ETDecoratorItem subclass which makes decorates a layout item with a title bar, allowing the item to be collapsed (like window shading in some window managers).
ETView also offers a customizable title bar. The title bar visibility can always be turned on or off. By default, it's turned off. If you are in Live Development mode, most view title bars are usually visible and are tuned for live UI editing with various buttons to switch between available edition modes like view, model, object, component etc. By clicking and dragging a title bar in Live Development you can edit your UI layout. Outside of Live Development mode, title bars support collapse and expand operations (think of it as window shading at view level) which is useful to build complex inspectors or very flexible UI based on disclosable views. Title bar support also means an ETContainer embedding ETView instances and using a layout of type ETFreeLayout will give you a built-in window manager. Title bar views can be customized at application-level by setting a title bar view prototype to be reused by all instances. Instance-by-instance customization is also possible by calling -setTitleBarView: , in this case calling +setTitleBarViewPrototype: will never be reflected at instance level until you call -setTitleBarView: nil which resets the title bar to the class-shared prototype.
- ETWindowLayer
Layer class models the traditional layer element, very common in Computer Graphics applications.
You must never subclass ETWindowLayer.
- ETWindowLayout
Layer class models the traditional layer element, very common in Computer Graphics applications.
A window layout based on WM-based windows, or more precisely the windows as implemented by the widget backend (NSWindow in AppKit case).
For now, only applies to the ETWindowLayer instance returned by +[ETLayoutItem windowGroup] .
- NSImage (NiceScaling)
Description forthcoming.
- NSImage (Etoile)
Description forthcoming.
- ETLineFragment
Represents an horizontal or vertical line box in a layout.
A line fragment is a collection of fragments to be layouted either horizontally or vertically.
A line fragment is typically used together with ETComputedLayout to cluster items spatially without requiring that these layout items belong to an item group.
Although we name 'items' the elements hold by a line fragment, they can be any objects that comply to the ETFragment protocol when their layout implements the ETLayoutFragmentOwner protocol in a compatible way.
Take note that ETComputedLayout and its EtoileUI subclasses only accept ETLayoutItem objects as arguments to -rectForItem: and -setOrigin:forItem: .
You can write subclasses and override these methods to solve this limitation.It is not advised to subclass ETLineFragment. In any case, the ivars must be considered private.
- ETLayoutItemFactory
Factory for building various kinds of UI items and keeping track of special nodes of the layout item tree.
Description forthcoming.
- ETController
A generic controller layer interfaced with the layout item tree.
ETController provides a generic controller layer, usually to be used a replacement for both NSArrayController and NSTreeController.
This reusable controller fills the same purpose than the previously mentionned NSController subclasses. The difference lies in the fact the tree structure is already abstracted in the layout item tree, as such there is no need for a special tree controller class with EtoileUI. The mediation with a collection of model objects is also abstracted in ETLayoutItemGroup class, whose instances play the role of lightweight mediators between View and Model in MVC term, hence NSArrayController isn't really needed either.
ETController extends the traditional facilities of NSController subclasses by allowing to make a distinction between Object class and Group class (leaf vs branches) as very often needed by applications in the Object Manager style (see also CoreObject) at both UI and model levels.
For the UI, you can specify items templates to be cloned when a new element has to be inserted/added. On the model side, you can specify the class of the model objects to be instantiated.This whole facility can be used at any levels of the UI.
For example, for supporting multiple windows in a file manager, you can create an ETLayoutItemGroup instance, that encapsulates a layout item tree which is the file manager UI. Then by simply setting this item group as an item group template on the window layer, and wiring File->New Window... to -add: action of this controller, new file manager windows will be created when New Window... is clicked in the menu.
If you want your file managers to automatically open on a default directory, a model class can be set on the on the controller (-setGroupClass:) or alternatively a model instance can be set on the template item group (by calling -[ETLayoutItem setRepresentedObject:] ).That ability to clone entire UI is detailed in -deepCopy of ETLayoutItem class and subclasses.
When a controller is set, it's very important to ensure its layout item is a base item, otherwise the wrong template items may be look up in the ancestor layout item instead of using the one declared in the controller bound to the container.
ETController directly sorts object of the content and doesn't maintain arranged objects as a collection distinct from the content.
- <ETTemplateProvider>
A generic controller layer interfaced with the layout item tree.
This protocol is only exposed to be used internally by EtoileUI.
- ETLayoutItem (KVO)
Layout item Key Value Observing support.
WARNING: Unstable API.
- ETEtoileUIBuilder
Builder classes that can render document formats or object graphs into a layout item tree.
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.
- ETDocumentController
A controller to manage a collection of documents.
ETDocumentController provides a generic editor/viewer controller to manage the items getting edited or viewed, where each item represents a content unit (a web page, an image, a mail, a compound document etc.).
A content unit is usually a document.ETDocumentController might include unrelated items in its content. For example, the controller bound to -[ETLayoutItemFactory windowGroup] will include non-document windows such as inspectors, palettes etc. when other windows are visible. You can use -documentItems to retrieve the items marked as document. See also -itemForTypes: and itemsForURL: to retrieve a document. For the AppKit backend, it is designed as a NSDocumentController replacement. Unlike NSDocumentController, it can manage multiple documents at any level of the UI, in the sense it doesn't require to have a window per document, and support NSController rich behavior (pick and drop, sorting, filtering, nib integration etc.) without having to resort to another API.
- ETFullScreenWindow
NSWindow additions.
Full screen window which can become key.
- NSPanel (EtoileUI)
NSWindow additions.
Description forthcoming.
- NSWindow (Etoile)
NSWindow additions.
Description forthcoming.
- ETLayoutItemGroup (ETMutationHandler)
Handling of Mutations on Layout Item Tree, Model Graph and Source.
All model mutations are triggered by implicit or explicit remove/insert/add in the layout item tree. Implicit mutations are done by the framework unlike explicit ones which are located in your code. These implicit mutations are triggered by a first explicit mutation, the only one that needs to be propagated to the model side.
The only case of implicit mutation is presently add/insert that may trigger a remove. If a layout item is moved to a new parent item on insert or add, and this new parent that differs from the existing parent, the new parent will require that the item to be inserted removes itself from its existing parent, before truly inserting it.
See -[ETLayoutItemGroup handleAttachItem:] , -[ETLayoutItemGroup handleDetachItem:] and -isCoalescingModelMutation . Take note, you can induce implicit mutations in your code if you write a subclass for ETLayoutItem (or other related subclasses) and you call methods like -addItem , removeItem:, -insertItem:atIndex: etc.
- ETItemTemplate
A template to instantiate the right UI and model for a URL.
A template that embeds both an item template and an object class template, and can build new items initialized with a represented object for a given URL.
ETItemTemplate allows to support various strategy to open or create documents or content units in collaboration with a client object e.g. a ETDocumentController instance.
Subclassing is possible to implement new strategies, but in many cases a new template with a particular UI and model combination should give you enough flexibility.The client object invokes -newItemWithURL:options: to get a new instance. -newItemWithURL:options: in turn uses ETDocumentCreation to delegate the model initialization.
- <ETInspector>
If you want to write your own inspector class from scratch instead of using ETInspector, you must adopt this protocol. This ensures the inspector can be passed through EtoileUI and managed by it transparently.
- <ETObjectInspection>
All classes that want to provide inspectors tailored to their needs should adopt this protocol. The typical way to implement a new inspector is to instantiate an ETInspector object and modify it, then return the new inspector resulting from the customization.
- ETKeyValuePair (EtoileUI)
NSObject EtoileUI specific additions.
Description forthcoming.
- NSImage (EtoileModel)
NSObject EtoileUI specific additions.
See NSObject+Model in EtoileFoudation
- NSObject (ETInspector)
NSObject EtoileUI specific additions.
Description forthcoming.
- NSObject (EtoileUI)
NSObject EtoileUI specific additions.
EtoileUI binds to all objects a visual representation. In many cases, such representations are created only on demand. Any UI objects like (ETView, ETLayoutItem etc.) responds to -view: by becoming frontmost UI objects and focused. Take note, this may involve changing both the frontmost application and window). Non-UI objects are returned by looking up for a service or a component which is registered in CoreObject as a viewer or editor for this object type. If none can be found, the lookup continues by trying to find a viewer/editor through CoreObject supercasting mechanism. If the fallback occurs on a raw data viewer/editor, -view: method doesn't handle by itself the viewing but delegates it to -inspect: which displays a basic object inspector built around ETModelViewLayout. When a new UI object is created or when -view: is called on an object, in both cases the object represented by the UI object is registered as opened in the layout item registry. Any subsequent invocations of -view won't create a new visual representation but move the registered representation back to front. The layout item registry is a shared instance which can be accessed by calling -[ETObjectRegistry(EtoileUI) layoutItemRegistry] .
