public abstract class VCSCommand extends Command
Abstract superclass for version control commands.
Modifier and Type | Field and Description |
---|---|
static int |
CANCEL
Command execution CANCEL status.
|
static int |
ERROR
Command execution ERROR status (exception handled).
|
static int |
NOOP
Command execution NOOP status (no operation, invalid context).
|
static int |
OK
Command execution OK status.
|
Modifier | Constructor and Description |
---|---|
protected |
VCSCommand(int cmdId)
Constructor.
|
protected |
VCSCommand(int cmdId,
int type)
Constructor.
|
protected |
VCSCommand(int cmdId,
int type,
java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Context |
buildContextForEditor()
Build a context for invoking an editor.
|
protected VCSStatusFilter |
createStatusFilter(VCSStatus[] statuses)
Creates a
VCSStatus filter that accepts only the given statuses. |
int |
doit()
Executes the actions associated with a specific command.
|
protected abstract int |
doitImpl()
Executes the actions associated with a specific version control command (implementation).
|
protected void |
fireFileStructureChanged(java.net.URL[] urls)
Fires notification that the structure of the given URLs has changed.
|
protected void |
fireSomeFilesCreated(java.net.URL[] urls)
Fires notification that the given URLs have been created, where existent.
|
protected void |
fireSomeFilesDeleted(java.net.URL[] urls)
Fires notification that the given URLs have been deleted, where non-existent.
|
protected Locatable[] |
getContextLocatables()
Gets the valid locatables from the context node selection, applying the
filter returned by
getLocatableURLFilter() . |
protected VCSExceptionHandler |
getExceptionHandler()
Get the exception handler used to report errors from this command.
|
protected VCSExtension |
getExtension() |
protected java.util.Collection |
getFilteredSelection()
Gets the filtered
Locatable selection based on the context and the command's defined status cache and filter. |
protected java.util.Collection |
getFilteredSelection(Locatable[] locatables)
Gets the filtered
Locatable selection based on given selection and the command's defined status cache and filter. |
protected URLFilter |
getLocatableURLFilter()
Deprecated.
replaced by
getURLFilter() . |
protected oracle.jdeveloper.vcs.cache.StatusCache<VCSStatus> |
getPolicyStatusCache() |
protected VCSStatusCache |
getStatusCache()
Deprecated.
replaced by
getStatusCacheBridge() and getPolicyStatusCache() . |
protected oracle.jdeveloper.vcs.cache.StatusCacheBridge<VCSStatus> |
getStatusCacheBridge() |
protected VCSStatusFilter |
getStatusFilter()
Gets the status filter for the VCS command.
|
protected URLFilter |
getURLFilter()
Gets the URL filter controlling locatables in the command context.
|
protected void |
initializeCommandStyle(VCSCommandStyle commandStyle)
Initializes the style of this command, a construction-time requirement.
|
protected void |
initializeCommandType(VCSCommandType commandType) |
boolean |
isAvailable() |
protected boolean |
isAvailableImpl()
Asks whether the command is available for the current context.
|
protected boolean |
isAvailableImpl(Locatable locatable)
Asks whether the command is available for the current context.
|
protected boolean |
isAvailableImpl(Locatable[] locatables)
Asks whether the command is available for the current context.
|
protected boolean |
isAvailableImpl(java.net.URL url)
Asks whether the command is available for the current context.
|
protected boolean |
isThreaded()
Asks whether this command should be executed on a separate temporary thread.
|
void |
noOp() |
protected void |
noOpImpl()
Performs actions, such as exception notification, when a command exits with the
VCSCommand.NOOP code. |
protected void |
reloadBuffers(java.util.Map timestampMap) |
protected java.util.Map |
storeTimestamps(java.util.Collection nodes) |
protected void |
updateReadOnlyStates(Node[] nodes)
Updates the editor read-only states of nodes for the given URLs.
|
enableConfirmation, getAffectedNodes, getContext, getData, getId, getName, getProgressHandle, getType, isGlobal, setContext, setData, setTaskInfo, undo
public static final int OK
public static final int CANCEL
public static final int ERROR
public static final int NOOP
protected VCSCommand(int cmdId)
cmdId
- the command id.protected VCSCommand(int cmdId, int type)
cmdId
- the command id.type
- the command type.protected VCSCommand(int cmdId, int type, java.lang.String name)
cmdId
- the command id.type
- the command type.name
- the command name, for undo and redo.protected void initializeCommandStyle(VCSCommandStyle commandStyle)
commandStyle
- the style of the command to set.protected void initializeCommandType(VCSCommandType commandType)
public int doit() throws java.lang.Exception
Command
public boolean isAvailable()
public void noOp()
protected boolean isAvailableImpl() throws java.lang.Exception
true
if the command style is VCSCommandStyle.NORMAL
, otherwise calls isAvailableImpl(Locatable[])
with contextual locatables.java.lang.Exception
protected boolean isAvailableImpl(Locatable[] locatables) throws java.lang.Exception
VCSCommandStyle
, otherwise calls isAvailableImpl(Locatable)
.java.lang.Exception
protected boolean isAvailableImpl(Locatable locatable) throws java.lang.Exception
false
if the Locatable
's URL is null or filtered by the locatable URL filter, otherwhise calls otherwise calls isAvailableImpl(URL)
.java.lang.Exception
protected boolean isAvailableImpl(java.net.URL url) throws java.lang.Exception
true
if either getStatusCache()
or getStatusFilter()
return null
, otherwise uses the acceptance value of the status filter.java.lang.Exception
protected void noOpImpl() throws VCSException
VCSCommand.NOOP
code.VCSException
- if the non-operation of the command is an exceptional state.protected abstract int doitImpl() throws java.lang.Exception
java.lang.Exception
protected VCSExtension getExtension()
protected VCSExceptionHandler getExceptionHandler()
protected URLFilter getURLFilter()
@Deprecated protected VCSStatusCache getStatusCache()
protected oracle.jdeveloper.vcs.cache.StatusCache<VCSStatus> getPolicyStatusCache()
protected oracle.jdeveloper.vcs.cache.StatusCacheBridge<VCSStatus> getStatusCacheBridge()
protected VCSStatusFilter getStatusFilter()
protected boolean isThreaded()
protected final Locatable[] getContextLocatables()
getLocatableURLFilter()
.protected final Context buildContextForEditor()
protected final void updateReadOnlyStates(Node[] nodes)
nodes
- the nodes for read-only state updates.protected final VCSStatusFilter createStatusFilter(VCSStatus[] statuses)
VCSStatus
filter that accepts only the given statuses.statuses
- status objects accepted by the created filter.VCSStatus
filter instance.protected final void fireSomeFilesCreated(java.net.URL[] urls)
urls
- the URLs for the event.protected final void fireSomeFilesDeleted(java.net.URL[] urls)
urls
- the URLs for the event.protected final void fireFileStructureChanged(java.net.URL[] urls)
urls
- the URLs for the event.protected final java.util.Map storeTimestamps(java.util.Collection nodes)
protected final void reloadBuffers(java.util.Map timestampMap)
NodeUtil.reloadBuffers(Map)
protected final java.util.Collection getFilteredSelection() throws java.lang.Exception
Locatable
selection based on the context and the command's defined status cache and filter.java.lang.Exception
protected final java.util.Collection getFilteredSelection(Locatable[] locatables) throws java.lang.Exception
Locatable
selection based on given selection and the command's defined status cache and filter.locatables
- the locatables to filter.java.lang.Exception
protected URLFilter getLocatableURLFilter()
getURLFilter()
.