Extension SDK 10.1.2


oracle.jdeveloper.vcs.spi
Class VCSAbstractCommand

java.lang.Object
  extended byoracle.ide.addin.AbstractCommand
      extended byoracle.jdeveloper.vcs.spi.VCSAbstractCommand

All Implemented Interfaces:
Command, VCSCommand

public abstract class VCSAbstractCommand
extends AbstractCommand
implements VCSCommand

Abstract superclass for version control commands.

Since:
9.0.5

Field Summary

Fields inherited from class oracle.ide.addin.AbstractCommand
cmdId, context, name, type

Fields inherited from interface oracle.ide.vcs.VCSCommand
ERROR, NOOP

Fields inherited from interface oracle.ide.addin.Command
CANCEL, EXECUTING, NO_CHANGE, NO_UNDO, NORMAL, OK

Constructor Summary
protected VCSAbstractCommand(int cmdId)
Constructor.
protected VCSAbstractCommand(int cmdId, int type)
Constructor.
protected VCSAbstractCommand(int cmdId, int type, java.lang.String name)
Constructor.

Method Summary
protected Context buildContextForEditor()
Build a context for invoking an editor.
int doit()
Executes the actions associated with a specific command.
protected abstract int doitImpl()
VCSArguments getArguments()
Gets the arguments object associated with this command.
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 URLFilter getLocatableURLFilter()
Gets the URL filter controlling locatables in the command context.
boolean isAvailable()
protected boolean isAvailableImpl()
protected boolean isThreaded()
void noOp()
protected void noOpImpl()
void setThreadAuthorized(boolean authorized)
protected void updateReadOnlyStates(Document[] documents)
Updates the editor read-only states of documents for the given URLs.

Methods inherited from class oracle.ide.addin.AbstractCommand
getAffectedDocuments, getContext, getData, getId, getName, getType, setContext, setData, undo

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface oracle.ide.addin.Command
getAffectedDocuments, getContext, getData, getId, getName, getType, setContext, setData, undo

Constructor Detail

VCSAbstractCommand

protected VCSAbstractCommand(int cmdId)
Constructor.
Parameters:
cmdId - the command id.

VCSAbstractCommand

protected VCSAbstractCommand(int cmdId,
                             int type)
Constructor.
Parameters:
cmdId - the command id.
type - the command type.

VCSAbstractCommand

protected VCSAbstractCommand(int cmdId,
                             int type,
                             java.lang.String name)
Constructor.
Parameters:
cmdId - the command id.
type - the command type.
name - the command name, for undo and redo.

Method Detail

doit

public int doit()
         throws java.lang.Exception
Description copied from interface: Command
Executes the actions associated with a specific command. When a command executes successfully, implementations should return OK, otherwise, return CANCEL or any other non-zero value.
Specified by:
doit in interface Command
Throws:
java.lang.Exception

getArguments

public VCSArguments getArguments()
Description copied from interface: VCSCommand
Gets the arguments object associated with this command.
Specified by:
getArguments in interface VCSCommand
Returns:
the command arguments.

isAvailable

public boolean isAvailable()

noOp

public void noOp()

setThreadAuthorized

public void setThreadAuthorized(boolean authorized)

isAvailableImpl

protected boolean isAvailableImpl()
                           throws java.lang.Exception
Throws:
java.lang.Exception

isThreaded

protected boolean isThreaded()

noOpImpl

protected void noOpImpl()
                 throws VCSException
Throws:
VCSException

doitImpl

protected abstract int doitImpl()
                         throws java.lang.Exception
Throws:
java.lang.Exception

getExceptionHandler

protected VCSExceptionHandler getExceptionHandler()
Get the exception handler used to report errors from this command.
Returns:
an exception handler.

getLocatableURLFilter

protected URLFilter getLocatableURLFilter()
Gets the URL filter controlling locatables in the command context.
Returns:
the command's URL filter.

getContextLocatables

protected final Locatable[] getContextLocatables()
Gets the valid locatables from the context node selection, applying the filter returned by getLocatableURLFilter().
Returns:
the valid locatable context.

buildContextForEditor

protected final Context buildContextForEditor()
Build a context for invoking an editor. Certain elements in the IDE implement Locatable but not Document. As a result, you can't normally invoke an editor on such documents. This method provides a workaround for this problem. Whenever invoking an editor from a VCS command, you should use this method in preference to getContext() to ensure that Locatables are properly wrapped in Document implementing interfaces.
Returns:
a modified context that can be used to invoke an editor on the context locatable.

updateReadOnlyStates

protected final void updateReadOnlyStates(Document[] documents)
Updates the editor read-only states of documents for the given URLs.

Extension SDK


Copyright © 1997, 2004, Oracle. All rights reserved.