home *** CD-ROM | disk | FTP | other *** search
- // EOModelerEditor.h
- // Copyright (c) 1995, NeXT Software, Inc. All rights reserved.
-
- #import <EOInterface/EOInterface.h>
-
- @class EOModelerDocument;
-
- @interface EOModelerEditor : NSObject
- {
- EOModelerDocument *_document;
- }
- - initWithDocument:(EOModelerDocument *)document;
-
- - (EOModelerDocument *)document;
-
- // Must be implemented by subclasses:
- - (void)setSelectionPath:(NSArray *)newSelection;
- - (NSArray *)selectionPath;
- // An array of model objects making up the selection, starting with the EOModel.
- // The final element of the array will itself be an array (to support multiple
- // selection). E.g.: (EOModel, EOEntity, EORelationship, (EOAttribute, EOAttribute))
- // or (EOModel, (EOEntity)).
- // Sublclasses must override these methods.
-
- - (void)activate;
- // this editor should become active
- @end
-
- @class EOModelerEmbedibleEditor;
-
- @interface EOModelerCompoundEditor : EOModelerEditor
- {
- NSMutableArray *_editors;
- EOModelerEmbedibleEditor *_activeEditor;
- NSArray *_viewedObjectPath;
- NSArray *_selectionWithinViewedObject;
- }
- - (EOModelerEmbedibleEditor *)activeEditor;
- - (void)activateEditorWithClass:(Class)embedibleEditorClass;
- // finds existing registered editor with given class if it exists, or
- // creates it and registers it. Then activates it.
- - (void)registerEmbedibleEditor:(EOModelerEmbedibleEditor *)editor;
- - (void)activateEmbededEditor:(EOModelerEmbedibleEditor *)editor;
-
- - (NSArray *)viewedObjectPath;
- - (void)setViewedObjectPath:(NSArray *)newSelection;
- // returns selelection path for currently viewed object.
- // E.g. if panel is showing all entities, viewedObjectPath return (<EOModel>)
- // regardless of whether an entity is selected.
- // Cleans the selectionWithinViewedObject.
- - (NSArray *)selectionWithinViewedObject;
- - (void)setSelectionWithinViewedObject:(NSArray *)newSelection;
- // just the selection for the current viewed object. E.g. in the example
- // above, this would return an array of 0 or more entities.
- - (NSArray *)selectionPath;
- // concatenation of the viewedObjectPath and the selectionWithinViewedObject.
- - (void)setSelectionPath:(NSArray *)newSelection;
- // sets the setViewedObjectPath to the first n-1 elements of the array, and the
- // selectionWithinViewedObject to the last
- - (void)viewSelectedObject;
- // makes the currently selected object into the viewed object
-
- @end
-
-
- @interface EOModelerEmbedibleEditor : EOModelerEditor
- {
- EOModelerCompoundEditor *_parentEditor;
- }
- - initWithParentEditor:(EOModelerCompoundEditor *)parentEditor;
- - (EOModelerCompoundEditor *)parentEditor;
-
- - (void)selectionDidChange:(NSNotification *)notification;
- // called when parent editor broadcasts selectionDidChange notification.
- // default implementation calls [self active] if this editor is active
-
- // Must be implemented by subclasses
- - (NSView *)mainView;
- // the view to map into the compound editor when this editor is active
- - (BOOL)wantsIconPath;
- // whether this editor wants the icon path visible
- @end
-