|
||||||||||
| 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.topbraidcomposer.ui.util.WSFileDialog
public class WSFileDialog
FileDialog that is workspace relative and can start at a given root element Basically embeds the relevant parts of the resource navigator in a dialog. The workhorse here is the WorkbenchContentProvider I'm sure...
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.jface.window.Window |
|---|
org.eclipse.jface.window.Window.IExceptionHandler |
| Field Summary |
|---|
| 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 | |
|---|---|
WSFileDialog(org.eclipse.swt.widgets.Shell parentShell,
int selectionStyle,
java.lang.String title)
Open on the workspace root without filters or workingset |
|
WSFileDialog(org.eclipse.swt.widgets.Shell parentShell,
int selectionStyle,
java.lang.String title,
org.eclipse.core.resources.IResource rootElement,
boolean expand,
java.lang.String[] extensions,
org.eclipse.ui.IWorkingSet workingSet)
|
|
| Method Summary | |
|---|---|
protected org.eclipse.swt.widgets.Control |
createDialogArea(org.eclipse.swt.widgets.Composite parent)
|
protected org.eclipse.jface.viewers.TreeViewer |
createViewer(org.eclipse.swt.widgets.Composite parent)
|
java.lang.String |
getFileName()
|
org.eclipse.core.resources.IResource[] |
getMultiResult()
Get an array of selected resources or null if canceled |
org.eclipse.core.resources.IResource |
getSingleResult()
Get the single selection result if any or the first selected element if SWT.MULTI was used as the selectionType |
protected void |
initContentProvider(org.eclipse.jface.viewers.TreeViewer viewer)
This is the key, the WorkBenchContentProvider provides us with all the resource information |
protected void |
initFilters(org.eclipse.jface.viewers.TreeViewer viewer)
Attach the filters to the tree viewer |
protected void |
initLabelProvider(org.eclipse.jface.viewers.TreeViewer viewer)
|
protected void |
okPressed()
process the tree selection and keep as the resultIResource[] until needed by our client |
void |
setExtensions(java.lang.String[] extensions)
Only files with the given file extensions will be shown |
void |
setNewFileName(java.lang.String fileName)
|
void |
setSelectedContainer(org.eclipse.core.resources.IContainer container)
|
| Methods inherited from class org.eclipse.jface.dialogs.Dialog |
|---|
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText |
| Methods inherited from class org.eclipse.jface.window.Window |
|---|
canHandleShellCloseEvent, configureShell, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WSFileDialog(org.eclipse.swt.widgets.Shell parentShell,
int selectionStyle,
java.lang.String title,
org.eclipse.core.resources.IResource rootElement,
boolean expand,
java.lang.String[] extensions,
org.eclipse.ui.IWorkingSet workingSet)
parentShell - this shell will be blocked by the modal WSFileDialogselectionStyle - must be SWT.SINGLE or SWT.MULTI or SWT.SAVEtitle - the dialog's titlerootElement - resource to be the rootElement for the treeexpand - if true, the root element will be expandedextensions - if specified only files with these extensions are shownworkingSet - if specified only files in this workingSet are shown
public WSFileDialog(org.eclipse.swt.widgets.Shell parentShell,
int selectionStyle,
java.lang.String title)
parentShell - this shell will be blocked by the modal WSFileDialogselectionStyle - must be SWT.SINGLE or SWT.MULTI or SWT.SAVEtitle - the dialog title| Method Detail |
|---|
public void setExtensions(java.lang.String[] extensions)
extensions - protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
createDialogArea in class org.eclipse.jface.dialogs.Dialogprotected org.eclipse.jface.viewers.TreeViewer createViewer(org.eclipse.swt.widgets.Composite parent)
public java.lang.String getFileName()
protected void initFilters(org.eclipse.jface.viewers.TreeViewer viewer)
viewer - protected void initContentProvider(org.eclipse.jface.viewers.TreeViewer viewer)
viewer - protected void initLabelProvider(org.eclipse.jface.viewers.TreeViewer viewer)
protected void okPressed()
okPressed in class org.eclipse.jface.dialogs.DialogDialog.okPressed()public org.eclipse.core.resources.IResource getSingleResult()
public org.eclipse.core.resources.IResource[] getMultiResult()
public void setNewFileName(java.lang.String fileName)
public void setSelectedContainer(org.eclipse.core.resources.IContainer container)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||