Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.compile
Class SystemCompileCommandEditPane

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.compile.SystemCompileCommandEditPane
All Implemented Interfaces:
ISystemCommandTextAdditionalGUIProvider, ISystemCommandTextModifyListener

public class SystemCompileCommandEditPane
extends Object
implements ISystemCommandTextAdditionalGUIProvider, ISystemCommandTextModifyListener

This class prompts the user to create or edit the contents of a single compile command. This edit pane is used in the Work With Compile Commands dialog.

So what is the "contract" the edit pane has to fulfill?

Contractually, here are the methods called by the main page of the new filter wizard:


Field Summary
protected  boolean caseSensitive
           
protected  ISystemValidator cmdLabelValidator
           
protected  SystemCommandTextField commandField
           
protected  SystemCompileManager compileManager
           
protected  Control controlInError
           
static String copyright
           
protected  SystemMessage errorMessage
           
protected  boolean fromVerify
           
protected  ISystemCompileCommandEditPaneHoster hoster
           
protected  boolean ignoreChanges
           
protected  SystemCompileCommand inputCompileCommand
           
protected  Label labelLabel
           
protected  Vector listeners
           
protected  boolean newMode
           
protected  SystemCompileType parentCompileType
           
protected  Shell shell
           
protected  boolean skipEventFiring
           
protected  Text textLabel
           
protected  SystemCmdSubstVarList varList
           
 
Constructor Summary
SystemCompileCommandEditPane(SystemCompileManager compileManager, Shell shell, ISystemCompileCommandEditPaneHoster owner, boolean caseSensitive)
          Constructor
 
Method Summary
 void addChangeListener(ISystemCompileCommandEditPaneListener l)
          Identify a listener interested in any changes made to the filter string, as they happen
protected  void addFillerLine(Composite parent, int nbrColumns)
          Add a spacer line
protected  void addGrowableFillerLine(Composite parent, int nbrColumns)
          Add a spacer line that grows in height to absorb extra space
protected  void addSeparatorLine(Composite parent, int nbrColumns)
          Add a separator line.
 boolean areErrorsPending()
          Are errors pending?
protected  boolean areFieldsComplete()
          Must be overridden if createContents is overridden.
 void clearErrorMessage()
          Clear any pending errors.
 void commandModified(String cmdText, SystemMessage errorMessage)
          Callback from SystemCommandTextField when the user modifies the command.
 void configureHeadingLabel(Label label)
          In the Work With dialog, this edit pane is shown on the right side, beside the compile command selection list.
 boolean createCommandLabelLineControls(Composite parent, int availableColumns)
          Overridable entry point for subclasses that wish to put something to the right of the "Command:" label From interface ISystemCommandTextAdditionalGUIProvider.
 Control createContents(Composite parent)
          Populate the pane with the GUI widgets
 boolean createExtraButtons(Composite parent, int availableColumns)
          Create additional buttons, to go under command prompt.
protected  void doInitializeFields()
          Initialize the input fields based on the inputCompileCommand, and perhaps subsystem.
protected  void enableExtraButtons()
          Enable/disable extra buttons added by subclass.
protected  void fireChangeEvent(SystemMessage error)
          Fire an event to all registered listeners, that the user has changed the compile command.
protected  String getCommandText()
          Get the command text as is, no massaging done.
protected  SystemCommandViewerConfiguration getCommandTextViewerConfiguration()
          For child classes to return their own subclasses of the default configurator used to enable proposal support in the command entry field.
protected  String getCompileCommandLabelRBKey()
          Overridable method that returns the key used to get the label (+".label") and tip (+".tooltip") for the default prompt for the compile command label.
protected  String getCompileCommandPromptRBKey()
          Overridable method that returns the key used to get the label (+".label") and tip (+".tooltip") for the prompt for the compile command string.
protected  SystemCompileManager getCompileManager()
          For subclasses: return the input compile manager
 Control getInitialFocusControl()
          Return the control to recieve initial focus.
protected  SystemCompileCommand getInputCompileCommand()
          Return the input compile command as given us in setCompileCommand
protected  ResourceBundle getResourceBundle()
          Overridable method that returns the resource bundle to use for the mri we show by default.
protected  Shell getShell()
          Return the shell given us in the ctor
