|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.emf.common.ui.dialogs.ResourceDialog
Instances of this class allow a user to specify one or more URIs identifying resources. The dialog includes buttons that allow the file system or workspace to be browsed, so that the URI can be automatically filled based on the selected file.
Subclasses are encouraged to override processResources()
, where they can process
the specified URIs.
Nested Class Summary |
Nested classes inherited from class org.eclipse.jface.window.Window |
Window.IExceptionHandler |
Field Summary | |
protected static int |
CONTROL_OFFSET
|
protected int |
style
|
protected String |
title
|
protected Text |
uriField
|
protected String |
uriText
|
Fields inherited from class org.eclipse.jface.dialogs.Dialog |
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS |
Fields inherited from class org.eclipse.jface.window.Window |
CANCEL, OK |
Constructor Summary | |
ResourceDialog(Shell parent,
String title,
int style)
Creates a new instance of this class, given a parent shell, an optional title, and a style value describing its behaviour. |
Method Summary | |
protected void |
configureShell(Shell shell)
|
protected Control |
createDialogArea(Composite parent)
Creates and returns the contents of the upper part of this dialog. |
List |
getURIs()
Returns the list of space-separated URIs from the URI text field. |
String |
getURIText()
Returns the value of the URI text field. |
protected boolean |
isMulti()
|
protected boolean |
isSave()
|
protected void |
normalizeStyle()
|
protected void |
okPressed()
Called when the OK button has been pressed, this method calls getURIText() to cache and return
the URI text field's value (so that it may be retrieved even after the field has been disposed).
|
protected void |
prepareBrowseFileSystemButton(Button browseFileSystemButton)
Called to prepare the Browse File System button, this implementation adds a selection listener that creates an appropriate FileDialog . |
protected void |
prepareBrowseWorkspaceButton(Button browseWorkspaceButton)
Called to prepare the Browse Workspace button, this implementation adds a selection listener that creates an appropriate WorkspaceResourceDialog . |
protected boolean |
processResources()
Called by okPressed() to handle the specified URIs, this implementation simply returns true, allowing
the dialog to close. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int CONTROL_OFFSET
protected String title
protected int style
protected Text uriField
protected String uriText
Constructor Detail |
public ResourceDialog(Shell parent, String title, int style)
parent
- a shell which will be the parent of the new instancetitle
- an optional title for the dialog, to be used in place of the defaultstyle
- SWT style bits
, indicating whether existing (SWT.OPEN
)
or new (SWT.SAVE)
resources are to be specified and, in the former case, whether
single (SWT.SINGLE
)
or multiple (SWT.MULTI
)
.
Open existing and single resource are the defaults.Method Detail |
protected void normalizeStyle()
protected boolean isSave()
protected boolean isMulti()
protected void configureShell(Shell shell)
protected Control createDialogArea(Composite parent)
prepareBrowseFileSystemButton(org.eclipse.swt.widgets.Button)
and prepareBrowseWorkspaceButton(org.eclipse.swt.widgets.Button)
, respectively.
protected void prepareBrowseFileSystemButton(Button browseFileSystemButton)
FileDialog
.
protected void prepareBrowseWorkspaceButton(Button browseWorkspaceButton)
WorkspaceResourceDialog
.
protected void okPressed()
getURIText()
to cache and return
the URI text field's value (so that it may be retrieved even after the field has been disposed).
It then calls processResources()
to handle the specified URIs and optionally closes the dialog,
based on its return value.
public String getURIText()
public List getURIs()
protected boolean processResources()
okPressed()
to handle the specified URIs, this implementation simply returns true, allowing
the dialog to close. Subclasses can override this method to load, save, or otherwise process resources, and
based on this processing, to optionally prevent the dialog from being closed if the URIs are invalid.
true
if the dialog can be closed, false
if URI(s) must be re-entered
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |