JDeveloper SCM API

oracle.ide.scm.op
Class SCMFileOperation

java.lang.Object
  |
  +--oracle.ide.scm.op.SCMFileOperation
All Implemented Interfaces:
SCMOperation
Direct Known Subclasses:
SCMMultiFileOperation, SCMSingleFileOperation

public abstract class SCMFileOperation
extends java.lang.Object
implements SCMOperation

Client adapter for all file operations. Deferred methods are :

Implementation is provided for the following virtuals in subclasses :


Constructor Summary
SCMFileOperation()
           
 
Method Summary
 void execute()
          Provides notification that the operation has been invoked on a selection whose elements have entirely been filtered.
abstract  void execute(java.util.Iterator selection, SCMOptions options)
          Executes the operation, through shell runner or direct interface, on the given files.
abstract  boolean filter(SCMFile file)
          Asks whether this file passes a filter, and is retained from the current selection.
abstract  SCMDialogSpecification getDialogSpecification()
          Determines the form of standard dialog shown to the user with the invokation of the represented action, and its configuration.
 byte getFileContext()
          Gets the file context for the operation, which specifies the allowable file types for a base selection (prior to recursion).
 boolean getFilterDisables()
          Asks whether, if a file operation, a selection which has entirely failed the filter results in the operation being disabled.
abstract  int getMaxSelection()
          Gets the maximum number of files that can form a valid selection for this operation implementor.
 boolean isEnabled(boolean control, SCMContext context)
          File operation's implementation of the 'enabled by source control' query method.
abstract  boolean isSelectionRecursive()
          Asks whether the operation requires the file selection to be recursive (that is, contain all files below selected directories and nested directories).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.ide.scm.SCMOperation
getControlItem
 

Constructor Detail

SCMFileOperation

public SCMFileOperation()
Method Detail

getFileContext

public byte getFileContext()
Gets the file context for the operation, which specifies the allowable file types for a base selection (prior to recursion). To enforce a particular context, override this method and use constants from the framework interface SCMFileContext for return.
Returns:
a value indicating the required operation base context.

getDialogSpecification

public abstract SCMDialogSpecification getDialogSpecification()
Determines the form of standard dialog shown to the user with the invokation of the represented action, and its configuration. The dialog is, in all cases, a file lister which gives the user the ability to select and deselect files and set command options for each. This is not available to operations which do not operation on files.
Returns:
an specification for the dialog that should be shown to the user after the operation has filtered the file selection, and prior to execution, or null if no dialog is to be shown.

isSelectionRecursive

public abstract boolean isSelectionRecursive()
Asks whether the operation requires the file selection to be recursive (that is, contain all files below selected directories and nested directories). In most situations, this will be the case. This call, distinct from getOperationType(), is necessary because the navigator tree may support multiple (base element) selection in the future.
Returns:
a verdict for recursing on associations & directories.

filter

public abstract boolean filter(SCMFile file)
                        throws SCMException
Asks whether this file passes a filter, and is retained from the current selection. The operation is expected to test the file's current status, its extension, nature of file (file or directory), and so forth. The method is guaranteed to be called before execution, and can be called with an unsaved file, so a test of whether the file exists is recommended before status checks.
Parameters:
file - the file from the current selection
Returns:
a verdict on whether the file passes the filter.
Throws:
SCMException - if a client error is raised to abort the filter.

execute

public abstract void execute(java.util.Iterator selection,
                             SCMOptions options)
                      throws SCMException
Executes the operation, through shell runner or direct interface, on the given files. The iterator will finish early if the operation is cancelled.
Parameters:
selection - an iterator over the filtered file selection, which may be null if this is a no-file operation.
Throws:
SCMException - if a client error is raised to abort execution.

getMaxSelection

public abstract int getMaxSelection()
Gets the maximum number of files that can form a valid selection for this operation implementor.
Returns:
a value for the maximum number selectable files.

isEnabled

public boolean isEnabled(boolean control,
                         SCMContext context)
File operation's implementation of the 'enabled by source control' query method. Since file operations generally require a client, returns true if SCM is ready.
Specified by:
isEnabled in interface SCMOperation
Parameters:
control - source control enabled state indicator.
context - the IDE's current context.
Returns:
the value of the control parameter.

getFilterDisables

public boolean getFilterDisables()
Asks whether, if a file operation, a selection which has entirely failed the filter results in the operation being disabled. An exception thrown from the filter may be reported when the user attempts to invoke the action for this operation.
Returns:
a verdict on whether the filter can disable the operation.

execute

public void execute()
             throws SCMException
Provides notification that the operation has been invoked on a selection whose elements have entirely been filtered. This is also the best opportunity to throw an appropriate exception if a selection is required.
Throws:
SCMException - if a client error is raised to abort execution.

Copyright © 2002 Oracle Corporation