protected  SystemConnection getSystemConnection()
          For subclasses within the subsystem factory framework: return the system connection within which this dialog was launched.
 boolean isComplete()
          Do not override.
protected  String preSaveMassage(String commandString)
          Opportunity for subclasses to perform any additional massaging of the user-entered command string, just prior to saving it.
protected  void processCommandTextChange(String newText, boolean hasError)
          Method called as user types into the command field Encapsulated out so that it can be called from various types of listeners.
protected  void processExtraButtonsChanges(SystemCompileCommand currentCmd)
          Overridable method for saving data in subclass-supplied additional GUI.
 void removeChangeListener(ISystemCompileCommandEditPaneListener l)
          Remove a listener interested in any changes made to the filter string, as they happen
protected  void resetExtraButtons(SystemCompileCommand originalCmd)
          Overridable method for resetting GUI in subclass-supplied additional GUI, when in "edit" mode
protected  void resetExtraButtonsForNewMode()
          Overridable method for resetting GUI in subclass-supplied additional GUI, when in "new" mode
protected  void resetFields()
          This is called in the work with compile commands dialog when the user selects "new", or selects another command.
 SystemCompileCommand saveChanges()
          Save all pending changes.
 void setCommandMassager(ISystemMassager massager)
          Set the action command massager.
protected  void setCommandText(String text)
          Set the command text
protected  void setCommandTextViewerConfiguration(SystemCommandViewerConfiguration cmdAssistant)
          For child classes (such as iSeries IFS) that need to dynamically change the command entry field configuration, on the fly.
 void setCommandValidator(ISystemValidator validator)
          Set the action command validator.
 void setCompileCommand(SystemCompileType parentCompileType, SystemCompileCommand compileCommand)
          Set the input filter string, in edit mode.
 void setCompileLabelValidator(ISystemValidator validator)
          Set the validator to use for the compile command.
protected  void setIgnoreChanges(boolean ignoreChanges)
          Turn on ignore changes mode.
 void setSubstitutionVariableList(SystemCmdSubstVarList varList)
          Set the substitution variable list that Insert Variable will use.
 SystemMessage validate(boolean skipLabel, boolean skipString)
          Does complete verification of input fields.
protected  SystemMessage validateLabelInput()
          Validates compile command label as entered so far in the text field.
protected  SystemMessage validateStringInput()
          Validates compile command string as entered so far in the text field.
 SystemMessage verify()
          Does complete verification of input fields.
 void widgetDefaultSelected(SelectionEvent event)
          User has selected something via enter/dbl-click
 void widgetSelected(SelectionEvent event)
          User has selected something
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

shell

protected Shell shell

hoster

protected ISystemCompileCommandEditPaneHoster hoster

compileManager

protected SystemCompileManager compileManager

inputCompileCommand

protected SystemCompileCommand inputCompileCommand

parentCompileType

protected SystemCompileType parentCompileType

listeners

protected Vector listeners

varList

protected SystemCmdSubstVarList varList

newMode

protected boolean newMode

ignoreChanges

protected boolean ignoreChanges

labelLabel

protected Label labelLabel

textLabel

protected Text textLabel

commandField

protected SystemCommandTextField commandField

errorMessage

protected SystemMessage errorMessage

skipEventFiring

protected boolean skipEventFiring

fromVerify

protected boolean fromVerify

caseSensitive

protected boolean caseSensitive

controlInError

protected Control controlInError

cmdLabelValidator

protected ISystemValidator cmdLabelValidator
Constructor Detail

SystemCompileCommandEditPane

public SystemCompileCommandEditPane(SystemCompileManager compileManager,
                                    Shell shell,
                                    ISystemCompileCommandEditPaneHoster owner,
                                    boolean caseSensitive)
Constructor

Parameters:
compileManager - - the compile manager owner of this compile command
shell - - the shell of the wizard or dialog host this
owner - - the dialog or property page hosting this edit pane
Method Detail

getShell

protected Shell getShell()
Return the shell given us in the ctor


getInputCompileCommand

protected SystemCompileCommand getInputCompileCommand()
Return the input compile command as given us in setCompileCommand


getCompileManager

protected SystemCompileManager getCompileManager()
For subclasses: return the input compile manager


getSystemConnection

protected SystemConnection getSystemConnection()
For subclasses within the subsystem factory framework: return the system connection within which this dialog was launched.


