Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-06-01 13:02:55 +0000
committerUwe Stieber2012-06-01 13:02:55 +0000
commit3968410db7f1f712726b219f3f6fc90c9f0663da (patch)
treec7481f4cc02068a4158197b801facbc421271ade /target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui
parente15eabb2ecf9897b8b53e707cfc03020635bc2ca (diff)
downloadorg.eclipse.tcf-3968410db7f1f712726b219f3f6fc90c9f0663da.tar.gz
org.eclipse.tcf-3968410db7f1f712726b219f3f6fc90c9f0663da.tar.xz
org.eclipse.tcf-3968410db7f1f712726b219f3f6fc90c9f0663da.zip
Target Explorer: Fix FindBugs warnings
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java392
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java19
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java733
3 files changed, 573 insertions, 571 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java
index e8ae03edf..9f459db3c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java
@@ -1,196 +1,196 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.filesystem.ui.dialogs;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.activator.UIPlugin;
-import org.eclipse.tcf.te.tcf.filesystem.ui.controls.FSTreeContentProvider;
-import org.eclipse.tcf.te.tcf.filesystem.ui.controls.FSTreeViewerSorter;
-import org.eclipse.tcf.te.tcf.filesystem.ui.interfaces.IFSConstants;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.columns.FSTreeElementLabelProvider;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.handlers.MoveFilesHandler;
-import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.trees.FilterDescriptor;
-import org.eclipse.tcf.te.ui.trees.ViewerStateManager;
-import org.eclipse.ui.IDecoratorManager;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-
-/**
- * <p>
- * The folder selection dialog for a remote file system. To populate the tree of the selection
- * dialog with the file system, you should call <code>
- * ElementTreeSelectionDialog.setInput</code> to specify the peer model of the remote target. In
- * order to validate the destination folder, you should also specify the nodes to be moved. The file
- * selection dialog is of single selection. You can get the selected result by calling
- * <code>getFirstResult</code>. The type of selected folder is an instance of FSTreeNode.
- * </p>
- * <p>
- * The following is a snippet of example code:
- *
- * <pre>
- * FSFolderSelectionDialog dialog = new FSFolderSelectionDialog(shell);
- * dialog.setInput(peer);
- * dialog.setMovedNodes(nodes);
- * if (dialog.open() == Window.OK) {
- * Object obj = dialog.getFirstResult();
- * Assert.isTrue(obj instanceof FSTreeNode);
- * FSTreeNode folder = (FSTreeNode) obj;
- * // Use folder ...
- * }
- * </pre>
- *
- * @see MoveFilesHandler
- */
-public class FSFolderSelectionDialog extends ElementTreeSelectionDialog {
- // The nodes that are being moved.
- private List<FSTreeNode> movedNodes;
-
- /**
- * Create an FSFolderSelectionDialog using the specified shell as the parent.
- *
- * @param parentShell The parent shell.
- */
- public FSFolderSelectionDialog(Shell parentShell) {
- this(parentShell, new FSTreeElementLabelProvider(), new FSTreeContentProvider());
- }
-
- /**
- * Create an FSFolderSelectionDialog using the specified shell, an FSTreeLabelProvider, and a
- * content provider that provides the tree nodes.
- *
- * @param parentShell The parent shell.
- * @param labelProvider The label provider.
- * @param contentProvider The content provider.
- */
- private FSFolderSelectionDialog(Shell parentShell, ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
- super(parentShell, createDecoratingLabelProvider(labelProvider), contentProvider);
- setTitle(Messages.FSFolderSelectionDialog_MoveDialogTitle);
- setMessage(Messages.FSFolderSelectionDialog_MoveDialogMessage);
- this.setAllowMultiple(false);
- this.setComparator(new FSTreeViewerSorter());
- this.addFilter(new DirectoryFilter());
- this.setStatusLineAboveButtons(false);
- this.setValidator(new ISelectionStatusValidator() {
-
- @Override
- public IStatus validate(Object[] selection) {
- return isValidFolder(selection);
- }
- });
- }
-
- /**
- * The viewer filter used to filter out files.
- */
- static class DirectoryFilter extends ViewerFilter {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof FSTreeNode) {
- FSTreeNode node = (FSTreeNode) element;
- if(node.isFile()) return false;
- }
- return true;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#setInput(java.lang.Object)
- */
- @Override
- public void setInput(Object input) {
- super.setInput(input);
- FilterDescriptor[] filterDescriptors = ViewerStateManager.getInstance().getFilterDescriptors(IFSConstants.ID_TREE_VIEWER_FS, input);
- if (filterDescriptors != null) {
- for(FilterDescriptor descriptor : filterDescriptors) {
- if(descriptor.isEnabled()) {
- addFilter(descriptor.getFilter());
- }
- }
- }
- }
-
- /**
- * Create a decorating label provider using the specified label provider.
- *
- * @param labelProvider The label provider that actually provides labels and images.
- * @return The decorating label provider.
- */
- private static ILabelProvider createDecoratingLabelProvider(ILabelProvider labelProvider) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IDecoratorManager manager = workbench.getDecoratorManager();
- ILabelDecorator decorator = manager.getLabelDecorator();
- return new DecoratingLabelProvider(labelProvider,decorator);
- }
-
- /**
- * Set the nodes that are about to be moved.
- *
- * @param movedNodes The nodes.
- */
- public void setMovedNodes(List<FSTreeNode> movedNodes) {
- this.movedNodes = movedNodes;
- }
-
- /**
- * Create the tree viewer and set it to the label provider.
- */
- @Override
- protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
- TreeViewer viewer = super.doCreateTreeViewer(parent, style);
- viewer.getTree().setLinesVisible(false);
- return viewer;
- }
-
- /**
- * If the specified selection is a valid folder to be selected.
- *
- * @param selection The selected folders.
- * @return An error status if it is invalid or an OK status indicating it is valid.
- */
- IStatus isValidFolder(Object[] selection) {
- String pluginId = UIPlugin.getUniqueIdentifier();
- IStatus error = new Status(IStatus.ERROR, pluginId, null);
- if (selection == null || selection.length == 0) {
- return error;
- }
- if (!(selection[0] instanceof FSTreeNode)) {
- return error;
- }
- FSTreeNode target = (FSTreeNode) selection[0];
- if (movedNodes != null) {
- for (FSTreeNode node : movedNodes) {
- if (node == target || node.isAncestorOf(target)) {
- return error;
- }
- }
- }
- if(!target.isWritable()) {
- return error;
- }
- return new Status(IStatus.OK, pluginId, null);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.filesystem.ui.dialogs;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.ui.activator.UIPlugin;
+import org.eclipse.tcf.te.tcf.filesystem.ui.controls.FSTreeContentProvider;
+import org.eclipse.tcf.te.tcf.filesystem.ui.controls.FSTreeViewerSorter;
+import org.eclipse.tcf.te.tcf.filesystem.ui.interfaces.IFSConstants;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.columns.FSTreeElementLabelProvider;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.handlers.MoveFilesHandler;
+import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.trees.FilterDescriptor;
+import org.eclipse.tcf.te.ui.trees.ViewerStateManager;
+import org.eclipse.ui.IDecoratorManager;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+
+/**
+ * <p>
+ * The folder selection dialog for a remote file system. To populate the tree of the selection
+ * dialog with the file system, you should call <code>
+ * ElementTreeSelectionDialog.setInput</code> to specify the peer model of the remote target. In
+ * order to validate the destination folder, you should also specify the nodes to be moved. The file
+ * selection dialog is of single selection. You can get the selected result by calling
+ * <code>getFirstResult</code>. The type of selected folder is an instance of FSTreeNode.
+ * </p>
+ * <p>
+ * The following is a snippet of example code:
+ *
+ * <pre>
+ * FSFolderSelectionDialog dialog = new FSFolderSelectionDialog(shell);
+ * dialog.setInput(peer);
+ * dialog.setMovedNodes(nodes);
+ * if (dialog.open() == Window.OK) {
+ * Object obj = dialog.getFirstResult();
+ * Assert.isTrue(obj instanceof FSTreeNode);
+ * FSTreeNode folder = (FSTreeNode) obj;
+ * // Use folder ...
+ * }
+ * </pre>
+ *
+ * @see MoveFilesHandler
+ */
+public class FSFolderSelectionDialog extends ElementTreeSelectionDialog {
+ // The nodes that are being moved.
+ private List<FSTreeNode> movedNodes;
+
+ /**
+ * Create an FSFolderSelectionDialog using the specified shell as the parent.
+ *
+ * @param parentShell The parent shell.
+ */
+ public FSFolderSelectionDialog(Shell parentShell) {
+ this(parentShell, new FSTreeElementLabelProvider(), new FSTreeContentProvider());
+ }
+
+ /**
+ * Create an FSFolderSelectionDialog using the specified shell, an FSTreeLabelProvider, and a
+ * content provider that provides the tree nodes.
+ *
+ * @param parentShell The parent shell.
+ * @param labelProvider The label provider.
+ * @param contentProvider The content provider.
+ */
+ private FSFolderSelectionDialog(Shell parentShell, ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
+ super(parentShell, createDecoratingLabelProvider(labelProvider), contentProvider);
+ setTitle(Messages.FSFolderSelectionDialog_MoveDialogTitle);
+ setMessage(Messages.FSFolderSelectionDialog_MoveDialogMessage);
+ this.setAllowMultiple(false);
+ this.setComparator(new FSTreeViewerSorter());
+ this.addFilter(new DirectoryFilter());
+ this.setStatusLineAboveButtons(false);
+ this.setValidator(new ISelectionStatusValidator() {
+
+ @Override
+ public IStatus validate(Object[] selection) {
+ return isValidFolder(selection);
+ }
+ });
+ }
+
+ /**
+ * The viewer filter used to filter out files.
+ */
+ static class DirectoryFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof FSTreeNode) {
+ FSTreeNode node = (FSTreeNode) element;
+ if(node.isFile()) return false;
+ }
+ return true;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#setInput(java.lang.Object)
+ */
+ @Override
+ public void setInput(Object input) {
+ super.setInput(input);
+ FilterDescriptor[] filterDescriptors = ViewerStateManager.getInstance().getFilterDescriptors(IFSConstants.ID_TREE_VIEWER_FS, input);
+ Assert.isNotNull(filterDescriptors);
+ for (FilterDescriptor descriptor : filterDescriptors) {
+ if (descriptor.isEnabled()) {
+ addFilter(descriptor.getFilter());
+ }
+ }
+ }
+
+ /**
+ * Create a decorating label provider using the specified label provider.
+ *
+ * @param labelProvider The label provider that actually provides labels and images.
+ * @return The decorating label provider.
+ */
+ private static ILabelProvider createDecoratingLabelProvider(ILabelProvider labelProvider) {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IDecoratorManager manager = workbench.getDecoratorManager();
+ ILabelDecorator decorator = manager.getLabelDecorator();
+ return new DecoratingLabelProvider(labelProvider,decorator);
+ }
+
+ /**
+ * Set the nodes that are about to be moved.
+ *
+ * @param movedNodes The nodes.
+ */
+ public void setMovedNodes(List<FSTreeNode> movedNodes) {
+ this.movedNodes = movedNodes;
+ }
+
+ /**
+ * Create the tree viewer and set it to the label provider.
+ */
+ @Override
+ protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
+ TreeViewer viewer = super.doCreateTreeViewer(parent, style);
+ viewer.getTree().setLinesVisible(false);
+ return viewer;
+ }
+
+ /**
+ * If the specified selection is a valid folder to be selected.
+ *
+ * @param selection The selected folders.
+ * @return An error status if it is invalid or an OK status indicating it is valid.
+ */
+ IStatus isValidFolder(Object[] selection) {
+ String pluginId = UIPlugin.getUniqueIdentifier();
+ IStatus error = new Status(IStatus.ERROR, pluginId, null);
+ if (selection == null || selection.length == 0) {
+ return error;
+ }
+ if (!(selection[0] instanceof FSTreeNode)) {
+ return error;
+ }
+ FSTreeNode target = (FSTreeNode) selection[0];
+ if (movedNodes != null) {
+ for (FSTreeNode node : movedNodes) {
+ if (node == target || node.isAncestorOf(target)) {
+ return error;
+ }
+ }
+ }
+ if(!target.isWritable()) {
+ return error;
+ }
+ return new Status(IStatus.OK, pluginId, null);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java
index 31b4baac4..0800a95f1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java
@@ -9,6 +9,7 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.filesystem.ui.dialogs;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
@@ -40,7 +41,7 @@ import org.eclipse.ui.dialogs.ISelectionStatusValidator;
public class FSOpenFileDialog extends ElementTreeSelectionDialog {
/**
* Create an FSFolderSelectionDialog using the specified shell as the parent.
- *
+ *
* @param parentShell The parent shell.
*/
public FSOpenFileDialog(Shell parentShell) {
@@ -50,7 +51,7 @@ public class FSOpenFileDialog extends ElementTreeSelectionDialog {
/**
* Create an FSFolderSelectionDialog using the specified shell, an FSTreeLabelProvider, and a
* content provider that provides the tree nodes.
- *
+ *
* @param parentShell The parent shell.
* @param labelProvider The label provider.
* @param contentProvider The content provider.
@@ -77,18 +78,18 @@ public class FSOpenFileDialog extends ElementTreeSelectionDialog {
@Override
public void setInput(Object input) {
super.setInput(input);
- FilterDescriptor[] filterDescriptors = ViewerStateManager.getInstance()
- .getFilterDescriptors(IFSConstants.ID_TREE_VIEWER_FS, input);
- if (filterDescriptors != null) {
- for(FilterDescriptor descriptor : filterDescriptors) {
- if(descriptor.isEnabled()) addFilter(descriptor.getFilter());
+ FilterDescriptor[] filterDescriptors = ViewerStateManager.getInstance().getFilterDescriptors(IFSConstants.ID_TREE_VIEWER_FS, input);
+ Assert.isNotNull(filterDescriptors);
+ for (FilterDescriptor descriptor : filterDescriptors) {
+ if (descriptor.isEnabled()) {
+ addFilter(descriptor.getFilter());
}
}
}
/**
* Create a decorating label provider using the specified label provider.
- *
+ *
* @param labelProvider The label provider that actually provides labels and images.
* @return The decorating label provider.
*/
@@ -111,7 +112,7 @@ public class FSOpenFileDialog extends ElementTreeSelectionDialog {
/**
* If the specified selection is a valid folder to be selected.
- *
+ *
* @param selection The selected folders.
* @return An error status if it is invalid or an OK status indicating it is valid.
*/
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java
index 7dbcc4fe6..521111e6b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java
@@ -1,366 +1,367 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.filesystem.ui.internal.wizards;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.NullOpExecutor;
-import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.OpParsePath;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.controls.FSTreeContentProvider;
-import org.eclipse.tcf.te.tcf.filesystem.ui.controls.FSTreeViewerSorter;
-import org.eclipse.tcf.te.tcf.filesystem.ui.help.IContextHelpIds;
-import org.eclipse.tcf.te.tcf.filesystem.ui.interfaces.IFSConstants;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.columns.FSTreeElementLabelProvider;
-import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
-import org.eclipse.tcf.te.ui.forms.FormLayoutFactory;
-import org.eclipse.tcf.te.ui.trees.FilterDescriptor;
-import org.eclipse.tcf.te.ui.trees.ViewerStateManager;
-import org.eclipse.tcf.te.ui.wizards.pages.AbstractValidatingWizardPage;
-import org.eclipse.ui.IDecoratorManager;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * The base wizard page class to create a new file/folder in the file system of Target Explorer.
- */
-public abstract class NewNodeWizardPage extends AbstractValidatingWizardPage {
- // The form toolkit to create the content of the wizard page.
- private FormToolkit toolkit;
- // The control for the user to enter the new name.
- private BaseEditBrowseTextControl nameControl;
- // The control for the user to enter the parent directory
- private BaseEditBrowseTextControl folderControl;
- // The viewer of the file tree displaying the file system.
- private TreeViewer treeViewer;
-
- /**
- * Create an instance page with the specified page name.
- *
- * @param pageName The page name.
- */
- public NewNodeWizardPage(String pageName) {
- super(pageName);
- }
-
- /**
- * Get the page's title.
- *
- * @return The page's title.
- */
- protected abstract String getPageTitle();
-
- /**
- * Get the page's description.
- *
- * @return The page's description.
- */
- protected abstract String getPageDescription();
-
- /**
- * Get the label of the text field to enter the new name.
- *
- * @return The label of the text field to enter the new name.
- */
- protected abstract String getNameFieldLabel();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void createControl(Composite parent) {
- // Setup title and description
- setTitle(getPageTitle());
- setDescription(getPageDescription());
-
- // Create the forms toolkit
- toolkit = new FormToolkit(parent.getDisplay());
-
- // Create the main panel
- Composite mainPanel = toolkit.createComposite(parent);
- mainPanel.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
- mainPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- mainPanel.setBackground(parent.getBackground());
-
- setControl(mainPanel);
-
- // Setup the help
- PlatformUI.getWorkbench().getHelpSystem()
- .setHelp(mainPanel, IContextHelpIds.FS_NEW_FILE_WIZARD_PAGE);
-
- // Do not validate the page while creating the controls
- boolean changed = setValidationInProgress(true);
- // Create the main panel sub controls
- createMainPanelControls(mainPanel);
- // Reset the validation in progress state
- if (changed) setValidationInProgress(false);
-
- // Adjust the font
- Dialog.applyDialogFont(mainPanel);
-
- // Validate the page for the first time
- setPageComplete(false);
- }
-
- /**
- * Create the main panel of this wizard page.
- *
- * @param parent The parent composite in which the page is created.
- */
- private void createMainPanelControls(Composite parent) {
- Assert.isNotNull(parent);
-
- // Create the client composite
- Composite client = toolkit.createComposite(parent);
- client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 2));
- client.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- client.setBackground(parent.getBackground());
-
- Label label = new Label(client, SWT.NONE);
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
- label.setText(Messages.NewNodeWizardPage_PromptFolderLabel);
-
- folderControl = new BaseEditBrowseTextControl(this);
- folderControl.setIsGroup(false);
- folderControl.setHasHistory(false);
- folderControl.setHideBrowseButton(true);
- folderControl.setHideLabelControl(true);
- folderControl.setAdjustBackgroundColor(true);
- folderControl.setHideEditFieldControlDecoration(true);
- folderControl.setFormToolkit(toolkit);
- folderControl.setParentControlIsInnerPanel(true);
- folderControl.setupPanel(client);
- folderControl.setEditFieldValidator(new FolderValidator(this));
- NewNodeWizard wizard = getWizard();
- FSTreeNode folder = wizard.getFolder();
- if (folder != null) folderControl.setEditFieldControlText(folder.getLocation());
-
- treeViewer = new TreeViewer(client, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.horizontalSpan = 2;
- data.heightHint = 193;
- data.widthHint = 450;
- treeViewer.getTree().setLayoutData(data);
- treeViewer.setContentProvider(new FSTreeContentProvider());
- treeViewer.setLabelProvider(createDecoratingLabelProvider(new FSTreeElementLabelProvider()));
- treeViewer.setComparator(new FSTreeViewerSorter());
- treeViewer.addFilter(new DirectoryFilter());
- IPeerModel peer = wizard.getPeer();
- if (peer != null) {
- setInput(peer);
- }
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- onSelectionChanged();
- }
- });
- if (folder != null) treeViewer.setSelection(new StructuredSelection(folder));
-
- nameControl = new BaseEditBrowseTextControl(this);
- nameControl.setIsGroup(false);
- nameControl.setHasHistory(false);
- nameControl.setHideBrowseButton(true);
- nameControl.setEditFieldLabel(getNameFieldLabel());
- nameControl.setAdjustBackgroundColor(true);
- nameControl.setFormToolkit(toolkit);
- nameControl.setParentControlIsInnerPanel(true);
- nameControl.setupPanel(client);
- nameControl.setEditFieldValidator(new NameValidator(this));
-
- if (folder == null) folderControl.getEditFieldControl().setFocus();
- else nameControl.getEditFieldControl().setFocus();
-
- // restore the widget values from the history
- restoreWidgetValues();
- }
-
- /**
- * The viewer filter to filter out files.
- */
- static class DirectoryFilter extends ViewerFilter {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof FSTreeNode) {
- FSTreeNode node = (FSTreeNode) element;
- if(node.isFile()) return false;
- }
- return true;
- }
- }
-
- /**
- * Set the input of the tree viewer and apply the appropriate filters.
- *
- * @param input The tree viewer's input.
- */
- private void setInput(Object input) {
- treeViewer.setInput(input);
- FilterDescriptor[] filterDescriptors = ViewerStateManager.getInstance().getFilterDescriptors(IFSConstants.ID_TREE_VIEWER_FS, input);
- if (filterDescriptors != null) {
- for (FilterDescriptor descriptor : filterDescriptors) {
- if (descriptor.isEnabled()) treeViewer.addFilter(descriptor.getFilter());
- }
- }
- }
-
- /**
- * Create a decorating label provider using the specified label provider.
- *
- * @param labelProvider The label provider that actually provides labels and images.
- * @return The decorating label provider.
- */
- private static ILabelProvider createDecoratingLabelProvider(ILabelProvider labelProvider) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IDecoratorManager manager = workbench.getDecoratorManager();
- ILabelDecorator decorator = manager.getLabelDecorator();
- return new DecoratingLabelProvider(labelProvider,decorator);
- }
-
- /**
- * Event process handling method when the user select a new folder in the file tree.
- */
- protected void onSelectionChanged() {
- if (treeViewer.getSelection() instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- if (selection.getFirstElement() instanceof FSTreeNode) {
- FSTreeNode folder = (FSTreeNode) selection.getFirstElement();
- folderControl.setEditFieldControlText(folder.getLocation());
- }
- else {
- folderControl.setEditFieldControlText(""); //$NON-NLS-1$
- }
- }
-
- // Update the wizard container UI elements
- IWizardContainer container = getContainer();
- if (container != null && container.getCurrentPage() != null) {
- container.updateWindowTitle();
- container.updateTitleBar();
- container.updateButtons();
- }
- validate();
- }
-
- /**
- * Set a new peer as the input of the file tree. Called
- * by the wizard to update the file tree when an alternative
- * target peer is selected in the target selection page.
- *
- * @param peer The new target peer.
- */
- public void setPeer(IPeerModel peer) {
- if (peer != null) {
- setInput(peer);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.wizards.pages.AbstractValidatingWizardPage#validate()
- */
- @Override
- public void validate() {
- super.validate();
- if (!isPageComplete()) return;
-
- if (isValidationInProgress()) return;
- setValidationInProgress(true);
-
- boolean valid = true;
- if (folderControl != null) {
- valid &= folderControl.isValid();
- setMessage(folderControl.getMessage(), folderControl.getMessageType());
- }
-
- if (nameControl != null) {
- valid &= nameControl.isValid();
- if (nameControl.getMessageType() > getMessageType()) {
- setMessage(nameControl.getMessage(), nameControl.getMessageType());
- }
- }
-
- setPageComplete(valid);
- setValidationInProgress(false);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- @Override
- public void dispose() {
- if (nameControl != null) {
- nameControl.dispose();
- nameControl = null;
- }
- super.dispose();
- }
-
- /**
- * Get the entered name of this node.
- *
- * @return The entered name of this node.
- */
- public String getNodeName() {
- return nameControl.getEditFieldControlTextForValidation();
- }
-
- /**
- * Get the parent wizard. Override the parent method to
- * cast the result to NewNodeWizard.
- */
- @Override
- public NewNodeWizard getWizard() {
- return (NewNodeWizard) super.getWizard();
- }
-
- /**
- * Get the currently input directory node. It parses
- * the currently entered path and tries to find the
- * corresponding directory node in the file system of
- * the target peer.
- *
- * @return The directory node if it exists or else null.
- */
- public FSTreeNode getInputDir() {
- NewNodeWizard wizard = getWizard();
- IPeerModel peer = wizard.getPeer();
- if (peer == null) return null;
- final String text = folderControl.getEditFieldControlText();
- if (text != null) {
- String path = text.trim();
- OpParsePath parser = new OpParsePath(peer, path);
- new NullOpExecutor().execute(parser);
- return parser.getResult();
- }
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.filesystem.ui.internal.wizards;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.NullOpExecutor;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.OpParsePath;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.ui.controls.FSTreeContentProvider;
+import org.eclipse.tcf.te.tcf.filesystem.ui.controls.FSTreeViewerSorter;
+import org.eclipse.tcf.te.tcf.filesystem.ui.help.IContextHelpIds;
+import org.eclipse.tcf.te.tcf.filesystem.ui.interfaces.IFSConstants;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.columns.FSTreeElementLabelProvider;
+import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
+import org.eclipse.tcf.te.ui.forms.FormLayoutFactory;
+import org.eclipse.tcf.te.ui.trees.FilterDescriptor;
+import org.eclipse.tcf.te.ui.trees.ViewerStateManager;
+import org.eclipse.tcf.te.ui.wizards.pages.AbstractValidatingWizardPage;
+import org.eclipse.ui.IDecoratorManager;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * The base wizard page class to create a new file/folder in the file system of Target Explorer.
+ */
+public abstract class NewNodeWizardPage extends AbstractValidatingWizardPage {
+ // The form toolkit to create the content of the wizard page.
+ private FormToolkit toolkit;
+ // The control for the user to enter the new name.
+ private BaseEditBrowseTextControl nameControl;
+ // The control for the user to enter the parent directory
+ private BaseEditBrowseTextControl folderControl;
+ // The viewer of the file tree displaying the file system.
+ private TreeViewer treeViewer;
+
+ /**
+ * Create an instance page with the specified page name.
+ *
+ * @param pageName The page name.
+ */
+ public NewNodeWizardPage(String pageName) {
+ super(pageName);
+ }
+
+ /**
+ * Get the page's title.
+ *
+ * @return The page's title.
+ */
+ protected abstract String getPageTitle();
+
+ /**
+ * Get the page's description.
+ *
+ * @return The page's description.
+ */
+ protected abstract String getPageDescription();
+
+ /**
+ * Get the label of the text field to enter the new name.
+ *
+ * @return The label of the text field to enter the new name.
+ */
+ protected abstract String getNameFieldLabel();
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+ // Setup title and description
+ setTitle(getPageTitle());
+ setDescription(getPageDescription());
+
+ // Create the forms toolkit
+ toolkit = new FormToolkit(parent.getDisplay());
+
+ // Create the main panel
+ Composite mainPanel = toolkit.createComposite(parent);
+ mainPanel.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
+ mainPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ mainPanel.setBackground(parent.getBackground());
+
+ setControl(mainPanel);
+
+ // Setup the help
+ PlatformUI.getWorkbench().getHelpSystem()
+ .setHelp(mainPanel, IContextHelpIds.FS_NEW_FILE_WIZARD_PAGE);
+
+ // Do not validate the page while creating the controls
+ boolean changed = setValidationInProgress(true);
+ // Create the main panel sub controls
+ createMainPanelControls(mainPanel);
+ // Reset the validation in progress state
+ if (changed) setValidationInProgress(false);
+
+ // Adjust the font
+ Dialog.applyDialogFont(mainPanel);
+
+ // Validate the page for the first time
+ setPageComplete(false);
+ }
+
+ /**
+ * Create the main panel of this wizard page.
+ *
+ * @param parent The parent composite in which the page is created.
+ */
+ private void createMainPanelControls(Composite parent) {
+ Assert.isNotNull(parent);
+
+ // Create the client composite
+ Composite client = toolkit.createComposite(parent);
+ client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 2));
+ client.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ client.setBackground(parent.getBackground());
+
+ Label label = new Label(client, SWT.NONE);
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+ label.setText(Messages.NewNodeWizardPage_PromptFolderLabel);
+
+ folderControl = new BaseEditBrowseTextControl(this);
+ folderControl.setIsGroup(false);
+ folderControl.setHasHistory(false);
+ folderControl.setHideBrowseButton(true);
+ folderControl.setHideLabelControl(true);
+ folderControl.setAdjustBackgroundColor(true);
+ folderControl.setHideEditFieldControlDecoration(true);
+ folderControl.setFormToolkit(toolkit);
+ folderControl.setParentControlIsInnerPanel(true);
+ folderControl.setupPanel(client);
+ folderControl.setEditFieldValidator(new FolderValidator(this));
+ NewNodeWizard wizard = getWizard();
+ FSTreeNode folder = wizard.getFolder();
+ if (folder != null) folderControl.setEditFieldControlText(folder.getLocation());
+
+ treeViewer = new TreeViewer(client, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ data.horizontalSpan = 2;
+ data.heightHint = 193;
+ data.widthHint = 450;
+ treeViewer.getTree().setLayoutData(data);
+ treeViewer.setContentProvider(new FSTreeContentProvider());
+ treeViewer.setLabelProvider(createDecoratingLabelProvider(new FSTreeElementLabelProvider()));
+ treeViewer.setComparator(new FSTreeViewerSorter());
+ treeViewer.addFilter(new DirectoryFilter());
+ IPeerModel peer = wizard.getPeer();
+ if (peer != null) {
+ setInput(peer);
+ }
+ treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ onSelectionChanged();
+ }
+ });
+ if (folder != null) treeViewer.setSelection(new StructuredSelection(folder));
+
+ nameControl = new BaseEditBrowseTextControl(this);
+ nameControl.setIsGroup(false);
+ nameControl.setHasHistory(false);
+ nameControl.setHideBrowseButton(true);
+ nameControl.setEditFieldLabel(getNameFieldLabel());
+ nameControl.setAdjustBackgroundColor(true);
+ nameControl.setFormToolkit(toolkit);
+ nameControl.setParentControlIsInnerPanel(true);
+ nameControl.setupPanel(client);
+ nameControl.setEditFieldValidator(new NameValidator(this));
+
+ if (folder == null) folderControl.getEditFieldControl().setFocus();
+ else nameControl.getEditFieldControl().setFocus();
+
+ // restore the widget values from the history
+ restoreWidgetValues();
+ }
+
+ /**
+ * The viewer filter to filter out files.
+ */
+ static class DirectoryFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof FSTreeNode) {
+ FSTreeNode node = (FSTreeNode) element;
+ if(node.isFile()) return false;
+ }
+ return true;
+ }
+ }
+
+ /**
+ * Set the input of the tree viewer and apply the appropriate filters.
+ *
+ * @param input The tree viewer's input.
+ */
+ private void setInput(Object input) {
+ treeViewer.setInput(input);
+ FilterDescriptor[] filterDescriptors = ViewerStateManager.getInstance().getFilterDescriptors(IFSConstants.ID_TREE_VIEWER_FS, input);
+ Assert.isNotNull(filterDescriptors);
+ for (FilterDescriptor descriptor : filterDescriptors) {
+ if (descriptor.isEnabled()) {
+ treeViewer.addFilter(descriptor.getFilter());
+ }
+ }
+ }
+
+ /**
+ * Create a decorating label provider using the specified label provider.
+ *
+ * @param labelProvider The label provider that actually provides labels and images.
+ * @return The decorating label provider.
+ */
+ private static ILabelProvider createDecoratingLabelProvider(ILabelProvider labelProvider) {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IDecoratorManager manager = workbench.getDecoratorManager();
+ ILabelDecorator decorator = manager.getLabelDecorator();
+ return new DecoratingLabelProvider(labelProvider,decorator);
+ }
+
+ /**
+ * Event process handling method when the user select a new folder in the file tree.
+ */
+ protected void onSelectionChanged() {
+ if (treeViewer.getSelection() instanceof IStructuredSelection) {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ if (selection.getFirstElement() instanceof FSTreeNode) {
+ FSTreeNode folder = (FSTreeNode) selection.getFirstElement();
+ folderControl.setEditFieldControlText(folder.getLocation());
+ }
+ else {
+ folderControl.setEditFieldControlText(""); //$NON-NLS-1$
+ }
+ }
+
+ // Update the wizard container UI elements
+ IWizardContainer container = getContainer();
+ if (container != null && container.getCurrentPage() != null) {
+ container.updateWindowTitle();
+ container.updateTitleBar();
+ container.updateButtons();
+ }
+ validate();
+ }
+
+ /**
+ * Set a new peer as the input of the file tree. Called
+ * by the wizard to update the file tree when an alternative
+ * target peer is selected in the target selection page.
+ *
+ * @param peer The new target peer.
+ */
+ public void setPeer(IPeerModel peer) {
+ if (peer != null) {
+ setInput(peer);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.wizards.pages.AbstractValidatingWizardPage#validate()
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ if (!isPageComplete()) return;
+
+ if (isValidationInProgress()) return;
+ setValidationInProgress(true);
+
+ boolean valid = true;
+ if (folderControl != null) {
+ valid &= folderControl.isValid();
+ setMessage(folderControl.getMessage(), folderControl.getMessageType());
+ }
+
+ if (nameControl != null) {
+ valid &= nameControl.isValid();
+ if (nameControl.getMessageType() > getMessageType()) {
+ setMessage(nameControl.getMessage(), nameControl.getMessageType());
+ }
+ }
+
+ setPageComplete(valid);
+ setValidationInProgress(false);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (nameControl != null) {
+ nameControl.dispose();
+ nameControl = null;
+ }
+ super.dispose();
+ }
+
+ /**
+ * Get the entered name of this node.
+ *
+ * @return The entered name of this node.
+ */
+ public String getNodeName() {
+ return nameControl.getEditFieldControlTextForValidation();
+ }
+
+ /**
+ * Get the parent wizard. Override the parent method to
+ * cast the result to NewNodeWizard.
+ */
+ @Override
+ public NewNodeWizard getWizard() {
+ return (NewNodeWizard) super.getWizard();
+ }
+
+ /**
+ * Get the currently input directory node. It parses
+ * the currently entered path and tries to find the
+ * corresponding directory node in the file system of
+ * the target peer.
+ *
+ * @return The directory node if it exists or else null.
+ */
+ public FSTreeNode getInputDir() {
+ NewNodeWizard wizard = getWizard();
+ IPeerModel peer = wizard.getPeer();
+ if (peer == null) return null;
+ final String text = folderControl.getEditFieldControlText();
+ if (text != null) {
+ String path = text.trim();
+ OpParsePath parser = new OpParsePath(peer, path);
+ new NullOpExecutor().execute(parser);
+ return parser.getResult();
+ }
+ return null;
+ }
+}

Back to the top