public final class Workspace extends HashStructureNode
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CREATED_BY_TEMPLATE_ID_PROPERTY |
static java.lang.String |
DATA_KEY
The data key by which a
Workspace instance can be located
within a TraversableContext. |
static java.lang.String |
EXT
Constant recording the file extension for a workpace.
|
static java.lang.String |
ROOT_QNAME |
LOG_READONLY| Constructor and Description |
|---|
Workspace() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addWorkspaceChangeListener(java.lang.String propertyName,
WorkspaceChangeListener listener)
Add a listener for changes to workspace properties.
|
boolean |
canAdd(Element element)
Folder interface method. |
protected void |
closeImpl()
Subclasses should override this method to customize the close()
behavior.
|
java.lang.Object |
copyTo(java.lang.Object object) |
Project |
currentActiveProject()
|
Project |
getActiveProject() |
java.net.URL |
getActiveProjectURL()
Returns the currently active project
URL associated with
this Workspace. |
javax.swing.Icon |
getIcon()
Displayable interface method. |
protected java.lang.String |
getNamespaceURI() |
protected java.lang.String |
getRootQName() |
boolean |
isDefault()
For HashStructureNode subtypes that keep default state in a separate Node
instance, this method should return
true if this Node is
the default instance. |
protected HashStructureIO |
newHashStructureIO() |
java.util.Collection<Project> |
projects()
Returns a collection of
Project instances which are children of
this Workspace. |
boolean |
remove(Element doc,
boolean notifyObservers) |
static void |
removeWorkspaceChangeListener(java.lang.String propertyName,
WorkspaceChangeListener listener)
Remove a listener for changes to workspace properties.
|
static void |
removeWorkspaceChangeListener(WorkspaceChangeListener listener)
Remove a listener for changes to workspace properties.
|
protected void |
saveImpl()
Subclasses should override this method to customize the save()
behavior.
|
void |
setActiveProject(Project activeProject)
Set the active project.
|
void |
setActiveProjectURL(java.net.URL activeProjectURL)
Set the active project url.
|
applyBatchChanges, copyToImpl, createDelegatingFilter, equals, equalsImpl, getObjectStoreTarget, getProperties, getPropertiesForOverriding, getUserPropertiesOnly, invalidateCachedKeys, isUserPropertiesEnabled, newObjectStore, openImpl, saveUserProperties, setURLadd, add, add, canRemove, containsChild, equalsImpl, getBaseDirectory, getChildren, getListOfChildren, getProperty, getProperty, getSharedPropertiesOnly, getURL, hashCode, mayHaveChildren, remove, removeAll, removeAll, resetSubDirtyableOwners, revertImpl, setListOfChildren, setProperty, setSubDirtyableOwner, size, updateaddNodeListener, addNodeListenerForType, addNodeListenerForTypeHierarchy, addWeakNodeListener, attach, beginThreadNodeUsageCycle, callUnderReadLock, callUnderWriteLock, close, createSubject, delete, deleteImpl, detach, endThreadNodeUsage, endThreadNodeUsageCycle, ensureOpen, equalsImpl, getAttributes, getData, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampLoadedUnsafe, getToolTipText, getTransientProperties, getUnmodifiedTimestamp, isDirty, isLoaded, isLockHeld, isMigrating, isNew, isOpen, isReadLocked, isReadLockHeld, isReadOnly, isReadOrWriteLocked, isTrackedInNodeCache, isTrackingThreadNodeUsage, isWriteLocked, isWriteLockHeld, lockCount, markDirty, markDirtyImpl, nodeLock, notifyObservers, open, readLock, readLockCount, readLockInterruptibly, readUnlock, refreshTimestamp, removeNodeListener, removeNodeListenerForType, removeNodeListenerForTypeHierarchy, removeWeakNodeListener, rename, renameImpl, reportOpenException, revert, runUnderReadLock, runUnderWriteLock, save, setEventLog, setMigrating, setOpen, setReadOnly, setTimestampDirectly, toString, tryRunUnderReadLock, tryRunUnderWriteLock, unsetMigrating, upgradeLock, upgradeUnlock, urlReadOnlyChanged, writeLock, writeLockCount, writeLockInterruptibly, writeUnlockclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAttributes, getDatagetAttributedLabel, getLongLabel, getShortLabel, getToolTipText, toStringpublic static final java.lang.String DATA_KEY
Workspace instance can be located
within a TraversableContext. It is also
the key for the PropertiesDialog.public static final java.lang.String EXT
public static final java.lang.String ROOT_QNAME
public static final java.lang.String CREATED_BY_TEMPLATE_ID_PROPERTY
public javax.swing.Icon getIcon()
NodeDisplayable interface method. The Node class returns
a generic icon.getIcon in interface DisplayablegetIcon in class NodeIcon to be displayed for the
Displayable.public boolean canAdd(Element element)
Folder interface method. Returns true if
the specified Element is an instance of
Project; returns false otherwise.canAdd in interface FoldercanAdd in class DataContainerelement - the Element that is about to be added
to this Folder.true if and only if the specified
Element is not null.DefaultFolder.canAdd(Element),
Folder.canAdd(Element)public boolean remove(Element doc, boolean notifyObservers)
remove in class DataContainerprotected final HashStructureIO newHashStructureIO()
newHashStructureIO in class HashStructureNodeprotected final java.lang.String getNamespaceURI()
getNamespaceURI in class HashStructureNodeprotected final java.lang.String getRootQName()
getRootQName in class HashStructureNodeprotected void closeImpl()
throws java.io.IOException
NodeNode.close() invokes this only if the node is open, under
write lock. The Node implementation does nothing.closeImpl in class HashStructureNodejava.io.IOException - if an I/O error occurred while closingprotected void saveImpl()
throws java.io.IOException
NodeNode.save() invokes this only if the node is dirty, under
write lock. The Node implementation does nothing.saveImpl in class HashStructureNodejava.io.IOException - if an I/O error occurred while savingpublic final java.lang.Object copyTo(java.lang.Object object)
copyTo in class HashStructureNodepublic boolean isDefault()
HashStructureNodetrue if this Node is
the default instance.isDefault in class HashStructureNodepublic java.net.URL getActiveProjectURL()
throws TransientMarker
URL associated with
this Workspace. If there is no currently active
project, null is returned.TransientMarkerpublic void setActiveProjectURL(java.net.URL activeProjectURL)
public Project currentActiveProject()
public void setActiveProject(Project activeProject)
public Project getActiveProject()
@NotNull public java.util.Collection<Project> projects()
Project instances which are children of
this Workspace.
This method is equivalent to calling DataContainer.getChildren() and building
a collection of the children which are an instance of Project.
Projects. Never returns
null.public static void addWorkspaceChangeListener(java.lang.String propertyName,
WorkspaceChangeListener listener)
propertyName - the property name to listen forlistener - the listenerpublic static void removeWorkspaceChangeListener(java.lang.String propertyName,
WorkspaceChangeListener listener)
propertyName - the property name being listened forlistener - the listenerpublic static void removeWorkspaceChangeListener(WorkspaceChangeListener listener)
listener - the listener