setCompileLabelValidator

public void setCompileLabelValidator(ISystemValidator validator)
Set the validator to use for the compile command. By default, ValidatorCompileCommandLabel is used.


setIgnoreChanges

protected void setIgnoreChanges(boolean ignoreChanges)
Turn on ignore changes mode. Subclasses typically can just query the inherited field ignoreChanges, unless they need to set the ignoreChanges mode in their own composite widgets, in which case they can override and intercept this.


addChangeListener

public void addChangeListener(ISystemCompileCommandEditPaneListener l)
Identify a listener interested in any changes made to the filter string, as they happen


removeChangeListener

public void removeChangeListener(ISystemCompileCommandEditPaneListener l)
Remove a listener interested in any changes made to the filter string, as they happen


setCommandValidator

public void setCommandValidator(ISystemValidator validator)
Set the action command validator. This is called per keystroke as the user types the command.


setCommandMassager

public void setCommandMassager(ISystemMassager massager)
Set the action command massager. This is called before saving the command to the persistent store, to allow for massaging what the user typed, such as doing intelligent uppercasing.


setSubstitutionVariableList

public void setSubstitutionVariableList(SystemCmdSubstVarList varList)
Set the substitution variable list that Insert Variable will use.


getCommandTextViewerConfiguration

protected SystemCommandViewerConfiguration getCommandTextViewerConfiguration()
For child classes to return their own subclasses of the default configurator used to enable proposal support in the command entry field.


setCommandTextViewerConfiguration

protected void setCommandTextViewerConfiguration(SystemCommandViewerConfiguration cmdAssistant)
For child classes (such as iSeries IFS) that need to dynamically change the command entry field configuration, on the fly.


setCompileCommand

public void setCompileCommand(SystemCompileType parentCompileType,
                              SystemCompileCommand compileCommand)
Set the input filter string, in edit mode. Or pass null if reseting to new mode.


saveChanges

public SystemCompileCommand saveChanges()
Save all pending changes. Called by dialog when user Presses Apply.

Returns:
new or updated compile command object. Caller must call writeToDisk() on the parent SystemCompileProfile object

preSaveMassage

protected String preSaveMassage(String commandString)
Opportunity for subclasses to perform any additional massaging of the user-entered command string, just prior to saving it.


configureHeadingLabel

public void configureHeadingLabel(Label label)
In the Work With dialog, this edit pane is shown on the right side, beside the compile command selection list. Above it is a label, that shows something like "Selected Compile Command" in edit mode, or "New Compile Command" in new mode.

This method gives subclasses the opportunity to specify unique values for this label. In addition to setting the text, the tooltip text should also be set.


createContents

public Control createContents(Composite parent)
Populate the pane with the GUI widgets

Parameters:
parent -
Returns:
Control

getInitialFocusControl

public Control getInitialFocusControl()
Return the control to recieve initial focus. Should be overridden if you override createContents


createCommandLabelLineControls

public boolean createCommandLabelLineControls(Composite parent,
                                              int availableColumns)
Overridable entry point for subclasses that wish to put something to the right of the "Command:" label From interface ISystemCommandTextAdditionalGUIProvider.

Specified by:
createCommandLabelLineControls in interface ISystemCommandTextAdditionalGUIProvider
Returns:
true if something entered to take up the available columns, false otherwise (will be padded)

createExtraButtons

public boolean createExtraButtons(Composite parent,
                                  int availableColumns)
Create additional buttons, to go under command prompt. Overridable. From interface ISystemCommandTextAdditionalGUIProvider.

Specified by:
createExtraButtons in interface ISystemCommandTextAdditionalGUIProvider
Returns:
true if something entered to take up the available columns, false otherwise (will be padded)

enableExtraButtons

protected void enableExtraButtons()
Enable/disable extra buttons added by subclass. Called when state changes Overridable


resetExtraButtonsForNewMode

protected void resetExtraButtonsForNewMode()
Overridable method for resetting GUI in subclass-supplied additional GUI, when in "new" mode


resetExtraButtons

protected void resetExtraButtons(SystemCompileCommand originalCmd)
Overridable method for resetting GUI in subclass-supplied additional GUI, when in "edit" mode


processExtraButtonsChanges

