ETLayoutItemFactory
ETLayoutItemFactory : NSObjectInitialization
- + (instancetype) factory
Returns a shared instance that instantiates new items in a transient object graph context.
For each ETLayoutItemFactory subclass, returns a distinct shared instance. The object graph context remains the same accross all these shared instances.
Returns a shared instance that instantiates new items in a transient object graph context.
For each ETLayoutItemFactory subclass, returns a distinct shared instance. The object graph context remains the same accross all these shared instances.
- + (instancetype) factoryWithObjectGraphContext: (COObjectGraphContext *)aContext
Returns a shared instance that instantiates new items in the given object graph context. For each ETLayoutItemFactory subclass and object graph context combination, returns a distinct shared instance.
For a nil context, raises an NSInvalidArgumentException.
- - (id) initWithObjectGraphContext: (COObjectGraphContext *)aContext
Intializes and returns an item factory that instantiates new items in the given object graph context. For a nil context, raises an NSInvalidArgumentException.
Object Graph Context
- - (ETStyle *) currentCoverStyle
Aspect Sharing Boundaries and Persistency
Returns the shared cover style in the current object graph context.
See also -currentActionHandler .
Returns the shared cover style in the current object graph context.
See also -currentActionHandler .
- - (ETActionHandler *) currentActionHandler
Returns the shared action handler in the current object graph context.
See also -currentCoverStyle .
- - (ETStyle *) currentBarElementStyle
Returns the style applied to all the bar elements to be built.
Never returns nil.
- - (void) setCurrentBarElementStyle: (ETStyle *)aStyle
Sets the style to apply to all the bar elements to be built.
If set to nil, -currentBarElementStyle is reset to its initial style.
- - (void) setCurrentBarElementHeight: (CGFloat)aHeight
Sets the height to apply to all the bar elements to be built.
- - (CGFloat) defaultIconAndLabelBarHeight
Returns the standard bar height to fit labelled bar elements.
This bar height is set as the current bar element height when the receiver is initialized.
This height is also identical to the standard toolbar height in Aqua.
- - (ETLayoutItem *) item
Return a new blank layout item.
- - (ETLayoutItem *) itemWithView: (NSView *)view
Returns a new layout item to which the given view gets bound.
- - (ETLayoutItem *) itemWithRepresentedObject: (id)object
Returns a new layout item which represents the given object.
The represented object is a model object in an MVC perspective, the layout item normally interacts with it through the Property Value Coding protocol.
EtoileUI allows to manipulate every objects as a tangible object. To achieve that, every object is treated as a model object which can be represented on a screen by the mean of a layout item. Which means you can pass a layout item itself as a represented object and the returned item will be a proxy or a meta representation.
- - (ETLayoutItem *) barElementFromItem: (ETLayoutItem *)anItem withLabel: (NSString *)aLabel
Returns the layout item set up as a bar element with the given label and the shared style returned by -currentBarElementStyle .
- - (ETLayoutItem *) barElementFromItem: (ETLayoutItem *)anItem withLabel: (NSString *)aLabel style: (ETStyle *)aStyle
Returns the layout item set up as a bar element with the given label and item style.
- - (ETLayoutItemGroup *) itemGroup
Returns a new blank layout item group.
- - (ETLayoutItemGroup *) itemGroupWithFrame: (NSRect)aRect
Returns a new blank layout item group initialized with the given frame.
- - (ETLayoutItemGroup *) itemGroupWithSize: (NSSize)aSize
Returns a new blank layout item group initialized with an origin at zero and the given size.
- - (ETLayoutItemGroup *) itemGroupWithItem: (ETLayoutItem *)item
Returns a new layout item group which contains the given item as a child.
An NSInvalidArgumentException will be raised if you pass nil.
- - (ETLayoutItemGroup *) itemGroupWithItems: (NSArray *)items
Returns a new layout item group which contains the given items as children.
- - (ETLayoutItemGroup *) itemGroupWithRepresentedObject: (id)object
Returns a new layout item group which represents the given object, usually a collection.
The represented object is a model object in an MVC perspective, the layout item group normally interacts with it through the Property Value Coding protocol and possibly the Collection protocols to traverse the object graph connected to it.
See also -itemWithRepresentedObject: .
- - (ETLayoutItemGroup *) graphicsGroup
Returns a new layout item group set up as a graphics group with ETGraphicsGroupStyle as style and ETFreeLayout as layout.
You can use it to build structured graphics editor. e.g. ETSelectTool uses it when you request the grouping of several items.
- - (ETLayoutItemGroup *) horizontalBarWithSize: (NSSize)aSize
Returns a new layout item group set up as an bar element group with ETBarStyle as style and ETLineLayout as layout.
Also resets the current bar element style to -[ETBasicItemStyle iconAndLabelBarElementStyleWithObjectGraphContext:] to ensure new bar elements share the same style.
And resets the current bar element height to the given size height.The returned bar has a flexible width and a fixed height.
-
- (ETLayoutItemGroup *) collectionEditorWithSize: (NSSize)aSize representedObject: (id
) aCollection controller: (id)aController Returns a new layout item group including a collection browser and buttons to edit the collection content using actions such as Add and Remove. Most items that make up the collection editor can be retrieved using -[ETLayoutItemGroup itemForIdentifier:] on the returned item group:
- collectionEditor
- the returned item group that encloses the collection editor UI
- browser
- the item group that presents the collection content
- bar
- the item group that contains the buttons at the bottom of the browser
- plusButton
- the item that calls the -add: action
- minusButton
- the item that calls the -remove: action
The bar that contains the buttons can be customized as desired. Just retrieve it using the right item identifier, and remove or add items to the returned item group.
For actions, the items in the bar must use the controller as the target usually (a nil target is not going to work to send a message to the controller, because the controller is not in the bar responder chain). The controller is bound to the browser item. For setting actions or double actions, once the method returns, just follow this example:[[controller content] setDoubleAction: @selector(edit:)]; [[controller content] setTarget: controller];
The returned collection editor has a flexible width and a fixed height.
- - (id) buttonWithTitle: (NSString *)aTitle target: (id)aTarget action: (SEL)aSelector
Returns a new layout item that uses a NSButton instance as its view, and initializes this button with the given title, target and action.
The bezel style is set to NSRoundedBezelStyle on Mac OS X.
- - (id) buttonWithImage: (NSImage *)anImage target: (id)aTarget action: (SEL)aSelector
Returns a new layout item that uses a NSButton instance as its view, and initializes this button with the given image, target and action.
See also -buttonWithIconNamed:target:action:.
- - (ETLayoutItem *) buttonWithIconNamed: (NSString *)aName target: (id)aTarget action: (SEL)anAction
Returns a new layout item that uses a NSButton instance as its view, and initializes this button with the given target, action and the image bound to the given icon name.
The IconKit is used to looked up the icon image.
See also -buttonWithImage:target:action: .
- - (id) radioButton
Returns a new layout item that uses a NSButton of type NSRadioButton as its view.
- - (id) checkboxWithLabel: (NSString *)aLabel target: (id)aTarget action: (SEL)aSelector forProperty: (NSString *)aKey ofModel: (id)aModel
Returns a new layout item that uses a NSButton of type NSSwitchButton as its view, and initializes this checkbox with the given label, target and action.
You can provide a model object on which -setValue:forProperty: will be invoked for the given property every time the checkbox state changes.
The model object and property name are used to initialize a property viewpoint which is set as the returned item represented object. The property view point is also initialized to treat dictionary keys as properties, so you can use a dictionary as model.Both model and property name must be valid objects when they are not nil.
- - (id) checkBox
Returns a new layout item that uses a NSButton of type NSSwitchButton as its view. See also -checkboxWithLabel:target:action:forProperty:ofModel:.
- - (id) labelWithTitle: (NSString *)aTitle
Returns a new label item that uses a NSTextField without border and background as its view.
- - (ETLayoutItem *) textField
Returns a new layout item that uses a NSTextField instance as its view.
- - (id) searchFieldWithTarget: (id)aTarget action: (SEL)aSelector
Returns a new layout item that uses a NSSearchField instance as its view, and initializes this search field with the given target and action.
- - (id) textView
Returns a new layout item that uses a NSTextView instance as its view. WARNING: presently returns a scrollview if you call -view on the returned item.
- - (id) progressIndicator
Returns a new layout item that uses a NSProgressIndicator instance as its view.
- - (id) verticalSlider
Returns a new layout item that uses a vertically oriented NSSlider instance as its view.
- - (id) horizontalSlider
Returns a new layout item that uses a horizontally oriented NSSlider instance as its view.
The slider minimum value is set to 0, the maximum value to 100 and the initial value to 50.
- - (id) horizontalSliderWithWidth: (CGFloat)aWidth minValue: (CGFloat)min maxValue: (CGFloat)max initialValue: (CGFloat)aValue target: (id)aTarget action: (SEL)aSelector
Returns a new layout item that uses a horizontally oriented NSSlider instance as its view.
- - (id) horizontalSliderWithWidth: (CGFloat)aWidth minValue: (CGFloat)min maxValue: (CGFloat)max forProperty: (NSString *)aKey ofModel: (id)anObject
Returns a new layout item that uses a horizontally oriented NSSlider instance as its view.
- - (ETLayoutItem *) numberPicker
- Description forthcoming.
- - (ETLayoutItem *) numberPickerWithWidth: (CGFloat)aWidth minValue: (double)min maxValue: (double)max initialValue: (double)aValue forProperty: (NSString *)aKey ofModel: (id)anObject
Returns a new layout item that uses a view whose subviews are a text field and a stepper on the right side.
- - (ETLayoutItemGroup *) pointEditorWithWidth: (CGFloat)aWidth forXProperty: (NSString *)aXKey yProperty: (NSString *)aYKey ofModel: (id)anObject
- Description forthcoming.
- - (ETLayoutItemGroup *) sizeEditorWithWidth: (CGFloat)aWidth forWidthProperty: (NSString *)aWidthKey heightProperty: (NSString *)aHeightKey ofModel: (id)anObject
- Description forthcoming.
- - (ETLayoutItem *) popUpMenu
- Description forthcoming.
- - (id) popUpMenuWithItemTitles: (NSArray *)entryTitles representedObjects: (NSArray *)entryModels target: (id)aTarget action: (SEL)aSelector
Returns a new layout item that uses a NSPopUpButton instance as its view, and initializes this pop-up button with the given title, target, action and entries to be put in the menu.
When entryModels is not nil, each element is set as the represented object of the menu entry with the same index in entryTitles. You can pass [NSNull null] to set no represented object on a menu entry.
- - (ETLayoutItemGroup *) windowGroup
Returns the item group representing all windows in the current work context or application.
- - (id) pickboardGroup
Returns the item group representing all pickboards including both system-wide pickboards and those local to the current work context or application.
TODO: Finish to implement, the returned group is empty currently...
- - (ETLayoutItem *) itemWithBezierPath: (NSBezierPath *)aPath
Returns a new layout item which represents a custom shape based on the given bezier path. The shape is used as both the represented object and the style.
- - (ETLayoutItem *) rectangleWithRect: (NSRect)aRect
Returns a new layout item which represents a rectangular shape with the width and height of the given rect.
- - (ETLayoutItem *) rectangle
Returns a new layout item which represents a rectangular shape with the width and height of +[ETShape defaultShapeRect] .
- - (ETLayoutItem *) ovalWithRect: (NSRect)aRect
Returns a new layout item which represents an oval shape that fits in the width and height of the given rect.
- - (ETLayoutItem *) oval
Returns a new layout item which represents an oval shape that fits in the width and height of +[ETShape defaultShapeRect] .
- - (ETLayoutItem *) lineSeparator
Returns a new layout item that uses a NSBox instance as its view.
The returned separator is initially an horizontal line, but by resizing with a height greater than its width, it becomes a vertical line.
- - (ETLayoutItem *) spaceSeparator
Returns a new layout item whose size can be adjusted by a computed layout based on the layout size and a minimum space size.
The returned separator name is kETSpaceItemIdentitifier.
See separator related methods in ETComputedLayoutand subclasses.
- - (ETLayoutItem *) flexibleSpaceSeparator
Returns a new layout item whose size can be adjusted by a computed layout based on the layout size and the available space.
A flexible space item can be shrinked to a zero size unlike the -spaceSeparator item.
The returned separator identifier is kETFlexibleSpaceItemIdentitifier.
See separator related methods in ETComputedLayoutand subclasses.
