diff options
author | Oleg Krasilnikov | 2007-02-26 14:34:23 +0000 |
---|---|---|
committer | Oleg Krasilnikov | 2007-02-26 14:34:23 +0000 |
commit | ac5293488b95db86544c144cb7025c288f7eca3c (patch) | |
tree | 3bdce73640126dc6e564a12da1e9082e890d6e4f | |
parent | a2982222d3552f5e3379b5c2e576aa829517ad60 (diff) | |
download | org.eclipse.cdt-ac5293488b95db86544c144cb7025c288f7eca3c.tar.gz org.eclipse.cdt-ac5293488b95db86544c144cb7025c288f7eca3c.tar.xz org.eclipse.cdt-ac5293488b95db86544c144cb7025c288f7eca3c.zip |
Select only directories inside of workspace, when it's required.
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractCPropertyTab.java | 10 | ||||
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractCPropertyTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractCPropertyTab.java index 5b6aa42fb2e..657af281ad4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractCPropertyTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractCPropertyTab.java @@ -94,6 +94,7 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab { public static final String WORKSPACE_DIR_DIALOG_MSG = NewUIMessages.getResourceString("BrowseEntryDialog.wsp.dir.dlg.msg"); //$NON-NLS-1$ public static final String WORKSPACE_FILE_DIALOG_MSG = NewUIMessages.getResourceString("BrowseEntryDialog.wsp.file.dlg.msg"); //$NON-NLS-1$ public static final String WORKSPACE_FILE_DIALOG_ERR = NewUIMessages.getResourceString("BrowseEntryDialog.wsp.file.dlg.err"); //$NON-NLS-1$ + public static final String WORKSPACE_DIR_DIALOG_ERR = NewUIMessages.getResourceString("BrowseEntryDialog.wsp.dir.dlg.err"); //$NON-NLS-1$ protected Composite usercomp; // space where user can create widgets protected Composite buttoncomp; // space for buttons on the right @@ -408,6 +409,15 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab { container = cs[0]; } dialog.setInitialSelection(container); + dialog.setValidator(new ISelectionStatusValidator() { + public IStatus validate(Object[] selection) { + if (selection != null) + if (selection.length > 0) + if ((selection[0] instanceof IFile)) + return new StatusInfo(IStatus.ERROR, WORKSPACE_DIR_DIALOG_ERR); + return new StatusInfo(); + } + }); dialog.setTitle(WORKSPACE_DIR_DIALOG_TITLE); dialog.setMessage(WORKSPACE_DIR_DIALOG_MSG); } else { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties index 3e7d2a12db7..4b0abb9f176 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties @@ -280,6 +280,7 @@ BrowseEntryDialog.wsp.file.dlg.title=File selection BrowseEntryDialog.wsp.dir.dlg.msg=Select a folder from workspace: BrowseEntryDialog.wsp.file.dlg.msg=Select a file from workspace: BrowseEntryDialog.wsp.file.dlg.err=The selected element is not a file. +BrowseEntryDialog.wsp.dir.dlg.err=The selected element is not a directory. BrowseEntryDialog.fs.dir.dlg.msg=Select a folder from file system: # ----------- New Configuration ----------- |