ProjectManager
0.2
|
Public Member Functions | |
(id) | - delegate |
(void) | - openFile: |
(void) | - browser:createRowsForColumn:inMatrix: |
(NSString *) | - browser:titleOfColumn: |
(void) | - selectFile: |
(void) | - changeName: |
Action sent when the selected file's name in the fileName text field is edited by the user. | |
(void) | - selectAndEditNameAtPath: |
Instructs the browser to set it's path to `aPath', selects name of the entry in the fileName text field and allows the user to edit it. | |
(NSArray *) | - selectedFiles |
Returns the paths to the files that are currently selected, otherwise nil. | |
(NSString *) | - containingCategory |
Returns a path to the category which contains the current selection. | |
(BOOL) | - performDragOperation: |
Instructs the file manager to perform a drag operation. | |
(BOOL) | - openPath: |
Opens the file at `aPath'. | |
(BOOL) | - fileExistsAtPath: |
Determines whether a file exists at `aPath'. | |
(NSArray *) | - filesAtPath: |
Lists the files contained in the category at path `category'. | |
(FMFileType) | - typeOfFileAtPath: |
Queries the file type at path `aPath'. | |
(NSString *) | - targetOfLinkAtPath: |
Queries the target of the link at path `aPath'. | |
(unsigned long long) | - measureDiskUsageAtPath: |
Measures the disk usage of files at and under path `aPath'. | |
(NSString *) | - pathToFileAtPhysicalPath: |
Attempts to locate a file in the project based on it's physical disk location. | |
(NSArray *) | - filesAtPath:ofType:recursive: |
Returns a list of files of a specified type in a category. | |
(BOOL) | - importFile:toPath:link:error: |
A shorthand for -[FileManager importFile:renameTo:toPath:link:error:] with the rename filename being the same as the original file path. | |
(BOOL) | - importFile:renameTo:toPath:link:error: |
Imports a specified on-disk file into the project. | |
(BOOL) | - createCategory:atPath:error: |
Creates an empty category named `categoryName' in category `category'. | |
(BOOL) | - createCategoryAndIntermediateCategories:error: |
If necessary, creates a category and all intermediate category nodes on the way to it. | |
(BOOL) | - createVirtualFileNamed:atPath:error: |
Creates a virtual file named `filename' in category `category'. | |
(BOOL) | - removePath:delete:error: |
Removes the specified file at `aPath'. | |
(BOOL) | - copyPath:toPath:error: |
Copies a specified file to a new location. | |
(BOOL) | - movePath:toPath:error: |
Moves a specified file to a new location. | |
(BOOL) | - linkPath:fromPath:error: |
Links a specified file from a new location. | |
(NSImage *) | - iconForPath: |
Returns an iconic representation of `aPath'. | |
(void) | - importFiles: |
(void) | - newEmptyFile: |
(void) | - newFileFromTemplate: |
(void) | - newCategory: |
(void) | - deleteFiles: |
(void) | - filesChanged: |
(void) | - projectNameChanged: |
Protected Attributes | |
id | view |
id | bogusWindow |
ProjectBrowser * | browser |
ProjectImageView * | fileIcon |
NSTextField * | fileNameField |
NSTextField * | filePathField |
NSTextField * | fileSizeField |
NSTextField * | fileTypeField |
NSTextField * | lastModifiedField |
NSMutableArray * | files |
id< FileManagerDelegate > | delegate |
ProjectDocument * | document |
Copies a specified file to a new location.
- (BOOL) createCategory: | (NSString *) | categoryName | |
atPath: | (NSString *) | category | |
error: | (NSError **) | error | |
Creates an empty category named `categoryName' in category `category'.
- (BOOL) createCategoryAndIntermediateCategories: | (NSString *) | category | |
error: | (NSError **) | error | |
If necessary, creates a category and all intermediate category nodes on the way to it.
category | The category which to create. |
error | A pointer to location which will be set to an NSError object in case an error occurs. |
- (BOOL) createVirtualFileNamed: | (NSString *) | filename | |
atPath: | (NSString *) | category | |
error: | (NSError **) | error | |
Creates a virtual file named `filename' in category `category'.
- (BOOL) fileExistsAtPath: | (NSString *) | aPath |
Determines whether a file exists at `aPath'.
- (NSArray *) filesAtPath: | (NSString *) | category |
Lists the files contained in the category at path `category'.
Referenced by measureDiskUsageAtPath:, and removePath:delete:error:.
- (NSArray *) filesAtPath: | (NSString *) | aCategory | |
ofType: | (FMFileType) | aFileType | |
recursive: | (BOOL) | recursive | |
Returns a list of files of a specified type in a category.
This method looks for the specified file type only, and also allows to specify whether the lookup should be recursive.
- (BOOL) importFile: | (NSString *) | filePath | |
renameTo: | (NSString *) | newName | |
toPath: | (NSString *) | category | |
link: | (BOOL) | linkFlag | |
error: | (NSError **) | error | |
Imports a specified on-disk file into the project.
filePath | The on-disk file which to import into the project. |
newName | A filename (only the last path component) to which the imported file will be renamed in the project. |
category | The category into which to import the file. |
linkFlag | If set to NO, the file, if located in an unsuitable location outside the project, will be copied into the path. If YES is passed, it will be linked to without copying. |
error | A pointer to a location which will be set to point to an NSError object in case an error arises during the operation. |
Referenced by importFile:toPath:link:error:.
Links a specified file from a new location.
Only links to plain files and other links are supported.
aPath | The path to which to link. |
newPath | The path where to create the link. |
References targetOfLinkAtPath:.
- (unsigned long long) measureDiskUsageAtPath: | (NSString *) | aPath |
Measures the disk usage of files at and under path `aPath'.
References filesAtPath:, and measureDiskUsageAtPath:.
Referenced by measureDiskUsageAtPath:.
Moves a specified file to a new location.
aPath | The path from which to move the file. |
newPath | The path to which to move the file. |
error | A pointer to a location which will be filled with an error description in case the operation fails. |
Opens the file at `aPath'.
This method is invoked when the user requests to open a file, but the delegate responded that it cannot handle that open request.
References ProjectDocument::openFile:inCodeEditorOnLine:, and targetOfLinkAtPath:.
- (NSString *) pathToFileAtPhysicalPath: | (NSString *) | diskLocation |
Attempts to locate a file in the project based on it's physical disk location.
This method searches the project's categories for a file which exists at the specified on-disk location and returns the path to it in the project.
diskLocation | The physical location of the file. |
- (BOOL) performDragOperation: | (id <NSDraggingInfo>) | sender |
Instructs the file manager to perform a drag operation.
The drag operation is specified by `sender'. The operation source is fully specified by the `sender' argument, the destination is the current file browser path.
References containingCategory, and <ProjectModule>::document.
- (BOOL) removePath: | (NSString *) | aPath | |
delete: | (BOOL) | deleteFlag | |
error: | (NSError **) | error | |
Removes the specified file at `aPath'.
Removes the path `aPath', deleting any underlying disk files if `deleteFlag' = YES.
If deleteFlag = YES, then any disk files and links are deleted from disk as well.
References filesAtPath:.
- (NSString *) targetOfLinkAtPath: | (NSString *) | aPath |
Queries the target of the link at path `aPath'.
Referenced by iconForPath:, linkPath:fromPath:error:, and openPath:.
- (FMFileType) typeOfFileAtPath: | (NSString *) | aPath |
Queries the file type at path `aPath'.