protected void processExtraButtonsChanges(SystemCompileCommand currentCmd)
Overridable method for saving data in subclass-supplied additional GUI.


getResourceBundle

protected ResourceBundle getResourceBundle()
Overridable method that returns the resource bundle to use for the mri we show by default.

Not used if you override createContents


getCompileCommandLabelRBKey

protected String getCompileCommandLabelRBKey()
Overridable method that returns the key used to get the label (+".label") and tip (+".tooltip") for the default prompt for the compile command label.

Not used if you override createContents


getCompileCommandPromptRBKey

protected String getCompileCommandPromptRBKey()
Overridable method that returns the key used to get the label (+".label") and tip (+".tooltip") for the prompt for the compile command string.

Not used if you override createContents


doInitializeFields

protected void doInitializeFields()
Initialize the input fields based on the inputCompileCommand, and perhaps subsystem. This can be called before createContents, so test for null widgets first! Prior to this being called, resetFields is called to set the initial default state prior to input


resetFields

protected void resetFields()
This is called in the work with compile commands dialog when the user selects "new", or selects another command. You must override this if you override createContents. Be sure to test if the contents have even been created yet!


isComplete

public boolean isComplete()
Do not override. Instead, override areFieldsComplete().

This is called by the dialog when first shown, to decide if the default information is complete enough to enable finish. It doesn't do validation, that will be done when finish is pressed.


areFieldsComplete

protected boolean areFieldsComplete()
Must be overridden if createContents is overridden.

This is called by the isComplete, to decide if the default information is complete enough to enable finish. It doesn't do validation, that will be done when finish is pressed.


areErrorsPending

public boolean areErrorsPending()
Are errors pending? Used in dialog to prevent changing the compile command selection


clearErrorMessage

public void clearErrorMessage()
Clear any pending errors. Called when Revert pressed.


commandModified

public void commandModified(String cmdText,
                            SystemMessage errorMessage)
Callback from SystemCommandTextField when the user modifies the command.

Specified by:
commandModified in interface ISystemCommandTextModifyListener
Parameters:
cmdText - - current contents of the field
errorMessage - - potential error detected by the default validator

processCommandTextChange

protected void processCommandTextChange(String newText,
                                        boolean hasError)
Method called as user types into the command field Encapsulated out so that it can be called from various types of listeners. Further, it is easily overridden


setCommandText

protected void setCommandText(String text)
Set the command text


getCommandText

protected String getCommandText()
Get the command text as is, no massaging done.


fireChangeEvent

protected void fireChangeEvent(SystemMessage error)
Fire an event to all registered listeners, that the user has changed the compile command. Include the error message, if in error, so it can be displayed to the user.

Because this is used to enable/disable the Next and Finish buttons it is important to call it when asked to do verification, even if nothing has changed.

It is more efficient, however, to defer the event firing during a full verification until after the last widget has been verified. To enable this, set the protected variable "skipEventFiring" to true at the top of your verify event, then to "false" at the end. Then do fireChangeEvent(errorMessage);


validateLabelInput

protected SystemMessage validateLabelInput()
Validates compile command label as entered so far in the text field. Not called if you override createContents() and verify()


validateStringInput

protected SystemMessage validateStringInput()
Validates compile command string as entered so far in the text field. Not called if you override createContents() and verify()


validate

public SystemMessage validate(boolean skipLabel,
                              boolean skipString)
Does complete verification of input fields. This has to handle being called from a particular validator method or from verify.

Returns:
error message if there is one, else null if ok

verify

public SystemMessage verify()
Does complete verification of input fields. If this method returns null, there are no errors and the dialog or wizard can close;

Returns:
error message if there is one, else null if ok

widgetSelected

public void widgetSelected(SelectionEvent event)
User has selected something


widgetDefaultSelected

public void widgetDefaultSelected(SelectionEvent event)
User has selected something via enter/dbl-click


addSeparatorLine

protected void addSeparatorLine(Composite parent,
                                int nbrColumns)
Add a separator line. This is a physically visible line.


addFillerLine

protected void addFillerLine(Composite parent,
                             int nbrColumns)
Add a spacer line


addGrowableFillerLine

protected void addGrowableFillerLine(Composite parent,
                                     int nbrColumns)
Add a spacer line that grows in height to absorb extra space


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.