JDeveloper SCM API

oracle.ide.scm.util
Class SCMAbstractOptionsCustomizer

java.lang.Object
  |
  +--oracle.ide.scm.SCMOptionsCustomizerAdapter
        |
        +--oracle.ide.scm.util.SCMAbstractOptionsCustomizer
All Implemented Interfaces:
SCMOptionsCustomizer

public abstract class SCMAbstractOptionsCustomizer
extends SCMOptionsCustomizerAdapter

Utility class that makes implementing an options customizer with tri-state support easier.


Constructor Summary
SCMAbstractOptionsCustomizer()
           
 
Method Summary
 void commitOptions()
          The customizer should commit any outstanding UI changes that need to be flushed to the Options object.
protected  SCMFile[] getCurrentSelection()
          Get the last selection the customizer was notified about.
 SCMOptions getOptions()
          Get the Options object for this customizer.
protected  oracle.bm.util.ui.TriStateModel.TriStateEnum getTriState(SCMFile[] files, java.lang.String option)
          Utility method which figures out the correct tri state for a set of elements which have a boolean option.
protected abstract  void initDefaults()
          The subclass should initialize the options object with the defaults for this customizer.
 void initializeOptions(java.util.List l)
          Performs no initialization on options.
protected abstract  void saveOptions(SCMFile[] sel)
          Save the state of the UI into the options object for all selected elements.
 void selectionChanged(SCMFile[] oldSelection, SCMFile[] newSelection)
          The customizer is notified when the selection changes in the dialog it is customizing.
protected  void setTriStateOption(SCMFile file, oracle.bm.util.ui.TriStateCheckBox ts, java.lang.String optionKey)
          Utility method which sets a boolean option based on the state of a tri state checkbox.
protected  void updateMultiField(SCMFile[] sel, java.lang.String property, oracle.bm.util.ui.MultiCapable f)
          Update a multi capable text field or text area.
protected abstract  void updateUI(SCMFile[] sel)
          Update the user interface based on options for the selected
 void validateOptions()
          Perform any necessary validation on options held in the UI.
 
Methods inherited from class oracle.ide.scm.SCMOptionsCustomizerAdapter
getComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCMAbstractOptionsCustomizer

public SCMAbstractOptionsCustomizer()
Method Detail

selectionChanged

public final void selectionChanged(SCMFile[] oldSelection,
                                   SCMFile[] newSelection)
                            throws SCMSelectionVetoException
The customizer is notified when the selection changes in the dialog it is customizing. The customizer should update the SCMOptions object based on the old selection and current state of any components, then update the components being displayed based on the new selection. The customizer can veto the selection change by throwing a CustomizerSelectionVetoException. This will cause the selection to be reverted to the old selection. The exception should contain a translated string message, which will be displayed in an alert to the user.
Overrides:
selectionChanged in class SCMOptionsCustomizerAdapter
Parameters:
oldSelection - the old selection. This may be null if the dialog has just been initialized, and will be a zero-length array if the selection was clear
newSelection - the new selection. This will never be null, but may be a zero-length array if the selection has been cleared.
Throws:
oracle.bm.scm.framework.SelectionVetoException - if you want to veto the selection.

initializeOptions

public void initializeOptions(java.util.List l)
Description copied from class: SCMOptionsCustomizerAdapter
Performs no initialization on options.
Overrides:
initializeOptions in class SCMOptionsCustomizerAdapter

getOptions

public final SCMOptions getOptions()
Get the Options object for this customizer. The Options object stores information about settings applied in the dialog, and is passed back to the client when the operation's execute() method is called.
Overrides:
getOptions in class SCMOptionsCustomizerAdapter
Returns:
an SCMOptions object for this customizer

getCurrentSelection

protected final SCMFile[] getCurrentSelection()
Get the last selection the customizer was notified about.
Returns:
an array of selected SCMFile objects

validateOptions

public final void validateOptions()
                           throws SCMException
Perform any necessary validation on options held in the UI.
Overrides:
validateOptions in class SCMOptionsCustomizerAdapter
Throws:
SCMException - if validation failed on an option.

commitOptions

public final void commitOptions()
The customizer should commit any outstanding UI changes that need to be flushed to the Options object. This generally means the user has clicked OK in the dialog. In SCMAbstractOptionsCustomizer, this method is implemented to call saveOptions(), passing in the current selection. It cannot be overridden.
Overrides:
commitOptions in class SCMOptionsCustomizerAdapter

saveOptions

protected abstract void saveOptions(SCMFile[] sel)
Save the state of the UI into the options object for all selected elements.
Parameters:
sel - the elements whose options should be saved

updateUI

protected abstract void updateUI(SCMFile[] sel)
Update the user interface based on options for the selected
Parameters:
sel - The elements which should be used to populate the UI

initDefaults

protected abstract void initDefaults()
The subclass should initialize the options object with the defaults for this customizer. Use the getOptions() method to retrieve the options object for setting options.

getTriState

protected final oracle.bm.util.ui.TriStateModel.TriStateEnum getTriState(SCMFile[] files,
                                                                         java.lang.String option)
Utility method which figures out the correct tri state for a set of elements which have a boolean option.
Parameters:
files - the files to examine
option - the option to check
Returns:
SELECTED_STATE if the specified option is true for all the specified elements, UNSELECTED_STATE if false for all elements, BOTH_STATE if true for one or more and false for one or more.

setTriStateOption

protected final void setTriStateOption(SCMFile file,
                                       oracle.bm.util.ui.TriStateCheckBox ts,
                                       java.lang.String optionKey)
Utility method which sets a boolean option based on the state of a tri state checkbox. If the tri state is in the BOTH_STATE, the option is not modified. If the tri state is in the SELECTED_STATE or UNSELECED_STATE, the option is set to Boolean.TRUE or Boolean.FALSE respectively.
Parameters:
file - the file to check
ts - the tri state checkbox
optionKey - the option to look up.

updateMultiField

protected final void updateMultiField(SCMFile[] sel,
                                      java.lang.String property,
                                      oracle.bm.util.ui.MultiCapable f)
Update a multi capable text field or text area. If the value of the specified string property is the same for all elements, the text field will display the value. If there are differences, the text field will be put in the "multiple selection" state.
Parameters:
sel - the selected file(s)
property - the property to look up
f - the text field or text area, which is multi capable.

Copyright © 2002 Oracle Corporation