All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Components |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sas.swing.visuals.dataselectors.format
Class FormatSelector

    com.sas.swing.visuals.dataselectors.format.FormatSelector

All Implemented Interfaces:
  LayoutConstants, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    @SASScope(value="ALL")
    public class FormatSelector

This class provides a dialog for format selection. The user is presented a choice of types and based on the type selected, a list of format choices for the type. Selection of width and decimal specifications (if applicable to that choice) is allowed.

Typical use is shown:

        FormatSelector formatSelector = new FormatSelector(component, formatAdapter, Types.DOUBLE, incomingFormat);
        formatSelector.setVisible(true);
        if (!formatSelector.wasCancelled()) {
            String format = formatSelector.getFormatString();
            // use the format returned ...
        }

See Also:
  Serialized Form

Field Summary

Fields inherited from class com.sas.swing.visuals.OptionsDialog
`buttons`

Fields inherited from interface com.sas.swing.visuals.util.LayoutConstants
`DOTS_BUTTON_INSETS, EMPTY_INSETS, HGAP, HMARGIN, INDENTED_BORDER, TAB_BORDER, TEXTFIELD_INSETS, VGAP, VMARGIN`

Constructor Summary
`FormatSelector(java.awt.Component source, FormatAdapterInterface formatAdapterInterface, int sqlType, java.lang.String incomingformat)` FormatSelector Constructor.

Method Summary
`java.lang.String` | `getFormatString()` Returns the SAS format string representation of the format choice selected by the user.
`void` | `onApply()` This method is to be called when the OK button is clicked.

Methods inherited from class com.sas.swing.visuals.OptionsDialog
`actionPerformed, addButton, createButtons, getButton, getButtonLocation, getHelpID, getMainPanel, getPanel, onCancel, onClose, onHelp, onOK, processWindowEvent, setButtonLocation, setButtons, setHelpID, setPanel, setVisible, updateButtonsForPanel, wasCancelled`

Constructor Detail

### FormatSelector

    public FormatSelector(java.awt.Component source,
                          FormatAdapterInterface formatAdapterInterface,
                          int sqlType,
                          java.lang.String incomingformat)

  FormatSelector Constructor.

  Parameters:
    `source` - the component from which this selector is spawned
    `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.

Method Detail

### onApply

    public void onApply()

  This method is to be called when the OK button is clicked. It invokes the corresponding method in the panel and then caches the selected format from the panel. In typical use (see class description), this method is not invoked by the client and invoked by the framework.

  Overrides:
    `onApply` in class `OptionsDialog`

### getFormatString

    public java.lang.String getFormatString()

  Returns the SAS format string representation of the format choice selected by the user. For typical use see class description. The value returned will be undefined if the user Cancels out of the dialog.

  Returns:
    the string representation of the format selected

All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Components |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 SAS Institute Inc. All Rights Reserved.