const ProjectModel = brackets.getModule("project/ProjectModel")<a name="The ProjectModel provides methods for accessing information about the current open project. It also manages the view model to display a FileTreeView of the project.
Events_
- EVENT_CHANGE (
change) - Fired when theres a change that should refresh the UI - EVENT_SHOULD_SELECT (
select) - Fired when a selection has been made in the file tree and the file tree should be selected - EVENT_SHOULD_FOCUS (
focus) - ERROR_CREATION (
creationError) - Triggered when theres a problem creating a file">
It also manages the view model to display a FileTreeView of the project.
Events:
- EVENT_CHANGE (
change) - Fired when theres a change that should refresh the UI - EVENT_SHOULD_SELECT (
select) - Fired when a selection has been made in the file tree and the file tree should be selected - EVENT_SHOULD_FOCUS (
focus) - ERROR_CREATION (
creationError) - Triggered when theres a problem creating a file Kind: global class
Provides the data source for a project and manages the view model for the FileTreeView.
Triggered when change occurs.
Triggered when item should be selected.
Triggered when item should receive focus.
Triggered when file system rename operation starts.
Triggered when file system rename operation ends.
Error during creation.
Error because of Invalid filename
Error when an item is not in a project
Glob definition of files and folders that should be excluded directly inside node domain watching with chokidar
File renaming
File creating
Rename cancelled
Returns true if this matches valid filename specifications. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
TODO: This likely belongs in FileUtils.
Kind: global function
Returns: boolean - true if the filename is valid
| Param | Type | Description |
|---|---|---|
| filename | string |
to check |
Returns true if given path is valid.
Kind: global function
Returns: boolean - true if the filename is valid
| Param | Type | Description |
|---|---|---|
| path | string |
to check |
Returns false for files and directories that are not commonly useful to display.
Kind: global function
Returns: boolean - true if the file should be displayed
| Param | Type | Description |
|---|---|---|
| entry | FileSystemEntry |
File or directory to filter |
Returns false for files and directories that should not be indexed for search or code hints. If the entry is a directory, its children should be indexed too.
Kind: global function
Returns: boolean - true if the file should be displayed
| Param | Type | Description |
|---|---|---|
| entry | FileSystemEntry |
File or directory to filter |
Creates a new file or folder at the given path. The returned promise is rejected if the filename is invalid, the new path already exists or some other filesystem error comes up.
Kind: global function
Returns: $.Promise - resolved when the file or directory has been created.
| Param | Type | Description |
|---|---|---|
| path | string |
path to create |
| isFolder | boolean |
true if the new entry is a folder |