Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.dialogs.datatableview
Class ISeriesDataTableViewPromptDialog

java.lang.Object
  extended by SystemPromptDialog
      extended by com.ibm.etools.iseries.rse.ui.dialogs.datatableview.ISeriesDataTableViewPromptDialog
Direct Known Subclasses:
ISeriesDataTableViewPositionToDialog, ISeriesDataTableViewRecordDialog

public abstract class ISeriesDataTableViewPromptDialog
extends SystemPromptDialog

To use the superclass:

  1. Subclass it, specifying the dialog title in the constructor. Optionally, also call #setHelp(String) to set the dialog's help in the constructor.
  2. Override #createInner(Composite) to populate the contents
  3. Override #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

  1. Call #setErrorMessage(SystemMessage) to display an error if detected. Pass null to clear previous error.
  2. Call #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:

  1. 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.
  2. 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.


Field Summary
static String copyright
           
 
Constructor Summary
ISeriesDataTableViewPromptDialog(Shell shell, String title)
           
 
Method Summary
protected  Control getInitialFocusControl()
           
abstract  boolean isPageComplete()
          This method can be called to decide whether to enable or disable the buttons.
 void setPageComplete()
          Inform caller of page-complete status of this form
 
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

ISeriesDataTableViewPromptDialog

public ISeriesDataTableViewPromptDialog(Shell shell,
                                        String title)
Method Detail

getInitialFocusControl

protected Control getInitialFocusControl()
See Also:
SystemPromptDialog#getInitialFocusControl()

isPageComplete

public abstract boolean isPageComplete()
This method can be called to decide whether to enable or disable the buttons. 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 ... )


setPageComplete

public void setPageComplete()
Inform caller of page-complete status of this form


Rational Developer for Power Systems Software
V7.6

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.