RSE
Release 1.0

org.eclipse.rse.files.ui.actions
Class SystemSelectFileTypesAction

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.jface.action.AbstractAction
          extended byorg.eclipse.jface.action.Action
              extended byorg.eclipse.rse.ui.actions.SystemBaseAction
                  extended byorg.eclipse.rse.ui.actions.SystemBaseDialogAction
                      extended byorg.eclipse.rse.files.ui.actions.SystemSelectFileTypesAction
All Implemented Interfaces:
IAction, ISelectionChangedListener, ISystemAction, ISystemDialogAction
Direct Known Subclasses:
SystemSearchSelectFileTypesAction

public class SystemSelectFileTypesAction
extends SystemBaseDialogAction

The action for allowing the user to select one or more file types, using the Eclipse dialog for this. The types are from the file editor registry, as specified in the Workbench preferences.

To set preselected types, use setTypes(List) or setTypes(String[]). Or, if you have single string of comma-separated types, call setTypes(String).

After running, and checking wasCancelled(), you can query the selected types using one of:

  1. getTypes() to retrieve the selected types as a List
  2. getTypesArray() to retrieve the selected types as a String array
  3. getTypesString() to retrieve the selected types as a single String of comma-delimited selections

    Note the types are remembered after running, so a subsequent run will result in the previous types being preselected, assuming you re-use the same instance of this class.

    See Also:
    SystemSelectFileTypesDialog

    Field Summary
    protected  List types
               
     
    Fields inherited from class org.eclipse.rse.ui.actions.SystemBaseDialogAction
    cancelled, dlgHelpId, needsProgressMonitor, needsProgressMonitorSet, processAll, value
     
    Fields inherited from class org.eclipse.rse.ui.actions.SystemBaseAction
    allowOnMultipleSelection, arrowCursor, helpId, selectionSensitive, shell, sSelection, traceSelections, traceTarget, viewer, waitCursor
     
    Fields inherited from interface org.eclipse.jface.action.IAction
    AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
     
    Constructor Summary
    SystemSelectFileTypesAction(Shell shell)
              Constructor To set preselected types, use setTypes(List) or setTypes(String[]).
     
    Method Summary
     Dialog createDialog(Shell parent)
              Create and return the dialog
     Object getDialogValue(Dialog dlg)
              Parent abstract method.
     List getTypes()
              Get the selected file types after running the action.
     String[] getTypesArray()
              Get the selected file types after running the action.
     String getTypesString()
              Get the selected file types as a concatenated list of strings, comma-separated
     void setTypes(List types)
              Set the current input types as a java.util List, such as ArrayList Each type is a file name extension, without the dot, as in "java" or "class"
     void setTypes(String typeString)
              Set the current input types given a comma-separated list as a single String.
     void setTypes(String[] types)
              Set the current input types as a String array.
     boolean wasCancelled()
              Return true if the dialog was cancelled by the user.
     
    Methods inherited from class org.eclipse.rse.ui.actions.SystemBaseDialogAction
    getDialogHelpContextId, getNeedsProgressMonitor, getProcessAllSelections, getValue, run, setDialogHelp, setNeedsProgressMonitor, setProcessAllSelections, setValue, wasNeedsProgressMonitorSet
     
    Methods inherited from class org.eclipse.rse.ui.actions.SystemBaseAction
    allowOnMultipleSelection, checkObjectType, getAdapter, getContextMenuGroup, getCurrentTreeView, getFirstSelection, getHelpContextId, getNextSelection, getRemoteAdapter, getSelection, getSelectionProvider, getShell, getShell, getSystemConnection, getViewer, isDummy, isEnabled, isSelectionSensitive, issueTraceMessage, selectionChanged, setAvailableOffline, setBusyCursor, setContextMenuGroup, setDisplayCursor, setDisplayCursor, setHelp, setHost, setInputs, setSelection, setSelectionProvider, setSelectionSensitive, setShell, setTracing, setTracing, setViewer, updateSelection
     
    Methods inherited from class org.eclipse.jface.action.Action
    convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
     
    Methods inherited from class org.eclipse.jface.action.AbstractAction
    addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
     
    Methods inherited from class org.eclipse.core.commands.common.EventManager
    addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.eclipse.rse.ui.actions.ISystemAction
    allowOnMultipleSelection, getContextMenuGroup, getHelpContextId, getSelection, getShell, getViewer, isDummy, isSelectionSensitive, setContextMenuGroup, setHelp, setInputs, setSelection, setSelectionSensitive, setShell, setViewer
     
    Methods inherited from interface org.eclipse.jface.action.IAction
    addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
     
    Methods inherited from interface org.eclipse.jface.viewers.ISelectionChangedListener
    selectionChanged
     

    Field Detail

    types

    protected List types
    Constructor Detail

    SystemSelectFileTypesAction

    public SystemSelectFileTypesAction(Shell shell)
    Constructor To set preselected types, use setTypes(List) or setTypes(String[]). Note the types are remember after running, so a subsequent run will result in the previous types being preselected.

    Method Detail

    setTypes

    public void setTypes(String[] types)
    Set the current input types as a String array. Each type is a file name extension, without the dot, as in "java" or "class"


    setTypes

    public void setTypes(List types)
    Set the current input types as a java.util List, such as ArrayList Each type is a file name extension, without the dot, as in "java" or "class"


    setTypes

    public void setTypes(String typeString)
    Set the current input types given a comma-separated list as a single String.


    getTypes

    public List getTypes()
    Get the selected file types after running the action. Returns an ArrayList


    getTypesArray

    public String[] getTypesArray()
    Get the selected file types after running the action. Returns a String array


    getTypesString

    public String getTypesString()
    Get the selected file types as a concatenated list of strings, comma-separated


    wasCancelled

    public boolean wasCancelled()
    Return true if the dialog was cancelled by the user. Only valid after calling run().

    Specified by:
    wasCancelled in interface ISystemDialogAction
    Overrides:
    wasCancelled in class SystemBaseDialogAction

    createDialog

    public Dialog createDialog(Shell parent)
    Create and return the dialog

    Specified by:
    createDialog in class SystemBaseDialogAction
    See Also:
    SystemBaseDialogAction.run()

    getDialogValue

    public Object getDialogValue(Dialog dlg)
    Parent abstract method. Called after dialog runs, to retrieve the value from the dialog. Will return null if dialog cancelled.

    Specified by:
    getDialogValue in class SystemBaseDialogAction
    Parameters:
    dlg - The dialog object, after it has returned from open.

    RSE
    Release 1.0

    Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.