|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Interface for address selector. An address selector provides an widget
(via the makeControl(Composite) and getControl() methods)
which allows the user to select resources from a data source. Each data
source driver provides its own implementation of
IAddressSelector.
The various methods of this interface, other than
makeControl(Composite), may be called at any time, either before
or after makeControl is called, though some may return
null as specified by the method documentation. Those methods
that change the selector's behaviour are effective both before and after
the control has been created.
| Field Summary | |
static int |
CREATE
Mode for selecting only non-existing files. |
static int |
OPEN
Mode for selecting only existing files. |
static int |
SAVE
Mode for selecting either existing or non-existing files. |
| Method Summary | |
void |
addAddressListener(IAddressListener listener)
Add an address listener to this selector. |
String |
getAddress()
Get the address for this selector. |
org.eclipse.swt.widgets.Control |
getControl()
Get the already-created GUI control. |
int |
getExistenceMode()
Get the existence mode for this selector. |
String |
getRoot()
Get the relative-mode root for this selector. |
boolean |
hasAddress()
Determine whether the user has selected a valid address. |
boolean |
isDirectories()
Determine whether this selector is configured to select files or directories. |
boolean |
isRelative()
Determine whether this selector is in relative mode. |
org.eclipse.swt.widgets.Control |
makeControl(org.eclipse.swt.widgets.Composite parent)
Create a GUI control for this selector. |
void |
removeAddressListener(IAddressListener listener)
Remove the specified address listener to this selector. |
void |
setAbsolute()
Set this address selector to absolute mode. |
void |
setDirectories(boolean dir)
Configure this selector to allow selection of files or directories. |
void |
setExistenceMode(int mode)
Set the existence mode for this selector. |
void |
setRelative(String root)
Set this address selector to relative mode with the specified root. |
| Field Detail |
public static final int OPEN
setExistenceMode(int),
Constant Field Valuespublic static final int CREATE
setExistenceMode(int),
Constant Field Valuespublic static final int SAVE
setExistenceMode(int),
Constant Field Values| Method Detail |
public void addAddressListener(IAddressListener listener)
IAddressListener.addressChanged(IAddressSelector) method is
called.
listener - the listener to add to this selector.public void removeAddressListener(IAddressListener listener)
listener - the listener to remove from this selector.
public void setRelative(String root)
throws MalformedAddressException
getAddress() returns relative paths. Changing
between relative and absolute modes clears any address the user had
previously selected.
root - the data layer address relative to which the user selects
addresses. If it does not end in IDataConstants.SEP_MAJOR,
that string is appended.
MalformedAddressException - if root is not an
absolute data layer address with the correct protocol identifier.public void setAbsolute()
getAddress() returns
absolute data layer addresses. Changing between relative and absolute
modes clears any address the user had previously selected.
public boolean isRelative()
public String getRoot()
null.public void setDirectories(boolean dir)
dir - if true, configure this selector to allow the selection of
directories only. If false, allow the selection of non-directories
only.public boolean isDirectories()
setDirectories(boolean)public org.eclipse.swt.widgets.Control makeControl(org.eclipse.swt.widgets.Composite parent)
parent - the parent for the control.
IllegalStateException - if makeControl has already
been called.public org.eclipse.swt.widgets.Control getControl()
makeControl(Composite),
or null if makeControl has not yet been called.public boolean hasAddress()
public String getAddress()
null if no
valid address is selected (i.e., if hasAddress() would return
false. If the selector is in relative mode, returns a relative address
that may be appended to the result of getRoot() to obtain an
absolute data layer address. If the selector is in absolute mode,
returns an absolute data layer address.
null if none
is selected.public void setExistenceMode(int mode)
mode - one of the constants OPEN, SAVE, or
CREATE.
IllegalArgumentException - if the mode is not one of these
constants.public int getExistenceMode()
OPEN, SAVE, or CREATE.setExistenceMode(int)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||