This class provides the panel that is used in a FormatSelector. The typical
client should have no direct contact with this class if using the FormatSelector.
The class creates a panel with a combo-box containing a list of types and a list-box
with choices based on the type selected in the combox. Spinners allow
the specification of width and the number of decimal places.
Typical use is shown:
FormatSelectorPanel formatSelectorPanel = new FormatSelectorPanel(formatAdapter, Types.DOUBLE, incomingFormat);
// ... place Panel in some container and display the container
// when the Ok button is pressed ...
formatSelectorPanel.onApply();
// ... once onApply() is called it's valid to call getFormatString() ...
String selectedFormat = formatSelectorPanel.getFormatString();
formatAdapterInterface - the FormatAdapterInterface object to be used by this
visual to seed the dialog
sqlType - the SQL type for which format choices are to be displayed. The only
type supported is DOUBLE.
incomingformat - the format choice which appears selected when the dialog is
first displayed. Typically specified if there is a format associated with
the object for which this selector is being displayed. If null, no choice
is selected.
This method is to be called to get the SAS format string representation of the format
choice selected by the user. Do note that the onApply() method should have been
called before this method is invoked.
Returns:
the string representation of the format selected; null is returned if no choice is made
getFormatWidth
protected int getFormatWidth()
onApply
public void onApply()
This method is to be called when the OK button is clicked. It creates a String
representation of the format based on the selections made. A call to
getFormatString() after this method is invoked will return the SAS format string.