ProjectManager 0.2
|
This protocol declares methods which project modules must implement. More...
#include <ProjectModule.h>
Instance Methods | |
(id) | - initWithDocument:infoDictionary: |
Designated initializer of project modules. | |
(void) | - finishInit |
Finishes the initialization process of the project module. | |
(ProjectDocument *) | - document |
Should return the owner project document to which this project module belongs to. | |
(NSView *) | - view |
Instructs the project module to return a view which will be put into the project's window this module becomes the current module. | |
(NSDictionary *) | - infoDictionary |
Instructs the project module to return an archivable version of it's data that it wishes to be saved together with the project. | |
(BOOL) | - regenerateDerivedFiles |
Sent to the project module when it is to regenerate it's derived files which are generated from other files/data in the project itself. | |
(NSArray *) | - moduleMenuItems |
Should return an array of NSMenuItem's which will be put into the module's submenu. | |
(NSArray *) | - toolbarItemIdentifiers |
A module should return the default toolbar item identifiers for it's toolbar. | |
(NSToolbarItem *) | - toolbarItemForItemIdentifier: |
This method asks the module to create a toolbar item for the provided itemIdentifier. | |
(BOOL) | - validateToolbarItem: |
This method is invoked when the project type object is required to validate it's toolbar items. | |
Class Methods | |
(NSString *) | + moduleName |
Should return a unique module identifier name. | |
(NSString *) | + humanReadableModuleName |
This protocol declares methods which project modules must implement.
A project module is one of the ‘tabs’ in a project's window. Each such project module can take care of one aspect of project management. For example, there's modules for project attribute and file management, building, managing subprojects, etc. These modules can then create their own APIs between themselves and the ProjectType object in charge of the project as a whole.
N.B. in the -validateMenuItem: method you should return YES in case the passed menu item doesn't belong to you.
- (void) finishInit |
Finishes the initialization process of the project module.
The project module should put all initialization related to querying the project type object in here, since initial project module initialization takes place before the project type object is created. This method is invoked on all project modules afterwards.
Also, some project modules interface between each other to obtain some functionality. While this is somewhat discouraged, since the order in which -finishInit is sent to project modules is not guaranteed, it is preferrable to put such intialization logic in here, because all modules should have loaded their persistent state in the first init stage.
- (NSDictionary *) infoDictionary |
Instructs the project module to return an archivable version of it's data that it wishes to be saved together with the project.
For example, the FileManager module returns it's project file structure in here.
If the project module doesn't have any archivable data, it's safe to return ‘nil’ here.
- (BOOL) regenerateDerivedFiles |
Sent to the project module when it is to regenerate it's derived files which are generated from other files/data in the project itself.
For example, the Application project type regenerates the project's makefiles in this method.
- (NSToolbarItem *) toolbarItemForItemIdentifier: | (NSString *) | itemIdentifier |
This method asks the module to create a toolbar item for the provided itemIdentifier.
This argument is guaranteed to be one of the allowed toolbar item identifiers which the module returned in -allowedToolbarItemIdentifiers.
- (NSArray *) toolbarItemIdentifiers |
A module should return the default toolbar item identifiers for it's toolbar.
PM automatically adds mandatory ones to this list.