Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.widgets
Class SystemEditPaneStateMachine

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.widgets.SystemEditPaneStateMachine
All Implemented Interfaces:
ISystemEditPaneStates

public class SystemEditPaneStateMachine
extends Object
implements ISystemEditPaneStates


Field Summary
static String copyright
           
 
Fields inherited from interface com.ibm.etools.systems.core.ui.widgets.ISystemEditPaneStates
MODE_EDIT, MODE_NEW, MODE_UNSET, STATE_APPLIED, STATE_INITIAL, STATE_PENDING
 
Constructor Summary
SystemEditPaneStateMachine(Composite composite, Button applyButton, Button resetButton)
          Constructor for SystemEditPaneStateMachine.
 
Method Summary
 void applyPressed()
          User has successfully pressed Apply (that is, no errors found)
 boolean areChangesPending()
          Are any changes pending?
 void backup()
          Backup state method
 Button getApplyButton()
          Returns the applyButton.
 Composite getComposite()
          Returns the composite.
 int getMode()
          Returns the mode.
 boolean getNewSetByDelete()
           
 Button getResetButton()
          Returns the resetButton.
 int getState()
          Returns the state.
 boolean isSaveRequired()
          Query if it is ok to switch modes.
 void resetPressed()
          User has successfully pressed Reset (that is, no errors found)
 void restore()
          Restore state method
 void setApplyLabelForNewMode(String label, String tooltip)
          Set the label and tooltip to use for the apply button in "new" mode.
 void setChangesMade()
          User has made changes, such as typing text or selecting a checkbox or radio button.
 void setEditMode()
          Set the mode to "Edit".
 void setNewMode()
          Set the mode to "New".
 void setNewSetByDelete(boolean newSetByDelete)
           
 void setUnsetMode()
          Set the mode to "Unset".
 
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
Constructor Detail

SystemEditPaneStateMachine

public SystemEditPaneStateMachine(Composite composite,
                                  Button applyButton,
                                  Button resetButton)
Constructor for SystemEditPaneStateMachine.

This constructor sets the initial mode to MODE_UNSET.

While this class will handle enabling/disabling the apply/reset buttons, it is still your job to add listeners and actually do the applying and resetting!

Parameters:
composite - - overall composite of the edit pane
applyButton - - the Apply pushbutton
resetButton - - the Reset pushbutton. Can be null.
Method Detail

setApplyLabelForNewMode

public void setApplyLabelForNewMode(String label,
                                    String tooltip)
Set the label and tooltip to use for the apply button in "new" mode. By default, generic values are used


setNewMode

public void setNewMode()
Set the mode to "New". User has selected "new" and wants to create a new thing. It is your responsibility to call isSaveRequired() first. It is assumed that after the object is created by pressing Apply, your UI will select the new object and then call setEditMode


setEditMode

public void setEditMode()
Set the mode to "Edit". User has selected an existing object and wants to changed/edit it It is your responsibility to call isSaveRequired() first.


setUnsetMode

public void setUnsetMode()
Set the mode to "Unset". User has selected nothing or something not editable It is your responsibility to call isSaveRequired() first.


setChangesMade

public void setChangesMade()
User has made changes, such as typing text or selecting a checkbox or radio button. It is VERY important this be called religiously for every possible change the user can make!


isSaveRequired

public boolean isSaveRequired()
Query if it is ok to switch modes. If no changes pending, returns false If changes pending, user is asked to whether to save (true) or discard (false).


applyPressed

public void applyPressed()
User has successfully pressed Apply (that is, no errors found)


resetPressed

public void resetPressed()
User has successfully pressed Reset (that is, no errors found)


areChangesPending

public boolean areChangesPending()
Are any changes pending?


getResetButton

public Button getResetButton()
Returns the resetButton.

Returns:
Button

getApplyButton

public Button getApplyButton()
Returns the applyButton.

Returns:
Button

getComposite

public Composite getComposite()
Returns the composite.

Returns:
Composite

getMode

public int getMode()
Returns the mode.

Returns:
int
See Also:
ISystemEditPaneStates

getState

public int getState()
Returns the state.

Returns:
int
See Also:
ISystemEditPaneStates

setNewSetByDelete

public void setNewSetByDelete(boolean newSetByDelete)

getNewSetByDelete

public boolean getNewSetByDelete()

backup

public void backup()
Backup state method


restore

public void restore()
Restore state method


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.