|
|
|
|
org.eclipse.rse.files.ui.widgets
Class SystemRemoteFolderCombo
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.rse.files.ui.widgets.SystemRemoteFolderCombo
-
All Implemented Interfaces:
-
ISystemCombo,
Drawable
-
public class SystemRemoteFolderCombo
- extends
Composite
- implements
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...
Fields inherited from class org.eclipse.swt.widgets.
Widget
|
handle
|
Methods inherited from class org.eclipse.swt.widgets.
Composite
|
changed,
checkSubclass,
computeSize,
getBackgroundMode,
getChildren,
getClientArea,
getLayout,
getLayoutDeferred,
getTabList,
isLayoutDeferred,
layout,
layout,
layout,
layout,
setBackgroundMode,
setLayout,
setLayoutDeferred,
setTabList
|
Methods inherited from class org.eclipse.swt.widgets.
Control
|
addControlListener,
addDragDetectListener,
addFocusListener,
addHelpListener,
addKeyListener,
addMenuDetectListener,
addMouseListener,
addMouseMoveListener,
addMouseTrackListener,
addMouseWheelListener,
addPaintListener,
addTraverseListener,
computeSize,
dragDetect,
dragDetect,
forceFocus,
getAccessible,
getBackground,
getBackgroundImage,
getBounds,
getCursor,
getData,
getDragDetect,
getEnabled,
getFont,
getForeground,
getLayoutData,
getLocation,
getMenu,
getMonitor,
getParent,
getRegion,
getShell,
getSize,
getToolTipText,
getVisible,
internal_dispose_GC,
internal_new_GC,
isEnabled,
isFocusControl,
isReparentable,
isVisible,
moveAbove,
moveBelow,
pack,
pack,
print,
redraw,
redraw,
removeControlListener,
removeDragDetectListener,
removeFocusListener,
removeHelpListener,
removeKeyListener,
removeMenuDetectListener,
removeMouseListener,
removeMouseMoveListener,
removeMouseTrackListener,
removeMouseWheelListener,
removePaintListener,
removeTraverseListener,
setBackground,
setBackgroundImage,
setBounds,
setBounds,
setCapture,
setCursor,
setDragDetect,
setFont,
setForeground,
setLayoutData,
setLocation,
setLocation,
setMenu,
setParent,
setRedraw,
setRegion,
setSize,
setSize,
setVisible,
toControl,
toControl,
toDisplay,
toDisplay,
traverse,
update
|
Methods inherited from class org.eclipse.swt.widgets.
Widget
|
addDisposeListener,
addListener,
checkWidget,
dispose,
getData,
getDisplay,
getListeners,
getStyle,
isDisposed,
isListening,
notifyListeners,
removeDisposeListener,
removeListener,
removeListener,
setData,
setData,
toString
|
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(IHost)
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(
IRSESystemType[] 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 types, or
null to allow all registered valid system types.
A system type is valid if at least one subsystem configuration
is registered against it.
setSystemType
public void setSystemType(
IRSESystemType systemType)
- Convenience method to restrict to a single system type.
Same as setSystemTypes(new IRSESystemType[] {systemType})
-
-
-
Parameters:
-
systemType - The system type to restrict to, or
null to allow all registered valid system types.
A system type is valid if at least one subsystem configuration
is registered against it.
setSystemConnection
public void setSystemConnection(
IHost connection)
- Set the input system connection to restrict the browse button to this connection only.
Either call this or setSubSystemConfigurationId.
-
-
getSystemConnection
public
IHost getSystemConnection()
- Get the system connection as specified in setSystemConnection.
-
-
setSubSystem
public void setSubSystem(
IRemoteFileSubSystem 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
-
Overrides:
-
setEnabled
in class
Control
-
setToolTipText
public void setToolTipText(
String tip)
- Set the tooltip text for the folder combo field
-
-
Specified by:
-
setToolTipText
in interface
ISystemCombo
-
Overrides:
-
setToolTipText
in class
Control
-
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
-
Overrides:
-
setFocus
in class
Composite
-
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.
-
-
-
Parameters:
-
numColumns - Number of columns the new group will contain.
addOurButtonSelectionListener
protected void addOurButtonSelectionListener()
-
-
getBrowseAction
protected
SystemSelectRemoteFolderAction getBrowseAction(
Shell shell)
- Returns action to be called when Browse... pressed.
Either connection or subsystemConfigurationId better be set!
-
-
createPushButton
public static
Button createPushButton(
Composite group,
String label)
-
-
createPushButton
protected static
Button createPushButton(
Composite group,
ResourceBundle bundle,
String key)
-
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|
|