|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.ui.widgets.SystemEditPaneStateMachine
public class SystemEditPaneStateMachine
This class encapsulates the states an edit page (with apply/reset buttons) can go through and handle managing the state transitions. For example, it manages the enabled/disabled state of the apply/reset buttons.
There are three modes supported:
ISystemEditPaneStates
To use this properly, call the following methods at the appropriate times:
setNewMode()
-> when users selects to create a new thing.
setEditMode()
-> when user selects to edit an existing thing.
setUnsetMode()
-> when user selects nothing or something not editable
setChangesMade()
-> when user changes anything in the pane!
isSaveRequired()
-> if changes are pending, this will prompt the user if they wish to save the
changes or discard the changes. Returns true or false.
applyPressed()
-> when user successfully presses apply
resetPressed()
-> when user successfully presses reset
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 |
Constructor Detail |
---|
public SystemEditPaneStateMachine(Composite composite, Button applyButton, Button resetButton)
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!
composite
- - overall composite of the edit paneapplyButton
- - the Apply pushbuttonresetButton
- - the Reset pushbutton. Can be null.Method Detail |
---|
public void setApplyLabelForNewMode(String label, String tooltip)
public void setNewMode()
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
public void setEditMode()
isSaveRequired()
first.
public void setUnsetMode()
isSaveRequired()
first.
public void setChangesMade()
public boolean isSaveRequired()
public void applyPressed()
public void resetPressed()
public boolean areChangesPending()
public Button getResetButton()
public Button getApplyButton()
public Composite getComposite()
public int getMode()
ISystemEditPaneStates
public int getState()
ISystemEditPaneStates
public void setNewSetByDelete(boolean newSetByDelete)
public boolean getNewSetByDelete()
public void backup()
public void restore()
|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |