|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.SystemQualifiedRemoteFolderCombo
public class SystemQualifiedRemoteFolderCombo
This re-usable widget is for selecting a new or previously specified folder path within a given connection.
The dropdown is historical and contains a folder path qualified by a connection name. It is readonly ... the user must use the browse button.
The composite is layed as follows:
Folder: conn\dir1_____v Browse...
The browse button lists only connections that are of the specified subsystem factory. It also by default has a New Connection... prompting object for creating new connections, but this can be turned off.
To get the current folder object selected, use getFolder().
To listen for changes, use addSelectionListener().
Field Summary | |
---|---|
static char |
CONNECTION_DELIMITER
|
Fields inherited from class org.eclipse.swt.widgets.Composite |
---|
embeddedHandle |
Fields inherited from class org.eclipse.swt.widgets.Widget |
---|
handle |
Constructor Summary | |
---|---|
SystemQualifiedRemoteFolderCombo(Composite parent,
int style,
String historyKey)
Constructor. |
Method Summary | |
---|---|
void |
addBrowseButtonSelectionListener(SelectionListener listener)
Register a listener interested in when the browse button is selected |
int |
addFolder(IRemoteFile folder)
Append a folder to the list. |
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, and the list selection |
void |
clearTextSelection()
Clear the selection of the text in the entry field part of the combo |
IRemoteFile |
convertToRemoteFile(String qualifiedFolder)
Given a qualified folder name, return an IRemoteFile object representing it. |
protected static Button |
createPushButton(Composite group,
ResourceBundle bundle,
String key)
|
static Button |
createPushButton(Composite group,
String label)
|
static String |
extractConnectionName(String qualifiedConnectionName)
Get the connection name part of a profile.connection string. |
static String |
extractFolder(String qualifiedFolder)
Get the folder name part of a qualified folder string. |
static String |
extractProfileName(String qualifiedConnectionName)
Get the profile name part of a profile.connection string |
static String |
extractQualifiedConnectionName(String qualifiedFolder)
Get the profile.connection name part of a qualified folder string. |
protected SystemSelectRemoteFolderAction |
getBrowseAction(Shell shell,
IHost defaultConnection)
Returns action to be called when Browse... pressed. |
Button |
getBrowseButton()
Return the browse button widget |
Combo |
getCombo()
Return the raw combo box widget |
IRemoteFile |
getFolder()
Query the folder combo field's current contents as an IRemoteFile object. |
SystemHistoryCombo |
getFolderCombo()
Return the combo box history widget |
int |
getFolderIndex(IRemoteFile folder)
Get the index of a given folder in the current list for this combo. |
static String[] |
getHistory()
Return the current history for the folder combo box |
SystemHistoryCombo |
getHistoryCombo()
Return the combo box widget |
String[] |
getItems()
Get the items in the combo field as an array of strings. |
int |
getSelectionIndex()
Get the index number of the currently selected item. |
IHost |
getSystemConnection()
Query the folder combo field's current contents and return the connection part of it as a SystemConnection object. |
String |
getText()
Query the folder combo field's current contents |
protected Composite |
prepareComposite(int numColumns)
Prepares this composite control and sets the default layout data. |
void |
removeBrowseButtonSelectionListener(SelectionListener listener)
Remove a previously set browse button selection listener. |
void |
removeFolder(IRemoteFile folder)
Remove a folder from the list. |
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 Same as setSelectionIndex(int) |
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)
Same as setBrowseButtonToolTipText(String) |
void |
setEnabled(boolean enabled)
Disable/Enable all the child controls. |
boolean |
setFocus()
Set the focus to the folder combo field |
void |
setFolder(IRemoteFile folder)
Set the folder combo field's current contents given an IRemoteFile object. |
void |
setFolders(IRemoteFile[] folders)
Set the folders in the combo field. |
void |
setSelectionIndex(int selIdx)
Set the value by selecting the item in the list at the given position. |
void |
setShowNewConnectionPrompt(boolean show)
Specify if the "New Connection..." object for creating connections should be shown when the user selects the Browse... button to select a remote folder. |
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 |
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 the child widgets |
void |
updateHistory()
Update the history with current entry field setting. |
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.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, 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 |
Field Detail |
---|
public static final char CONNECTION_DELIMITER
Constructor Detail |
---|
public SystemQualifiedRemoteFolderCombo(Composite parent, int style, String historyKey)
parent
- Parent compositestyle
- SWT style flags for overall composite widgethistoryKey
- A string identifying the key into the user preferences where this combo's history will be stored.setSystemType(IRSESystemType)
Method Detail |
---|
public void setAutoUpperCase(boolean enable)
setAutoUpperCase
in interface ISystemCombo
public void setSystemTypes(IRSESystemType[] systemTypes)
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.public void setSystemType(IRSESystemType systemType)
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.public void setShowNewConnectionPrompt(boolean show)
public SystemHistoryCombo getFolderCombo()
public SystemHistoryCombo getHistoryCombo()
public Combo getCombo()
getCombo
in interface ISystemCombo
public void setWidthHint(int widthHint)
setWidthHint
in interface ISystemCombo
public Button getBrowseButton()
public void setFolders(IRemoteFile[] folders)
folders
- Array of IRemoteFile objects ... each is a remote folderpublic int addFolder(IRemoteFile folder)
setFolder(IRemoteFile)
or setSelectionIndex(int)
to select it if desired.
History is updated.
folder
- The folder to add. Caller's responsibility to precheck for existence
by calling getFolderIndex(IRemoteFile)
.
public void removeFolder(IRemoteFile folder)
folder
- The folder to remove.public String[] getItems()
public int getFolderIndex(IRemoteFile folder)
public void setFolder(IRemoteFile folder)
public void setSelectionIndex(int selIdx)
select(int)
setSelectionIndex
in interface ISystemCombo
public void select(int selIdx)
setSelectionIndex(int)
select
in interface ISystemCombo
public void clearSelection()
clearSelection
in interface ISystemCombo
public void clearTextSelection()
clearTextSelection
in interface ISystemCombo
public int getSelectionIndex()
getSelectionIndex
in interface ISystemCombo
public String getText()
getText
in interface ISystemCombo
public IRemoteFile getFolder() throws Exception
Since it is possible the selected item is no longer valid, this will throw an exception if the profile or connection does not exist or the user cancels the connecting action. The message in the exception is translated and displayable.
Exception
public IHost getSystemConnection()
Will return null if either there is no contents currently or there is no such system!
public void setEnabled(boolean enabled)
setEnabled
in interface ISystemCombo
setEnabled
in class Control
public void setToolTipText(String tip)
setToolTipText
in interface ISystemCombo
setToolTipText
in class Control
public void setBrowseButtonToolTipText(String tip)
public void setButtonToolTipText(String tip)
setBrowseButtonToolTipText(String)
setButtonToolTipText
in interface ISystemCombo
public void setTextLimit(int limit)
public boolean setFocus()
setFocus
in interface ISystemCombo
setFocus
in class Composite
public void setBrowseButtonFocus()
public void addSelectionListener(SelectionListener listener)
addSelectionListener
in interface ISystemCombo
removeSelectionListener(SelectionListener)
public void removeSelectionListener(SelectionListener listener)
removeSelectionListener
in interface ISystemCombo
addSelectionListener(SelectionListener)
public void addBrowseButtonSelectionListener(SelectionListener listener)
removeBrowseButtonSelectionListener(SelectionListener)
public void removeBrowseButtonSelectionListener(SelectionListener listener)
addBrowseButtonSelectionListener(SelectionListener)
public void addModifyListener(ModifyListener listener)
removeModifyListener(ModifyListener)
public void removeModifyListener(ModifyListener listener)
addModifyListener(ModifyListener)
public static String[] getHistory()
public void updateHistory()
This is called automatically for you whenever this list is changed.
public IRemoteFile convertToRemoteFile(String qualifiedFolder) throws Exception
Note that if the connection contains multiple subsystems that implement RemoteFileSubSystem, or that come from a subsystem factory of the given subsystem factory ID, the first such subsystem is chosen.
Exception
public static String extractQualifiedConnectionName(String qualifiedFolder)
public static String extractProfileName(String qualifiedConnectionName)
public static String extractConnectionName(String qualifiedConnectionName)
public static String extractFolder(String qualifiedFolder)
protected Composite prepareComposite(int numColumns)
numColumns
- Number of columns the new group will contain.protected void addOurButtonSelectionListener()
protected SystemSelectRemoteFolderAction getBrowseAction(Shell shell, IHost defaultConnection)
public static Button createPushButton(Composite group, String label)
protected static Button createPushButton(Composite group, ResourceBundle bundle, String key)
|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |