public class DesignerContextImpl.DesignerProjectHolderImpl extends DefaultProjectHolder implements DesignerProjectContext
listeners, project| Constructor and Description |
|---|
DesignerProjectHolderImpl(Project project,
ProjectScope scope) |
| Modifier and Type | Method and Description |
|---|---|
java.util.UUID |
addFolder(long newResourceId,
java.lang.String moduleId,
int scope,
java.lang.String folderName,
java.util.UUID parent)
Adds a new folder under the given parent.
|
boolean |
canEditResourceProtection()
Checks whether or not the current logged in user can edit the protection bits of project resources.
|
boolean |
checkLockLostState(long resourceId)
Silently checks to see if the resource ID is in the resource locks.
|
void |
deleteResource(long resourceId)
Removes the resource from the current project
|
protected void |
fireResourceModified(ProjectResource resource,
ProjectChangeListener.ResourceModification mod) |
int |
getClientScopedUnsavedChangeCount()
Counts the number of open or updated locks this designer owns for client scoped resources.
|
protected DesignerContextImpl.LockInfo |
getLockInfo(long resourceId) |
protected java.util.Map<java.lang.Long,DesignerContextImpl.LockInfo> |
getResourceLocks() |
ProjectScope |
getScope() |
int |
getUnsavedChangeCount()
Counts the number of open or updated locks this designer owns.
|
protected boolean |
giveResourceProtectionOption(ProjectResource resource)
This method shows a dialog that allows the user to changed the protection status of the resource or do
nothing, or write once.
|
boolean |
hasLock(long resourceId)
Checks to see if the given lock is currently held, which means either:
it has been obtained but not released (it is open)
It has been obtained, modified, and then released, but a save operation has not occurred.
|
boolean |
isLockModified(long resourceId)
Returns true if the lock has been obtained and updated
|
boolean |
isLockOpen(long resourceId)
Returns true if the lock has been obtained and not released
|
boolean |
isResourceProtected(long resourceId,
boolean quiet) |
protected void |
lockLog(java.lang.String action,
long lock) |
void |
moveResource(long resourceId,
java.util.UUID newParent)
Moves the resource to a new parent.
|
long |
newResourceId()
Creates and obtains the lock for a new resource id
|
void |
releaseAllLocks() |
void |
releaseLock(long resourceId)
Designer elements should call this function when they are done with the resource that they obtained a lock
for.
|
boolean |
requestLock(long resourceId)
Requests the lock for the given resource.
|
boolean |
requestLockQuietly(long resourceId)
Just like requestLock, except that if the lock isn't obtained, no error message is displayed.
|
protected boolean |
resourceExists(long resourceId) |
void |
saveFinished(Project diff)
After the project is saved, the Gateway returns a diff which includes the changes other designers made.
|
void |
structuredRename(long resourceId,
java.lang.String newName)
Attempts to rename the given project resource, respecting the requirement that the name be unique amongst
siblings
(with respect to the folder structure)
|
void |
synchLocks()
Attempts to re-obtain all locks that this resource lock manager currently has.
|
void |
update(Project diff,
boolean dirty) |
boolean |
updateLock(long resourceId)
Designer elements should call this function when they have actually updated the resource with the given ID.
|
void |
updateResource(long id,
byte[] data)
Convenience call that updates only the serialized bytes of a project resource, leaving all other parameters
intact.
|
void |
updateResource(ProjectResource resource)
Adds or updates the given project resource
|
addProjectChangeListener, applyDiff, fireProjectChanged, getProject, removeProjectChangeListener, setProjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddProjectChangeListener, applyDiff, getProject, removeProjectChangeListenerpublic DesignerProjectHolderImpl(Project project, ProjectScope scope)
public ProjectScope getScope()
getScope in interface DesignerProjectContextpublic long newResourceId()
throws java.lang.Exception
ResourceLockManagernewResourceId in interface ResourceLockManagerjava.lang.Exceptionpublic int getUnsavedChangeCount()
public int getClientScopedUnsavedChangeCount()
protected java.util.Map<java.lang.Long,DesignerContextImpl.LockInfo> getResourceLocks()
public boolean checkLockLostState(long resourceId)
resourceLocks or if it is found in the lostResourceLocks, false is returned. Otherwise
true is returned.resourceId - the ProjectResource.resourceId we want to checkfalse if not in the resourceLocks map or is in the lostResourceLocks set.
true otherwisepublic boolean updateLock(long resourceId)
ResourceLockManagerupdateLock in interface ResourceLockManagerprotected void lockLog(java.lang.String action,
long lock)
protected DesignerContextImpl.LockInfo getLockInfo(long resourceId)
public boolean hasLock(long resourceId)
ResourceLockManagerhasLock in interface ResourceLockManagerpublic boolean isLockModified(long resourceId)
ResourceLockManagerisLockModified in interface ResourceLockManagerpublic boolean isLockOpen(long resourceId)
ResourceLockManagerisLockOpen in interface ResourceLockManagerpublic void releaseLock(long resourceId)
releaseLock in interface ResourceLockManagerpublic void synchLocks()
ResourceLockManagersynchLocks in interface ResourceLockManagerpublic void releaseAllLocks()
public boolean requestLock(long resourceId)
requestLock in interface ResourceLockManagerpublic boolean requestLockQuietly(long resourceId)
ResourceLockManagerrequestLockQuietly in interface ResourceLockManagerpublic boolean canEditResourceProtection()
throws GatewayException
DesignerProjectContextcanEditResourceProtection in interface DesignerProjectContextGatewayExceptionprotected boolean resourceExists(long resourceId)
protected boolean giveResourceProtectionOption(ProjectResource resource)
public void saveFinished(Project diff)
public void update(Project diff, boolean dirty)
protected void fireResourceModified(ProjectResource resource, ProjectChangeListener.ResourceModification mod)
public void updateResource(long id,
byte[] data)
DesignerProjectContextupdateResource in interface DesignerProjectContextpublic boolean isResourceProtected(long resourceId,
boolean quiet)
public void updateResource(ProjectResource resource)
DesignerProjectContextupdateResource in interface DesignerProjectContextpublic void deleteResource(long resourceId)
DesignerProjectContextdeleteResource in interface DesignerProjectContextpublic void structuredRename(long resourceId,
java.lang.String newName)
throws java.lang.IllegalArgumentException
DesignerProjectContextstructuredRename in interface DesignerProjectContextresourceId - The ID of the resource to renamenewName - The new namejava.lang.IllegalArgumentException - Thrown when the name is not unique.public void moveResource(long resourceId,
java.util.UUID newParent)
DesignerProjectContextmoveResource in interface DesignerProjectContextpublic java.util.UUID addFolder(long newResourceId,
java.lang.String moduleId,
int scope,
java.lang.String folderName,
java.util.UUID parent)
DesignerProjectContextaddFolder in interface DesignerProjectContext