- Direct Known Subclasses:
- ISeriesDataTableViewPositionToDialog, ISeriesDataTableViewRecordDialog
public abstract class ISeriesDataTableViewPromptDialog
- extends SystemPromptDialog
To use the superclass:
- Subclass it, specifying the dialog title in the constructor. Optionally,
#setHelp(String) to set the dialog's help in the
#createInner(Composite) to populate the contents
#processOK() to process the pressing of the OK button
For error checking, add modify listeners to entry fields and if needed
selection listeners to buttons, then in your event handler
#setErrorMessage(SystemMessage) to display an error if
detected. Pass null to clear previous error.
#setPageComplete(boolean) with true if there are no errors
and all required data is supplied. This enables/disables OK.
For error validation when there are multiple input fields on the page, there
are two different approaches you can take:
- Just validate each field as data is entered. In the event processor for
that field, you clear the message, then set it if an error is detected in the
input data, and also call setPageComplete(errorMessage == null), where
errorMessage is your instance variable for the current error. In
performFinish, you then call the validation methods for each of the fields on
the page, and if an error is found, position the cursor, set the error
message and then call setPageComplete.
In this approach, only errors in the current field in focus are caught, and
errors in other fields are not caught until Finish is pressed.
- Same as in step 1, but if the error checking for the current field finds
no errors, then an overall validation method is called to check the other
fields, passing a parameter identifying the current field so it is skipped
for efficiency. The overall validation method calls all the individual
validation methods, except for the one that was asked to be skipped. The
performFinish method calls the overall validation method, passing null so
nothing is skipped, and if an error is detected positions the cursor.
In this approach, which is more rigorous, the error checking is always
complete for the whole page, so Finish theoretically will never catch an
error, and the page enablement is always completely accurate.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final String copyright
- See Also:
- Constant Field Values
public ISeriesDataTableViewPromptDialog(Shell shell,
protected Control getInitialFocusControl()
- See Also:
public abstract boolean isPageComplete()
- This method can be called to decide whether to enable or disable the
It returns true if the minimal information is available and currently not
showing an error message.
But dialog's field may not be correct.
(Scenario: 2 fields are invalid. User corrects one. Error message
disappears. At this point, we have to enable the OK so they can try it,
proceed to the verify() which will find the other error(s) and display
it. and disable the OK ... )
public void setPageComplete()
- Inform caller of page-complete status of this form
Copyright © 2011 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.