NSObject+EtoileUI

Authors

Quentin Mathe (qmathe@club-internet.fr)
NSObject EtoileUI specific additions.

Copyright: (C) 2007 Quentin Mathe


Contents -

  1. Software documentation for the ETKeyValuePair(EtoileUI) category
  2. Software documentation for the NSImage(EtoileModel) category
  3. Software documentation for the NSObject(ETInspector) informal protocol
  4. Software documentation for the NSObject(EtoileUI) category

Software documentation for the ETKeyValuePair(EtoileUI) category

ETKeyValuePair(EtoileUI)

Declared in:
NSObject+EtoileUI.h
Description forthcoming.
Method summary

icon 

- (NSImage*) icon;

Returns the icon bound to the -value object.


Software documentation for the NSImage(EtoileModel) category

NSImage(EtoileModel)

Declared in:
NSObject+EtoileUI.h

See NSObject+Model in EtoileFoudation

Method summary

isCommonObjectValue 

- (BOOL) isCommonObjectValue;
Description forthcoming.

Software documentation for the NSObject(ETInspector) informal protocol

NSObject(ETInspector)

Declared in:
NSObject+EtoileUI.h
Conforms to:
ETObjectInspection
Description forthcoming.
Method summary

inspector 

- (id<ETInspector>) inspector;
Description forthcoming.

Software documentation for the NSObject(EtoileUI) category

NSObject(EtoileUI)

Declared in:
NSObject+EtoileUI.h

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].

Method summary

aspectName 

+ (NSString*) aspectName;

Returns the default aspect name used to register a receiver instance in the aspect repository.


baseClassName 

+ (NSString*) baseClassName;

Overrides.


displayName 

+ (NSString*) displayName;

Returns the display name used to present the receiver or its instances in in various EtoileUI builtin facilities such as an inspector.


XMLArchive 

- (NSString*) XMLArchive;

Returns the receiver archived as a XML string with NSKeyedArchiver.

When the receiver doesn't support NSCoding or keyed archiving, returns nil.

You shouldn't use this method in your code. Just use it as a debugging conveniency.


browse: 

- (IBAction) browse: (id)sender;

Shows the receiver content in the object browser panel and allows to navigate the whole Étoilé environment object graph (including outside the application the browsed object is part of).


compare: 

- (NSComparisonResult) compare: (id)anObject;

Returns NSOrderedSame.

This NSObject extension makes possible to sort any object types, even mixed together, and prevent sort descriptors to raise an exception when -compare: is not implemented in an NSObject subclass.


editCode: 

- (IBAction) editCode: (id)sender;

Shows a source code editor to view or edit receiver class source code. For recompilable classes (implemented in Smalltalk), the editor lets you edit and compile the code, otherwise the source code is read-only e.g. for Objective-C.


explore: 

- (IBAction) explore: (id)sender;

Shows a developer-centric inspector based on ETViewModelLayout which provides informations about the receiver object. This explorer inspector allows to inspect properties, instances variables, methods and also the content when the receiver is a collection (ETCollection protocol must be implemented).

The inspector makes possible to edit the object state and behavior.

Unlike the inspector shown by -inspect: , this built-in inspector is not expected to overriden by a third-party inspector.


icon 

- (NSImage*) icon;

Returns the icon used to represent unknown object.

Subclasses can override this method to return an icon that suits and describes better their own objects.


inspect: 

- (IBAction) inspect: (id)sender;

Shows an inspector which provides informations about the receiver.

The inspector makes possible to edit the object state and behavior.

For some objects, the built-in inspector could have been overriden by a third-party inspector. By inspecting a third-party inspector, you can easily revert it or bring back the basic inspector.


isLayout 

- (BOOL) isLayout;

Returns YES if the receiver is an ETLayout class or subclass instance, otherwise returns NO.


isLayoutItem 

- (BOOL) isLayoutItem;

Returns YES if the receiver is an ETLayoutItem class or subclass instance, otherwise returns NO.


isTool 

- (BOOL) isTool;

Returns YES if the receiver is an ETTool class or subclass instance, otherwise returns NO.


isUIItem 

- (BOOL) isUIItem;

Returns whether the receiver is a UI item.

See also ETUIItem, -[NSObject(EtoileUI) isLayoutItem] and -[ETUIItem isDecoratorItem].


isView 

- (BOOL) isView;

Returns YES if the receiver is an NSView class or subclass instance, otherwise returns NO.


synthesizeAccessorsForFieldName: ofScalarProperty: type: inRepository: 

- (id) synthesizeAccessorsForFieldName: (NSString*)aFieldName ofScalarProperty: (NSString*)aKey type: (NSString*)aScalarType inRepository: (ETModelDescriptionRepository*)aRepository;

@taskunit Synthesizing Scalar Field Accessors


view: 

- (IBAction) view: (id)sender;

Shows the layout item representing the receiver by enforcing referential stability (more commonly named spatiality in the case of UI objects).

If the receiver is a layout item, this layout item is simply brought to front and made the first responder.

When the receiver is some other kind of objects, the object registry is looked up to know whether there is a layout item bound to the receiver. If the lookup succeeds, the matching layout item is requested to display itself by sending -view: to it.
If no visual representation exists, a new layout item is created and bound to the receiver with the object registry. Then this layout item is made visible and active as described in the previous paragraph.