|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.node.Node | +--com.borland.primetime.node.UrlNode | +--com.borland.primetime.node.Project
There are several ways in which a project node is unusual and needs special care:
project
is always null, but
getProject
returns a reference to the project itself.
nodeID
of a project is always 0.
parent
of a project is always null.
Field Summary | |
static java.lang.String |
CATEGORY_DEFAULT
|
static java.lang.String |
ENCODING
|
static java.lang.String |
PREFIX_UNTITLED
|
protected java.util.ArrayList |
projectListeners
|
Fields inherited from class com.borland.primetime.node.Node |
EMPTY_ARRAY,
nodeListeners |
Constructor Summary | |
protected |
Project(Url url)
Creates a new project instance to represent a particular Url. |
Method Summary | |
void |
addProjectListener(ProjectListener listener)
|
void |
check()
Ensure that the project's properties are resynchronized with the current state of its paths. |
FileNode |
createFileNode(java.lang.String extension)
Generates a unique Url with the specified extension for new files that the user has not yet been prompted to name. |
static Project |
createProject(java.lang.String extension)
Generates a unique Url with the specified extension for new projects that the user has not yet been prompted to name. |
void |
dumpAllNodes()
|
static void |
dumpProjects()
Strictly a diagnostic method |
FileNode |
findNode(Url url)
|
LightweightNode[] |
findNodes(java.lang.String name)
|
static Project |
findProject(Url url)
|
void |
fireChildrenChanged(Node parent)
Notifies all registered ProjectListeners that a node has been been added to or removed from a parent node the project. |
void |
fireNodeChanged(Node node)
Notifies all registered ProjectListeners that a node's display name or icon has changed. |
void |
fireProjectPropertyChanged(java.lang.String category,
java.lang.String property,
java.lang.String oldValue,
java.lang.String newValue)
Notifies all registered ProjectListeners that a property on the project node has been changed. |
javax.swing.Icon |
getDisplayIcon()
Provides an image to be used for graphical representation of the node. |
java.lang.String |
getDisplayName()
Uses the the FileNode's underlying Url to derive a display name. |
int |
getDisplaySequence()
Describes the logical group the node belongs to for ordering purposes. |
java.lang.String |
getEncoding()
Describes the standard encoding used to read and write text files for this project. |
java.lang.String |
getLongDisplayName()
|
FileNode |
getNode(Url url)
|
Project |
getProject()
Returns a reference to the project associated with this node. |
static Project |
getProject(Url url)
|
Url |
getProjectPath()
Returns the Url representing the directory the project is stored in. |
Url |
getUrl()
Returns the Url the project is currently associated with. |
boolean |
isModified()
Describes whether or not unsaved changes exist in the project's state. |
boolean |
isNew()
Describes whether or not the project needs to be renamed before it can be saved. |
boolean |
isPersistant()
Determines whether or not the node definition and its properties will be saved with in a project file. |
static boolean |
isProjectExtension(java.lang.String extension)
|
static boolean |
isProjectUrl(Url url)
|
protected void |
postProjectLoad(Url rootUrl)
|
protected void |
preProjectSave(Url rootUrl)
|
static void |
registerProjectClass(java.lang.String extension,
java.lang.String description,
java.lang.Class projectClass,
javax.swing.Icon icon)
Add a new project type to the registry of known types and their associated extensions. |
void |
removeProjectListener(ProjectListener listener)
|
void |
rename(Url url)
Rename cannot change the type of a Project. |
void |
revert()
Revert a project to its on-disk state. |
void |
save()
Updates the project's permanent storage to reflect the current state of the project. |
void |
saveAs(Url url)
saveAs _can_ change the extension of a Project since all state is maintained by the Project instance itself and not the buffer representation, and all project buffers _must_ be associated with Project nodes. |
void |
setEncoding(java.lang.String encoding)
Changes the standard encoding used to read and write text files for this project. |
protected void |
setUrl(Url url)
Used internally by rename() and saveAs() to change the underlying Url associated with the project. |
Methods inherited from class com.borland.primetime.node.UrlNode |
getSuggestedUrl |
Methods inherited from class com.borland.primetime.node.Node |
addNodeListener,
compareTo,
dumpNodes,
dumpNodes,
dumpNodes,
equals,
fireNodeRenamed,
getChildren,
getDisplayChildren,
getNodeID,
getParent,
getProperties,
getProperty,
getProperty,
getProperty,
hasChildren,
hasDisplayChildren,
hashCode,
removeNodeListener,
setParent,
setProperty,
setProperty,
setProperty,
toString |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String CATEGORY_DEFAULT
public static final java.lang.String ENCODING
public static final java.lang.String PREFIX_UNTITLED
protected java.util.ArrayList projectListeners
Constructor Detail |
protected Project(Url url) throws DuplicateNodeException, InvalidUrlException
url
- The resource to read the project definition from.Method Detail |
public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
encoding
- The Java encoding to use or null if the default encoding
should be used.protected void setUrl(Url url) throws DuplicateNodeException
url
- The new Url to be associated with the project. This value must
not be null.public Url getUrl()
public Url getProjectPath()
public static boolean isProjectUrl(Url url)
public static boolean isProjectExtension(java.lang.String extension)
extension
- The file extension without the leading period.public static void registerProjectClass(java.lang.String extension, java.lang.String description, java.lang.Class projectClass, javax.swing.Icon icon)
type
- The extension that this registration is associated with.
Extensions are case-insensitive and do not include the leading period
character.projectClass
- A subclass of Project that should be instantiated to
represent projects with the matching extension.public static Project findProject(Url url)
public static Project getProject(Url url) throws InvalidUrlException
protected void preProjectSave(Url rootUrl)
protected void postProjectLoad(Url rootUrl)
public void revert()
Revert a project to its on-disk state. Note that this isn't the ideal implementation but is sufficient presuming that all references to project nodes are being discarded.
Ideally, we'd rather not lose FileNode instance identity and we would need to rework parentage on surviving nodes, etc.
public void saveAs(Url url) throws java.io.IOException, InvalidUrlException, DuplicateNodeException
public void rename(Url url) throws java.io.IOException, InvalidUrlException, DuplicateNodeException, ReadOnlyException
public static Project createProject(java.lang.String extension)
public FileNode createFileNode(java.lang.String extension)
public FileNode getNode(Url url)
public FileNode findNode(Url url)
public LightweightNode[] findNodes(java.lang.String name)
public void addProjectListener(ProjectListener listener)
public void removeProjectListener(ProjectListener listener)
public void fireProjectPropertyChanged(java.lang.String category, java.lang.String property, java.lang.String oldValue, java.lang.String newValue)
public void fireChildrenChanged(Node parent)
public void fireNodeChanged(Node node)
public boolean isPersistant()
public void check()
public boolean isModified()
public boolean isNew()
public void save() throws java.io.IOException, InvalidUrlException
public Project getProject()
public int getDisplaySequence()
public java.lang.String getDisplayName()
public java.lang.String getLongDisplayName()
public javax.swing.Icon getDisplayIcon()
public static void dumpProjects()
public void dumpAllNodes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |