ProjectManager 0.2
ProjectDocument Class Reference

This class is the principal document class for project files. More...

Inheritance diagram for ProjectDocument:

Instance Methods

(NSArray *) - projectMenuEntries
 This message is sent to the receiver by the app delegate when the receiver becomes the currently active document in the app to determine what menu entries of it to put into the main menu's 'Project' submenu.
 
(NSString *) - projectName
 
(void) - setProjectName:
 Sets a new project name.
 
(NSString *) - projectDirectory
 
(void) - setProjectName:
 
(NSString *) - projectTypeID
 
(id< ProjectType >) - projectType
 
(NSArray *) - projectModules
 
(id< ProjectModule >) - projectModuleWithName:
 Returns the project module of the specified name, or ‘nil’ if no such module is found.
 
(void) - setCurrentProjectModule:
 Sets the currently displayed project module in the receiver's project window.
 
(id< ProjectModule >) - currentProjectModule
 Returns the currently displayed project module.
 
(BOOL) - openFile:inCodeEditorOnLine:
 Opens a specified file in a code editor (either the internal code editor, or an external one, if configured to do so).
 
(void) - logMessage:
 Appends a message to the project log.
 

Class Methods

(BOOL) + validateProjectName:error:
 Checks whether a given string is a valid project name.
 

Protected Attributes

NSString * projectDirectory
 Returns a path to where the project's directory is located.
 
NSString * projectName
 Returns the abstract project name.
 
NSString * projectTypeID
 Returns the type ID of the project's project type.
 
id< ProjectTypeprojectType
 Returns the project type object associated currently with the project.
 
NSArray * projectModules
 Returns the project modules of the receiver.
 
NSArray * moduleMenuEntries
 An array of menu items of project modules which are to appear in the Modules menu.
 
ProjectWindowControllerwc
 

Detailed Description

This class is the principal document class for project files.

It's responsibility is to manage it's project modules, the project type object, and it's window controller.

Method Documentation

◆ logMessage:

- (void) logMessage: (NSString *) aMessage

Appends a message to the project log.

This method serves as a frontend to the -[ProjectWindowController logMessage:] method, so that project modules and project types can log messages (since they don't have direct access to the window controller object).

Parameters
aMessageThe message which to send to the log.

◆ openFile:inCodeEditorOnLine:

- (BOOL) openFile: (NSString *) aPath
inCodeEditorOnLine: (int) aLine 

Opens a specified file in a code editor (either the internal code editor, or an external one, if configured to do so).

Parameters
aPathThe file which to open.
aLineThe line number at which to open the file. If the file is already open, it is scrolled to that line. If you pass aLine < 0, no scrolling occurs and the file is only opened.
Returns
YES if opening the file succeeded, NO if it didn't.

◆ projectMenuEntries

- (NSArray *) projectMenuEntries

This message is sent to the receiver by the app delegate when the receiver becomes the currently active document in the app to determine what menu entries of it to put into the main menu's 'Project' submenu.

Returns
an array of NSMenuItem objects bound to submenus containing the menu items of the individual project modules.

◆ setCurrentProjectModule:

- (void) setCurrentProjectModule: (id <ProjectModule>) aModule

Sets the currently displayed project module in the receiver's project window.

Parameters
aModuleThe project module which to display. It must one of the project's modules.

◆ setProjectName:

- (void) setProjectName: (NSString *) aName

Sets a new project name.

The project's name doesn't necessarily need to be the same as the project file's or project directory's name, but can instead by anything that the user finds descriptive.

See also
-[ProjectDocument projectName]

◆ validateProjectName:error:

+ (BOOL) validateProjectName: (NSString *) aProjectName
error: (NSError **) error 

Checks whether a given string is a valid project name.

Parameters
projectNameThe project name which to check.
errorA pointer which if not set to NULL will be filled with an object describing the problem with the name.
Returns
YES if the provided name is a valid project name, NO if it isn't.

Member Data Documentation

◆ projectDirectory

- (NSString *) projectDirectory
protected

Returns a path to where the project's directory is located.

The location of the project's project file can be determined by simply saying -[ProjectDocument fileName].

◆ projectName

- (NSString *) projectName
protected

Returns the abstract project name.

See also
-[ProjectDocument - setProjectName:]

The documentation for this class was generated from the following files: