Remote Systems
v6.4.1

com.ibm.etools.systems.files.ui.widgets
Class SystemRemoteFolderCombo

java.lang.Object
  extended byComposite
      extended bycom.ibm.etools.systems.files.ui.widgets.SystemRemoteFolderCombo
All Implemented Interfaces:
ISystemCombo, ISystemFileConstants

public class SystemRemoteFolderCombo
extends Composite
implements ISystemFileConstants, ISystemCombo

This re-usable widget is for selecting a new or previously specified folder path within a given connection.

Unlike SystemQualifiedRemoteFolderCombo, this widget does not combine the connection name with the folder name. That means if you want to restrict this to a particular connection, you must call setSystemConnection. If you want to restrict to any connections of a particular system type, call setSystemType.

Because this combo only deals with strings, versus IRemoteFile, it is left to the caller to interpret that string as desired.

The composite is layed as follows:


   Folder: ______________v  Browse...
 

See Also:
Serialized Form

Field Summary
static String copyright
           
 
Fields inherited from interface com.ibm.etools.systems.files.ui.ISystemFileConstants
ACTION_ADDFILEFILTERSTRING, ACTION_ID, ACTION_NEWFILEFILTER, ACTION_NEWFILEFILTERSTRING, ACTION_NEWNESTEDFILEFILTER, ACTION_SELECTFILETYPES, ACTION_UPDATEFILEFILTER, ACTION_UPDATEFILEFILTERSTRING, ICON_DIR, ICON_EXT, ICON_PATH, ICON_SUFFIX, PLUGIN_ID, PREFIX, RESID_CHGFILEFILTER_TITLE, RESID_CHGFILEFILTERSTRING_TITLE, RESID_ENTER_OR_SELECT_FILE_ENTER_LABEL, RESID_ENTER_OR_SELECT_FILE_ENTER_TOOLTIP, RESID_ENTER_OR_SELECT_FILE_FILE_LABEL, RESID_ENTER_OR_SELECT_FILE_FILE_TOOLTIP, RESID_ENTER_OR_SELECT_FILE_PREFIX, RESID_ENTER_OR_SELECT_FILE_SELECT_TOOLTIP, RESID_ENTER_OR_SELECT_FILE_TITLE, RESID_ENTER_OR_SELECT_FILE_VERBAGE_LABEL, RESID_FILEFILTER_FILE_ROOT, RESID_FILEFILTER_FOLDER_ROOT, RESID_FILEFILTER_NAME_ROOT, RESID_FILEFILTER_ROOT, RESID_FILEFILTER_STRING_ROOT, RESID_FILEFILTERSTRING_BYFILENAME_ROOT, RESID_FILEFILTERSTRING_BYFILETYPES_ROOT, RESID_FILEFILTERSTRING_FILE_ROOT, RESID_FILEFILTERSTRING_FOLDER_ROOT, RESID_FILEFILTERSTRING_INCFILES_ROOT, RESID_FILEFILTERSTRING_INCFILESONLY_ROOT, RESID_FILEFILTERSTRING_INCFOLDERS_ROOT, RESID_FILEFILTERSTRING_ROOT, RESID_FILEFILTERSTRING_SELECTTYPES_ROOT, RESID_FILEFILTERSTRING_TEST_ROOT, RESID_FILEFILTERSTRING_TYPES_ROOT, RESID_FILTER_DRIVES, RESID_FILTER_HOME, RESID_FILTER_MYHOME, RESID_FILTER_ROOTFILES, RESID_FILTER_ROOTFOLDERS, RESID_FILTER_ROOTS, RESID_FILTER_USERHOME, RESID_HOMEPROMPT_PROMPT_ROOT, RESID_HOMEPROMPT_TITLE, RESID_HOMEPROMPT_VERBAGE, RESID_NEWFILEFILTER_PAGE1_DESCRIPTION, RESID_NEWFILEFILTER_PAGE1_TITLE, RESID_NEWFILTERSTRING_PAGE1_DESCRIPTION, RESID_NEWFILTERSTRING_PAGE1_TITLE, RESID_NEWFILTERSTRING_TITLE, RESID_PP_FILE_HIDDEN_ROOT, RESID_PP_FILE_MODIFIED_ROOT, RESID_PP_FILE_NAME_ROOT, RESID_PP_FILE_PATH_ROOT, RESID_PP_FILE_READABLE_ROOT, RESID_PP_FILE_READONLY_ROOT, RESID_PP_FILE_ROOT, RESID_PP_FILE_SIZE_ROOT, RESID_PP_FILE_SIZE_VALUE, RESID_PP_FILE_TITLE, RESID_PP_FILE_TYPE_FILE_VALUE, RESID_PP_FILE_TYPE_FOLDER_VALUE, RESID_PP_FILE_TYPE_ROOT, RESID_PP_FILE_TYPE_ROOT_VALUE, RESID_PP_FILE_WRITABLE_ROOT, RESID_PREFIX, RESID_PROPERTY_FILE_FILTER_VALUE, RESID_SELECTDIRECTORY_SELECT, RESID_SELECTDIRECTORY_TITLE, RESID_SELECTDIRECTORY_VERBAGE, RESID_SELECTFILE_SELECT, RESID_SELECTFILE_TITLE, RESID_SELECTFILE_VERBAGE, WIDGET_BROWSE_ROOT, WIDGET_FOLDER_ROOT, WIDGET_ID
 
Fields inherited from interface com.ibm.etools.systems.core.ui.widgets.ISystemCombo
Copyright
 
Constructor Summary
SystemRemoteFolderCombo(Composite parent, int style, String historyKey, boolean readOnly)
          Constructor for SystemFileFolderCombo.
 
Method Summary
 void addBrowseActionCompleteListener(ISystemRemoteFolderBrowseCompleteListener listener)
          Adds a listener which will be notified each time after the browse action is run.
 void addBrowseButtonSelectionListener(SelectionListener listener)
          Register a listener interested in when the browse button is selected
 void addModifyListener(ModifyListener listener)
          Register a listener interested in entry field modify events
protected  void addOurButtonSelectionListener()
           
 void addSelectionListener(SelectionListener listener)
          Register a listener interested in an item is selected in the combo box
 void clearSelection()
          Clear the selection of the text in the entry field part of the combo
 void clearTextSelection()
          Clear the entered/selected contents of the combo box.
protected static Button createPushButton(Composite group, ResourceBundle bundle, String key)
           
static Button createPushButton(Composite group, String label)
           
protected  SystemSelectRemoteFolderAction getBrowseAction(Shell shell)
          Returns action to be called when Browse... pressed.
 Button getBrowseButton()
          Return the browse button widget
 Combo getCombo()
          Return the embedded combo box widget Same as getFolderCombo()
 Combo getFolderCombo()
          Return the combo box widget as a System Same as getCombo()
 Label getFolderLabel()
          Get folder label.
static String[] getHistory()
          Return the current history for the folder combo box
 SystemHistoryCombo getHistoryCombo()
          Return the combo box historical widget Same as getCombo() but returns the combo reference as a SystemHistoryCombo reference
 String[] getItems()
          Get the items in the combo field
 int getSelectionIndex()
          Get the index number of the currently selected item.
 SystemConnection getSystemConnection()
          Get the system connection as specified in setSystemConnection.
 String getText()
          Query the folder combo field's current contents
protected  void notifyBrowseActionCompleteListeners(IRemoteFile remoteFile)
          Notifies all registered listeners.
protected  Composite prepareComposite(int numColumns)
          Prepares this composite control and sets the default layout data.
 void removeBrowseActionCompleteListener(ISystemRemoteFolderBrowseCompleteListener listener)
          Removes the given listener.
 void removeBrowseButtonSelectionListener(SelectionListener listener)
          Remove a previously set browse button selection listener.
 void removeModifyListener(ModifyListener listener)
          Remove a previously set entry field listener.
 void removeSelectionListener(SelectionListener listener)
          Remove a previously set combo box selection listener.
 void select(int selIdx)
          Select the combo dropdown list entry at the given index
 void setAutoUpperCase(boolean enable)
          Set auto-uppercase.
 void setBrowseButtonFocus()
          Set the focus to the browse button
 void setBrowseButtonToolTipText(String tip)
          Set the tooltip text for the browse button
 void setButtonToolTipText(String tip)
          Set the tooltip text for the browse button.
 void setEnabled(boolean enabled)
          Disable/Enable all the child controls.
 boolean setFocus()
          Set the focus to the folder combo field
 void setItems(String[] items)
          Set the items in the combo field
 void setSelectionIndex(int selIdx)
          Same as select(int)
 void setShowNewConnectionPrompt(boolean show)
          Set whether to allow users to create new connections when Browse is pressed
 void setSubSystem(RemoteFileSubSystem subsystem)
          Set the input remote file subsystem.
 void setSystemConnection(SystemConnection connection)
          Set the input system connection to restrict the browse button to this connection only.
 void setSystemType(String systemType)
          Convenience method to restrict to a single system type.
 void setSystemTypes(String[] systemTypes)
          Set the system types to restrict what connections the user sees, and what types of connections they can create.
 void setText(String text)
          Set the folder combo field's current contents
 void setTextLimit(int limit)
          Set the folder combo field's text limit
 void setToolTipText(String tip)
          Set the tooltip text for the folder combo field
 void setWidthHint(int widthHint)
          Set the width hint for this whole composite Default is computed from children.
 void updateHistory()
          Update the history with current entry field setting.
 void updateHistory(boolean refresh)
          Update the history with current entry field setting, and optionally refresh the list from the new history.
 
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

SystemRemoteFolderCombo

public SystemRemoteFolderCombo(Composite parent,
                               int style,
                               String historyKey,
                               boolean readOnly)
Constructor for SystemFileFolderCombo. Requires a history key used to store/restore the dropdown history for this. Pass null to use the overall default (ISystemPreferencesConstants.HISTORY_FOLDER)

Parameters:
parent - Parent composite
style - SWT style flags for overall composite widget
historyKey - A string identifying the key into the user preferences where this combo's history will be stored.
readOnly - True if the combo box is not to allow user editing.
See Also:
setSystemConnection(SystemConnection)
Method Detail

setAutoUpperCase

public void setAutoUpperCase(boolean enable)
Set auto-uppercase. When enabled, all non-quoted values are uppercases when appropriate. This has no effect in readonly mode!

Specified by:
setAutoUpperCase in interface ISystemCombo

setSystemTypes

public void setSystemTypes(String[] systemTypes)
Set the system types to restrict what connections the user sees, and what types of connections they can create.

Parameters:
systemTypes - An array of system type names
See Also:
ISystemTypes

setSystemType

public void setSystemType(String systemType)
Convenience method to restrict to a single system type. Same as setSystemTypes(new String[] {systemType})

Parameters:
systemType - The name of the system type to restrict to
See Also:
ISystemTypes

setSystemConnection

public void setSystemConnection(SystemConnection connection)
Set the input system connection to restrict the browse button to this connection only. Either call this or setSubSystemFactoryId.


getSystemConnection

public SystemConnection getSystemConnection()
Get the system connection as specified in setSystemConnection.


setSubSystem

public void setSubSystem(RemoteFileSubSystem subsystem)
Set the input remote file subsystem. If set, this will allow the browse button to better pre-fill the selection dialog when browse is pressed.


setShowNewConnectionPrompt

public void setShowNewConnectionPrompt(boolean show)
Set whether to allow users to create new connections when Browse is pressed


getFolderCombo

public Combo getFolderCombo()
Return the combo box widget as a System Same as getCombo()


getFolderLabel

public Label getFolderLabel()
Get folder label.

Returns:
the folder label.

getHistoryCombo

public SystemHistoryCombo getHistoryCombo()
Return the combo box historical widget Same as getCombo() but returns the combo reference as a SystemHistoryCombo reference


getCombo

public Combo getCombo()
Return the embedded combo box widget Same as getFolderCombo()

Specified by:
getCombo in interface ISystemCombo

setWidthHint

public void setWidthHint(int widthHint)
Set the width hint for this whole composite Default is computed from children.

Specified by:
setWidthHint in interface ISystemCombo

getBrowseButton

public Button getBrowseButton()
Return the browse button widget


setItems

public void setItems(String[] items)
Set the items in the combo field


getItems

public String[] getItems()
Get the items in the combo field


setText

public void setText(String text)
Set the folder combo field's current contents


getText

public String getText()
Query the folder combo field's current contents

Specified by:
getText in interface ISystemCombo

setEnabled

public void setEnabled(boolean enabled)
Disable/Enable all the child controls.

Specified by:
setEnabled in interface ISystemCombo

setToolTipText

public void setToolTipText(String tip)
Set the tooltip text for the folder combo field

Specified by:
setToolTipText in interface ISystemCombo

setBrowseButtonToolTipText

public void setBrowseButtonToolTipText(String tip)
Set the tooltip text for the browse button


setButtonToolTipText

public void setButtonToolTipText(String tip)
Set the tooltip text for the browse button. Same as setBrowseButtonToolTipText(String)

Specified by:
setButtonToolTipText in interface ISystemCombo

setTextLimit

public void setTextLimit(int limit)
Set the folder combo field's text limit


setFocus

public boolean setFocus()
Set the focus to the folder combo field

Specified by:
setFocus in interface ISystemCombo

setBrowseButtonFocus

public void setBrowseButtonFocus()
Set the focus to the browse button


select

public void select(int selIdx)
Select the combo dropdown list entry at the given index

Specified by:
select in interface ISystemCombo

setSelectionIndex

public void setSelectionIndex(int selIdx)
Same as select(int)

Specified by:
setSelectionIndex in interface ISystemCombo

getSelectionIndex

public int getSelectionIndex()
Get the index number of the currently selected item.

Specified by:
getSelectionIndex in interface ISystemCombo

clearSelection

public void clearSelection()
Clear the selection of the text in the entry field part of the combo

Specified by:
clearSelection in interface ISystemCombo

clearTextSelection

public void clearTextSelection()
Clear the entered/selected contents of the combo box. Clears only the text selection, not the list selection

Specified by:
clearTextSelection in interface ISystemCombo

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Register a listener interested in an item is selected in the combo box

Specified by:
addSelectionListener in interface ISystemCombo
See Also:
removeSelectionListener(SelectionListener)

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Remove a previously set combo box selection listener.

Specified by:
removeSelectionListener in interface ISystemCombo
See Also:
addSelectionListener(SelectionListener)

addBrowseButtonSelectionListener

public void addBrowseButtonSelectionListener(SelectionListener listener)
Register a listener interested in when the browse button is selected

See Also:
removeBrowseButtonSelectionListener(SelectionListener)

removeBrowseButtonSelectionListener

public void removeBrowseButtonSelectionListener(SelectionListener listener)
Remove a previously set browse button selection listener.

See Also:
addBrowseButtonSelectionListener(SelectionListener)

addModifyListener

public void addModifyListener(ModifyListener listener)
Register a listener interested in entry field modify events

See Also:
removeModifyListener(ModifyListener)

removeModifyListener

public void removeModifyListener(ModifyListener listener)
Remove a previously set entry field listener.

See Also:
addModifyListener(ModifyListener)

addBrowseActionCompleteListener

public void addBrowseActionCompleteListener(ISystemRemoteFolderBrowseCompleteListener listener)
Adds a listener which will be notified each time after the browse action is run.

Parameters:
listener - the listener to be notified.

removeBrowseActionCompleteListener

public void removeBrowseActionCompleteListener(ISystemRemoteFolderBrowseCompleteListener listener)
Removes the given listener. Has no effect if the listener was not added before.

Parameters:
listener - the listener to be removed.

notifyBrowseActionCompleteListeners

protected void notifyBrowseActionCompleteListeners(IRemoteFile remoteFile)
Notifies all registered listeners.

Parameters:
remoteFile - the remote file to use for the notification.

getHistory

public static String[] getHistory()
Return the current history for the folder combo box


updateHistory

public void updateHistory()
Update the history with current entry field setting.

This is called automatically for you when setText is called. However, for non-readonly versions, you should still call this yourself when OK is successfully pressed on the dialog box.


updateHistory

public void updateHistory(boolean refresh)
Update the history with current entry field setting, and optionally refresh the list from the new history.


prepareComposite

protected Composite prepareComposite(int numColumns)
Prepares this composite control and sets the default layout data.


addOurButtonSelectionListener

protected void addOurButtonSelectionListener()

getBrowseAction

protected SystemSelectRemoteFolderAction getBrowseAction(Shell shell)
Returns action to be called when Browse... pressed. Either connection or subsystemFactoryId better be set!


createPushButton

public static Button createPushButton(Composite group,
                                      String label)

createPushButton

protected static Button createPushButton(Composite group,
                                         ResourceBundle bundle,
                                         String key)

Remote Systems
v6.4.1

Copyright © 2005 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.