Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.files.ui.widgets
Class SystemRemoteFolderCombo


java.lang.Object
  extended by 

org.eclipse.swt.widgets.Widget
      extended by 

org.eclipse.swt.widgets.Control
          extended by 

org.eclipse.swt.widgets.Scrollable
              extended by 

org.eclipse.swt.widgets.Composite
                  extended by 
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...
 


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets. Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets. Widget
handle
 
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.
  IHost 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 ( IRemoteFileSubSystem subsystem)
          Set the input remote file subsystem.
 void setSystemConnection ( IHost connection)
          Set the input system connection to restrict the browse button to this connection only.
 void setSystemType ( IRSESystemType systemType)
          Convenience method to restrict to a single system type.
 void setSystemTypes ( IRSESystemType[] 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 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. Scrollable
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar
 
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
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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(IHost)
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(
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)

RSE
Release 3.0

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

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire