Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IUIService.java29
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java171
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java318
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/META-INF/MANIFEST.MF2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.java410
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/help/IContextHelpIds.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/IContextHelpIds.java)2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/IFilteringLabelDecorator.java43
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IDeleteHandlerDelegate.java31
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.java72
10 files changed, 538 insertions, 546 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IUIService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IUIService.java
new file mode 100644
index 000000000..f1dcdc067
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IUIService.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 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.runtime.services.interfaces;
+
+/**
+ * UI service.
+ * <p>
+ * Allows to provide customized implementations for UI related functionality which
+ * supports delegating parts of the logic to context specific delegates.
+ */
+public interface IUIService extends IService {
+
+ /**
+ * Returns the delegate for the requested delegate class and context.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param clazz The delegate class. Must not be <code>null</code>.
+ *
+ * @return The delegate or <code>null</code>.
+ */
+ public <V extends Object> V getDelegate(Object context, Class<? extends V> clazz);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java
index fb83c2ebe..39b1793bc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java
@@ -11,7 +11,6 @@ package org.eclipse.tcf.te.tcf.ui.handler;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
@@ -25,7 +24,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.osgi.util.NLS;
@@ -35,6 +33,7 @@ import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerUtil;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
@@ -42,6 +41,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshSe
import org.eclipse.tcf.te.tcf.locator.model.Model;
import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.interfaces.handler.IDeleteHandlerDelegate;
import org.eclipse.tcf.te.ui.views.Managers;
import org.eclipse.tcf.te.ui.views.ViewsUtil;
import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
@@ -95,38 +95,47 @@ public class DeleteHandler extends AbstractHandler {
boolean canDelete = false;
- // The selection must be a structured selection and must not be empty
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ // The selection must be a tree selection and must not be empty
+ if (selection instanceof ITreeSelection && !selection.isEmpty()) {
// Assume the selection to be deletable
canDelete = true;
// Iterate the selection. All elements must be of type IPeerModel
- Iterator<?> iterator = ((IStructuredSelection)selection).iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
+ for (TreePath treePath : ((ITreeSelection)selection).getPaths()) {
+ // Get the element
+ Object element = treePath.getLastSegment();
+ // This handler will take care of peer model nodes only
if (!(element instanceof IPeerModel)) {
canDelete = false;
break;
}
- // Determine if the selected peer model is static
- boolean isStatic = isStatic((IPeerModel)element);
- // Determine if the selected peer model represents an agent
- // started by the current user
- boolean isStartedByCurrentUser = isStartedByCurrentUser((IPeerModel)element);
- // Static nodes can be handled the one way or the other.
- // For dynamic nodes, "delete" means "remove from <category>",
- // and this works only if the parent category is not "Neighborhood".
- if (!isStatic) {
- // Determine the parent categories for the selected node
- ICategory[] categories = getParentCategories(selection, (IPeerModel)element);
- for (ICategory category : categories) {
- if (IUIConstants.ID_CAT_NEIGHBORHOOD.equals(category.getId())) {
- canDelete = false;
- break;
- }
- else if (IUIConstants.ID_CAT_MY_TARGETS.equals(category.getId()) && isStartedByCurrentUser) {
- canDelete = false;
- break;
+ // Check if there is a delete handler delegate for the element
+ IUIService service = ServiceManager.getInstance().getService(element, IUIService.class);
+ IDeleteHandlerDelegate delegate = service != null ? service.getDelegate(element, IDeleteHandlerDelegate.class) : null;
+ // If a delegate is available, ask the handler first if the given element is currently deletable
+ if (delegate != null) canDelete = delegate.canDelete(treePath);
+ // If the element is still marked deletable, apply the default check too
+ if (canDelete) {
+ // Determine if the selected peer model is static
+ boolean isStatic = isStatic((IPeerModel)element);
+ // Determine if the selected peer model represents an agent
+ // started by the current user
+ boolean isStartedByCurrentUser = isStartedByCurrentUser((IPeerModel)element);
+ // Static nodes can be handled the one way or the other.
+ // For dynamic nodes, "delete" means "remove from <category>",
+ // and this works only if the parent category is not "Neighborhood".
+ if (!isStatic) {
+ // Determine the parent category of the current tree path
+ ICategory category = treePath.getFirstSegment() instanceof ICategory ? (ICategory)treePath.getFirstSegment() : null;
+ if (category != null) {
+ if (IUIConstants.ID_CAT_NEIGHBORHOOD.equals(category.getId())) {
+ canDelete = false;
+ break;
+ }
+ else if (IUIConstants.ID_CAT_MY_TARGETS.equals(category.getId()) && isStartedByCurrentUser) {
+ canDelete = false;
+ break;
+ }
}
}
}
@@ -200,41 +209,6 @@ public class DeleteHandler extends AbstractHandler {
}
/**
- * Returns the parent categories of the selected node based on the
- * given selection.
- *
- * @param selection The selection. Must not be <code>null</code>.
- * @param node The peer model node. Must not be <code>null</code>.
- *
- * @return The list of parent categories of the selected node.
- */
- private ICategory[] getParentCategories(ISelection selection, IPeerModel node) {
- Assert.isNotNull(selection);
- Assert.isNotNull(node);
-
- List<ICategory> categories = new ArrayList<ICategory>();
-
- // Get all tree pathes of the given node
- if (selection instanceof ITreeSelection) {
- TreePath[] pathes = ((ITreeSelection)selection).getPathsFor(node);
- for (TreePath path : pathes) {
- // Loop through the parent pathes to find the category element
- TreePath parentPath = path.getParentPath();
- while (parentPath != null) {
- if (parentPath.getLastSegment() instanceof ICategory
- && !categories.contains(parentPath.getLastSegment())) {
- categories.add((ICategory)parentPath.getLastSegment());
- break;
- }
- parentPath = parentPath.getParentPath();
- }
- }
- }
-
- return categories.toArray(new ICategory[categories.size()]);
- }
-
- /**
* Internal helper class to describe the delete operation to perform.
*/
private static class Operation {
@@ -303,10 +277,10 @@ public class DeleteHandler extends AbstractHandler {
// from an asynchronous callback, set this flag to false.
boolean invokeCallback = true;
- // The selection must be a structured selection and must not be empty
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ // The selection must be a tree selection and must not be empty
+ if (selection instanceof ITreeSelection && !selection.isEmpty()) {
// Determine the operations to perform for each of the selected elements
- Operation[] operations = selection2operations((IStructuredSelection)selection);
+ Operation[] operations = selection2operations((ITreeSelection)selection);
// Seek confirmation for the "remove" operations. If the user deny it,
// everything, including the "unlink" operations are cancelled.
@@ -364,59 +338,58 @@ public class DeleteHandler extends AbstractHandler {
* @param selection The selection. Must not be <code>null</code>.
* @return The list of operations.
*/
- private Operation[] selection2operations(IStructuredSelection selection) {
+ private Operation[] selection2operations(ITreeSelection selection) {
Assert.isNotNull(selection);
List<Operation> operations = new ArrayList<Operation>();
- Iterator<?> iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
+ // Iterate the selection. All elements must be of type IPeerModel
+ for (TreePath treePath : selection.getPaths()) {
+ // Get the element
+ Object element = treePath.getLastSegment();
Assert.isTrue(element instanceof IPeerModel);
IPeerModel node = (IPeerModel)element;
boolean isStatic = isStatic(node);
- ICategory[] categories = getParentCategories(selection, node);
+ ICategory category = treePath.getFirstSegment() instanceof ICategory ? (ICategory)treePath.getFirstSegment() : null;
- if (categories.length == 0 && isStatic) {
+ if (category == null && isStatic) {
Operation op = new Operation();
op.node = node;
op.type = Operation.TYPE.Remove;
operations.add(op);
- } else {
- for (ICategory category : categories) {
- // If the parent category is "Favorites", it is always
- // an "unlink" operation
- if (IUIConstants.ID_CAT_FAVORITES.equals(category.getId())) {
- Operation op = new Operation();
- op.node = node;
+ } else if (category != null) {
+ // If the parent category is "Favorites", it is always
+ // an "unlink" operation
+ if (IUIConstants.ID_CAT_FAVORITES.equals(category.getId())) {
+ Operation op = new Operation();
+ op.node = node;
+ op.type = Operation.TYPE.Unlink;
+ op.parentCategory = category;
+ operations.add(op);
+ }
+ // If the parent category is "My Targets", is is an
+ // "remove" operation for static peers and "unlink" for
+ // dynamic peers
+ else if (IUIConstants.ID_CAT_MY_TARGETS.equals(category.getId())) {
+ Operation op = new Operation();
+ op.node = node;
+
+ if (isStatic) {
+ op.type = Operation.TYPE.Remove;
+ } else {
op.type = Operation.TYPE.Unlink;
op.parentCategory = category;
- operations.add(op);
}
- // If the parent category is "My Targets", is is an
- // "remove" operation for static peers and "unlink" for
- // dynamic peers
- else if (IUIConstants.ID_CAT_MY_TARGETS.equals(category.getId())) {
- Operation op = new Operation();
- op.node = node;
-
- if (isStatic) {
- op.type = Operation.TYPE.Remove;
- } else {
- op.type = Operation.TYPE.Unlink;
- op.parentCategory = category;
- }
- operations.add(op);
- }
- else {
- Operation op = new Operation();
- op.node = node;
- op.type = Operation.TYPE.Remove;
+ operations.add(op);
+ }
+ else {
+ Operation op = new Operation();
+ op.node = node;
+ op.type = Operation.TYPE.Remove;
- operations.add(op);
- }
+ operations.add(op);
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java
index ec70ab94d..14a54e51b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java
@@ -25,7 +25,7 @@ import org.eclipse.swt.SWTException;
import org.eclipse.swt.widgets.Control;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IAdapterService;
+import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.ui.tables.properties.NodePropertiesTableTableNode;
import org.eclipse.ui.forms.widgets.Section;
@@ -65,8 +65,8 @@ public class PeerGeneralSectionContentProvider implements IStructuredContentProv
if (inputElement instanceof IPeerModel) {
// Get the associated label provider
- IAdapterService service = ServiceManager.getInstance().getService(inputElement, IAdapterService.class);
- ILabelProvider provider = service != null ? service.getAdapter(inputElement, ILabelProvider.class) : null;
+ IUIService service = ServiceManager.getInstance().getService(inputElement, IUIService.class);
+ ILabelProvider provider = service != null ? service.getDelegate(inputElement, ILabelProvider.class) : null;
// Get all custom properties of the node
final Map<String, Object> properties = new HashMap<String, Object>();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java
index 529b9404e..47bbefea0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java
@@ -1,159 +1,159 @@
-/*******************************************************************************
- * 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
- * Tobias Schwarz (Wind River) - [368243] [UI] Allow dynamic new wizard contributions
- *******************************************************************************/
-package org.eclipse.tcf.te.ui.views.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.tcf.te.ui.interfaces.IContextHelpIds;
-import org.eclipse.tcf.te.ui.interfaces.ImageConsts;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.nls.Messages;
-import org.eclipse.tcf.te.ui.wizards.newWizard.NewWizardRegistry;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.internal.actions.CommandAction;
-import org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonMenuConstants;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
-import org.eclipse.ui.navigator.WizardActionGroup;
-import org.eclipse.ui.wizards.IWizardDescriptor;
-
-/**
- * Action provider implementation providing the "New >" content menu
- * content.
- */
-@SuppressWarnings("restriction")
-public class NewActionProvider extends CommonActionProvider {
- // Reference to the action showing the "Other..." dialog (context menu)
- private CommandAction newWizardCommandAction = null;
- // Reference to the action showing the "Other..." dialog (toolbar)
- private CommandAction newWizardCommandActionToolbar = null;
- // Reference to the action group managing the context sensitive new wizards
- private WizardActionGroup newWizardActionGroup = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite)
- */
- @Override
- public void init(ICommonActionExtensionSite site) {
- super.init(site);
-
- if (site.getViewSite() instanceof ICommonViewerWorkbenchSite) {
- // To initialize the actions, the workbench window instance is required
- IWorkbenchWindow window = ((ICommonViewerWorkbenchSite)site.getViewSite()).getWorkbenchWindow();
- // Initialize the actions
- newWizardCommandAction = new CommandAction(window, "org.eclipse.tcf.te.ui.command.newWizards"); //$NON-NLS-1$
- newWizardCommandAction.setImageDescriptor(null);
- newWizardCommandAction.setDisabledImageDescriptor(null);
- newWizardCommandAction.setText(Messages.NewActionProvider_NewWizardCommandAction_label);
- newWizardCommandAction.setToolTipText(Messages.NewActionProvider_NewWizardCommandAction_tooltip);
- window.getWorkbench().getHelpSystem().setHelp(newWizardCommandAction, IContextHelpIds.NEW_TARGET_WIZARD);
-
- newWizardCommandActionToolbar = new CommandAction(window, "org.eclipse.tcf.te.ui.command.newWizards"); //$NON-NLS-1$
- newWizardCommandActionToolbar.setImageDescriptor(org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_ENABLED));
- newWizardCommandActionToolbar.setDisabledImageDescriptor(org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_DISABLED));
- newWizardCommandActionToolbar.setText(Messages.NewActionProvider_NewWizardCommandAction_label);
- newWizardCommandActionToolbar.setToolTipText(Messages.NewActionProvider_NewWizardCommandAction_tooltip);
- window.getWorkbench().getHelpSystem().setHelp(newWizardCommandActionToolbar, IContextHelpIds.NEW_TARGET_WIZARD);
-
- newWizardActionGroup = new WizardActionGroup(window,
- NewWizardRegistry.getInstance(),
- WizardActionGroup.TYPE_NEW,
- site.getContentService());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionGroup#dispose()
- */
- @Override
- public void dispose() {
- if (newWizardCommandAction != null) {
- newWizardCommandAction.dispose();
- newWizardCommandAction = null;
- }
- if (newWizardActionGroup != null) {
- newWizardActionGroup.dispose();
- newWizardActionGroup = null;
- }
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- @Override
- public void fillContextMenu(IMenuManager menu) {
- // If none of the actions got created, there is nothing to do here
- if (newWizardCommandAction == null && newWizardActionGroup == null) {
- return;
- }
-
- // Create the new sub menu
- IMenuManager newMenu = new MenuManager(Messages.NewActionProvider_NewMenu_label,
- org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_ENABLED),
- IUIConstants.ID_EXPLORER + ".menu.new"); //$NON-NLS-1$
-
- // Add the context sensitive wizards (commonWizard element)
- if (newWizardActionGroup != null) {
- newWizardActionGroup.setContext(getContext());
- newWizardActionGroup.fillContextMenu(newMenu);
- }
-
-
- IWorkbenchWindow window = ((ICommonViewerWorkbenchSite)getActionSite().getViewSite()).getWorkbenchWindow();
- for (IWizardDescriptor wizard : NewWizardRegistry.getInstance().getCommonWizards(getContext().getSelection())) {
- IAction action = new WizardShortcutAction(window, wizard);
- newMenu.add(action);
- }
-
- // Add the standard additions marker
- newMenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
-
- // Add the "Other..." dialog action
- if (newWizardCommandAction != null) {
- newMenu.add(new Separator());
- newMenu.add(newWizardCommandAction);
- }
-
- // The menu will be appended after the GROUP_NEW group.
- menu.insertAfter(ICommonMenuConstants.GROUP_NEW, newMenu);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
- */
- @Override
- public void fillActionBars(IActionBars actionBars) {
- // If none of the actions got created, there is nothing to do here
- if (newWizardCommandActionToolbar == null) {
- return;
- }
-
- // Get the toolbar manager
- IToolBarManager toolbar = actionBars.getToolBarManager();
-
- // Check for the newWizard action in the toolbar. If found,
- // drop out immediately to avoid adding the items to the toolbar
- // again and again
- if (toolbar.find("org.eclipse.tcf.te.ui.command.newWizards") != null) { //$NON-NLS-1$
- return;
- }
-
- // Add the items to the toolbar
- toolbar.insertAfter(ICommonMenuConstants.GROUP_NEW, newWizardCommandActionToolbar);
- }
-}
+/*******************************************************************************
+ * 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
+ * Tobias Schwarz (Wind River) - [368243] [UI] Allow dynamic new wizard contributions
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.views.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.tcf.te.ui.help.IContextHelpIds;
+import org.eclipse.tcf.te.ui.interfaces.ImageConsts;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.tcf.te.ui.views.nls.Messages;
+import org.eclipse.tcf.te.ui.wizards.newWizard.NewWizardRegistry;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.internal.actions.CommandAction;
+import org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonMenuConstants;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.ui.navigator.WizardActionGroup;
+import org.eclipse.ui.wizards.IWizardDescriptor;
+
+/**
+ * Action provider implementation providing the "New >" content menu
+ * content.
+ */
+@SuppressWarnings("restriction")
+public class NewActionProvider extends CommonActionProvider {
+ // Reference to the action showing the "Other..." dialog (context menu)
+ private CommandAction newWizardCommandAction = null;
+ // Reference to the action showing the "Other..." dialog (toolbar)
+ private CommandAction newWizardCommandActionToolbar = null;
+ // Reference to the action group managing the context sensitive new wizards
+ private WizardActionGroup newWizardActionGroup = null;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite)
+ */
+ @Override
+ public void init(ICommonActionExtensionSite site) {
+ super.init(site);
+
+ if (site.getViewSite() instanceof ICommonViewerWorkbenchSite) {
+ // To initialize the actions, the workbench window instance is required
+ IWorkbenchWindow window = ((ICommonViewerWorkbenchSite)site.getViewSite()).getWorkbenchWindow();
+ // Initialize the actions
+ newWizardCommandAction = new CommandAction(window, "org.eclipse.tcf.te.ui.command.newWizards"); //$NON-NLS-1$
+ newWizardCommandAction.setImageDescriptor(null);
+ newWizardCommandAction.setDisabledImageDescriptor(null);
+ newWizardCommandAction.setText(Messages.NewActionProvider_NewWizardCommandAction_label);
+ newWizardCommandAction.setToolTipText(Messages.NewActionProvider_NewWizardCommandAction_tooltip);
+ window.getWorkbench().getHelpSystem().setHelp(newWizardCommandAction, IContextHelpIds.NEW_TARGET_WIZARD);
+
+ newWizardCommandActionToolbar = new CommandAction(window, "org.eclipse.tcf.te.ui.command.newWizards"); //$NON-NLS-1$
+ newWizardCommandActionToolbar.setImageDescriptor(org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_ENABLED));
+ newWizardCommandActionToolbar.setDisabledImageDescriptor(org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_DISABLED));
+ newWizardCommandActionToolbar.setText(Messages.NewActionProvider_NewWizardCommandAction_label);
+ newWizardCommandActionToolbar.setToolTipText(Messages.NewActionProvider_NewWizardCommandAction_tooltip);
+ window.getWorkbench().getHelpSystem().setHelp(newWizardCommandActionToolbar, IContextHelpIds.NEW_TARGET_WIZARD);
+
+ newWizardActionGroup = new WizardActionGroup(window,
+ NewWizardRegistry.getInstance(),
+ WizardActionGroup.TYPE_NEW,
+ site.getContentService());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionGroup#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (newWizardCommandAction != null) {
+ newWizardCommandAction.dispose();
+ newWizardCommandAction = null;
+ }
+ if (newWizardActionGroup != null) {
+ newWizardActionGroup.dispose();
+ newWizardActionGroup = null;
+ }
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
+ */
+ @Override
+ public void fillContextMenu(IMenuManager menu) {
+ // If none of the actions got created, there is nothing to do here
+ if (newWizardCommandAction == null && newWizardActionGroup == null) {
+ return;
+ }
+
+ // Create the new sub menu
+ IMenuManager newMenu = new MenuManager(Messages.NewActionProvider_NewMenu_label,
+ org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_ENABLED),
+ IUIConstants.ID_EXPLORER + ".menu.new"); //$NON-NLS-1$
+
+ // Add the context sensitive wizards (commonWizard element)
+ if (newWizardActionGroup != null) {
+ newWizardActionGroup.setContext(getContext());
+ newWizardActionGroup.fillContextMenu(newMenu);
+ }
+
+
+ IWorkbenchWindow window = ((ICommonViewerWorkbenchSite)getActionSite().getViewSite()).getWorkbenchWindow();
+ for (IWizardDescriptor wizard : NewWizardRegistry.getInstance().getCommonWizards(getContext().getSelection())) {
+ IAction action = new WizardShortcutAction(window, wizard);
+ newMenu.add(action);
+ }
+
+ // Add the standard additions marker
+ newMenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
+
+ // Add the "Other..." dialog action
+ if (newWizardCommandAction != null) {
+ newMenu.add(new Separator());
+ newMenu.add(newWizardCommandAction);
+ }
+
+ // The menu will be appended after the GROUP_NEW group.
+ menu.insertAfter(ICommonMenuConstants.GROUP_NEW, newMenu);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
+ */
+ @Override
+ public void fillActionBars(IActionBars actionBars) {
+ // If none of the actions got created, there is nothing to do here
+ if (newWizardCommandActionToolbar == null) {
+ return;
+ }
+
+ // Get the toolbar manager
+ IToolBarManager toolbar = actionBars.getToolBarManager();
+
+ // Check for the newWizard action in the toolbar. If found,
+ // drop out immediately to avoid adding the items to the toolbar
+ // again and again
+ if (toolbar.find("org.eclipse.tcf.te.ui.command.newWizards") != null) { //$NON-NLS-1$
+ return;
+ }
+
+ // Add the items to the toolbar
+ toolbar.insertAfter(ICommonMenuConstants.GROUP_NEW, newWizardCommandActionToolbar);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.ui/META-INF/MANIFEST.MF
index 6e3229a05..79c085b40 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/META-INF/MANIFEST.MF
@@ -26,8 +26,10 @@ Export-Package: org.eclipse.tcf.te.ui,
org.eclipse.tcf.te.ui.async,
org.eclipse.tcf.te.ui.dialogs,
org.eclipse.tcf.te.ui.events,
+ org.eclipse.tcf.te.ui.help,
org.eclipse.tcf.te.ui.interfaces,
org.eclipse.tcf.te.ui.interfaces.data,
+ org.eclipse.tcf.te.ui.interfaces.handler,
org.eclipse.tcf.te.ui.internal.executors;x-internal:=true,
org.eclipse.tcf.te.ui.internal.utils;x-internal:=true,
org.eclipse.tcf.te.ui.nls,
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.java
index be9ec4c23..208987fd0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.java
@@ -1,205 +1,205 @@
-/*******************************************************************************
- * 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.ui.dialogs;
-
-import java.util.Arrays;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.tcf.te.ui.interfaces.IContextHelpIds;
-import org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog;
-import org.eclipse.tcf.te.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
-
-/**
- * Dialog implementation allowing to enter the data for name/value pairs.
- */
-public class NameValuePairDialog extends CustomTitleAreaDialog {
-
- private String name;
- private String value;
-
- private String dialogTitle;
- private String title;
- private String message;
- private String[] fieldLabels;
- private String[] initialValues;
- private Set<String> usedNames;
-
- private Text nameText;
- private Text valueText;
-
- /**
- * Constructor.
- *
- * @param shell The parent shell or <code>null</code>.
- * @param dialogTitle The dialog title. Must not be <code>null</code>.
- * @param title The title. Must not be <code>null</code>.
- * @param message The dialogs default message. Must not be <code>null</code>.
- * @param fieldLabels The field labels. Must not be <code>null</code>.
- * @param initialValues The field initial values. Must not be <code>null</code>.
- * @param usedNames The list of used names. Must not be <code>null</code>.
- */
- public NameValuePairDialog(Shell shell, String dialogTitle, String title, String message, String[] fieldLabels, String[] initialValues, Set<String> usedNames) {
- super(shell, IContextHelpIds.NAME_VALUE_PAIR_DIALOG);
-
- Assert.isNotNull(dialogTitle);
- Assert.isNotNull(title);
- Assert.isNotNull(message);
- Assert.isNotNull(fieldLabels);
- Assert.isNotNull(initialValues);
- Assert.isNotNull(usedNames);
-
- this.dialogTitle = dialogTitle;
- this.title = title;
- this.message = message;
- this.fieldLabels = fieldLabels != null ? Arrays.copyOf(fieldLabels, fieldLabels.length) : null;
- this.initialValues = initialValues != null ? Arrays.copyOf(initialValues, initialValues.length) : null;
- this.usedNames = usedNames;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite top = (Composite)super.createDialogArea(parent);
-
- setDialogTitle(dialogTitle);
- setTitle(title);
- setDefaultMessage(message, IMessageProvider.NONE);
-
- Composite panel = new Composite(top, SWT.NONE);
- panel.setLayout(new GridLayout(2, false));
- panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
- Label label = new Label(panel, SWT.NONE);
- label.setText(fieldLabels[0]);
-
- nameText = new Text(panel, SWT.BORDER | SWT.SINGLE);
- nameText.setText(initialValues[0]);
- GridData layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- layoutData.widthHint = 300;
- nameText.setLayoutData(layoutData);
- nameText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- updateButtons();
- }
- });
-
- label = new Label(panel, SWT.NONE);
- label.setText(fieldLabels[1]);
-
- valueText = new Text(panel, SWT.BORDER | SWT.SINGLE);
- valueText.setText(initialValues[1]);
- layoutData = new GridData(GridData.FILL_HORIZONTAL);
- layoutData.widthHint = 300;
- valueText.setLayoutData(layoutData);
- valueText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- updateButtons();
- }
- });
-
- applyDialogFont(panel);
- return panel;
- }
-
- /**
- * Return the name/value pair entered in this dialog.
- * <p>
- * If the cancel button was hit, both will be <code>null</code>.
- */
- public String[] getNameValuePair() {
- return new String[] { name, value };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#create()
- */
- @Override
- public void create() {
- super.create();
- updateButtons();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
- */
- @Override
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- name= SWTControlUtil.getText(nameText).trim();
- value = SWTControlUtil.getText(valueText).trim();
- } else {
- name = null;
- value = null;
- }
- super.buttonPressed(buttonId);
- }
-
- /**
- * Enable the OK button if valid input
- */
- protected void updateButtons() {
- String name = SWTControlUtil.getText(nameText).trim();
- String value = SWTControlUtil.getText(valueText).trim();
-
- if (name.trim().length() == 0) {
- setMessage(getErrorMissingName(), IMessageProvider.INFORMATION);
- }
- else if (usedNames.contains(name.trim())) {
- setMessage(NLS.bind(getErrorUsedOrIllegalName(), name), IMessageProvider.ERROR);
- }
- else if (value.trim().length() == 0) {
- setMessage(NLS.bind(getErrorMissingValue(), name), IMessageProvider.INFORMATION);
- }
- else {
- setMessage(message, IMessageProvider.NONE);
- }
- getButton(IDialogConstants.OK_ID).setEnabled(getMessageType() == IMessageProvider.NONE);
- }
-
- /**
- * Returns the text to show as missing name error.
- */
- protected String getErrorMissingName() {
- return Messages.NameValuePairDialog_missingName_error;
- }
-
- /**
- * Returns the text to show as used or illegal name error.
- */
- protected String getErrorUsedOrIllegalName() {
- return Messages.NameValuePairDialog_usedOrIllegalName_error;
- }
-
- /**
- * Returns the text to show as missing value error.
- */
- protected String getErrorMissingValue() {
- return Messages.NameValuePairDialog_missingValue_error;
- }
-}
+/*******************************************************************************
+ * 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.ui.dialogs;
+
+import java.util.Arrays;
+import java.util.Set;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.tcf.te.ui.help.IContextHelpIds;
+import org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog;
+import org.eclipse.tcf.te.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
+
+/**
+ * Dialog implementation allowing to enter the data for name/value pairs.
+ */
+public class NameValuePairDialog extends CustomTitleAreaDialog {
+
+ private String name;
+ private String value;
+
+ private String dialogTitle;
+ private String title;
+ private String message;
+ private String[] fieldLabels;
+ private String[] initialValues;
+ private Set<String> usedNames;
+
+ private Text nameText;
+ private Text valueText;
+
+ /**
+ * Constructor.
+ *
+ * @param shell The parent shell or <code>null</code>.
+ * @param dialogTitle The dialog title. Must not be <code>null</code>.
+ * @param title The title. Must not be <code>null</code>.
+ * @param message The dialogs default message. Must not be <code>null</code>.
+ * @param fieldLabels The field labels. Must not be <code>null</code>.
+ * @param initialValues The field initial values. Must not be <code>null</code>.
+ * @param usedNames The list of used names. Must not be <code>null</code>.
+ */
+ public NameValuePairDialog(Shell shell, String dialogTitle, String title, String message, String[] fieldLabels, String[] initialValues, Set<String> usedNames) {
+ super(shell, IContextHelpIds.NAME_VALUE_PAIR_DIALOG);
+
+ Assert.isNotNull(dialogTitle);
+ Assert.isNotNull(title);
+ Assert.isNotNull(message);
+ Assert.isNotNull(fieldLabels);
+ Assert.isNotNull(initialValues);
+ Assert.isNotNull(usedNames);
+
+ this.dialogTitle = dialogTitle;
+ this.title = title;
+ this.message = message;
+ this.fieldLabels = fieldLabels != null ? Arrays.copyOf(fieldLabels, fieldLabels.length) : null;
+ this.initialValues = initialValues != null ? Arrays.copyOf(initialValues, initialValues.length) : null;
+ this.usedNames = usedNames;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite top = (Composite)super.createDialogArea(parent);
+
+ setDialogTitle(dialogTitle);
+ setTitle(title);
+ setDefaultMessage(message, IMessageProvider.NONE);
+
+ Composite panel = new Composite(top, SWT.NONE);
+ panel.setLayout(new GridLayout(2, false));
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label label = new Label(panel, SWT.NONE);
+ label.setText(fieldLabels[0]);
+
+ nameText = new Text(panel, SWT.BORDER | SWT.SINGLE);
+ nameText.setText(initialValues[0]);
+ GridData layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.widthHint = 300;
+ nameText.setLayoutData(layoutData);
+ nameText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ updateButtons();
+ }
+ });
+
+ label = new Label(panel, SWT.NONE);
+ label.setText(fieldLabels[1]);
+
+ valueText = new Text(panel, SWT.BORDER | SWT.SINGLE);
+ valueText.setText(initialValues[1]);
+ layoutData = new GridData(GridData.FILL_HORIZONTAL);
+ layoutData.widthHint = 300;
+ valueText.setLayoutData(layoutData);
+ valueText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ updateButtons();
+ }
+ });
+
+ applyDialogFont(panel);
+ return panel;
+ }
+
+ /**
+ * Return the name/value pair entered in this dialog.
+ * <p>
+ * If the cancel button was hit, both will be <code>null</code>.
+ */
+ public String[] getNameValuePair() {
+ return new String[] { name, value };
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#create()
+ */
+ @Override
+ public void create() {
+ super.create();
+ updateButtons();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
+ */
+ @Override
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == IDialogConstants.OK_ID) {
+ name= SWTControlUtil.getText(nameText).trim();
+ value = SWTControlUtil.getText(valueText).trim();
+ } else {
+ name = null;
+ value = null;
+ }
+ super.buttonPressed(buttonId);
+ }
+
+ /**
+ * Enable the OK button if valid input
+ */
+ protected void updateButtons() {
+ String name = SWTControlUtil.getText(nameText).trim();
+ String value = SWTControlUtil.getText(valueText).trim();
+
+ if (name.trim().length() == 0) {
+ setMessage(getErrorMissingName(), IMessageProvider.INFORMATION);
+ }
+ else if (usedNames.contains(name.trim())) {
+ setMessage(NLS.bind(getErrorUsedOrIllegalName(), name), IMessageProvider.ERROR);
+ }
+ else if (value.trim().length() == 0) {
+ setMessage(NLS.bind(getErrorMissingValue(), name), IMessageProvider.INFORMATION);
+ }
+ else {
+ setMessage(message, IMessageProvider.NONE);
+ }
+ getButton(IDialogConstants.OK_ID).setEnabled(getMessageType() == IMessageProvider.NONE);
+ }
+
+ /**
+ * Returns the text to show as missing name error.
+ */
+ protected String getErrorMissingName() {
+ return Messages.NameValuePairDialog_missingName_error;
+ }
+
+ /**
+ * Returns the text to show as used or illegal name error.
+ */
+ protected String getErrorUsedOrIllegalName() {
+ return Messages.NameValuePairDialog_usedOrIllegalName_error;
+ }
+
+ /**
+ * Returns the text to show as missing value error.
+ */
+ protected String getErrorMissingValue() {
+ return Messages.NameValuePairDialog_missingValue_error;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/IContextHelpIds.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/help/IContextHelpIds.java
index 33eb7e6fc..481d65ba9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/IContextHelpIds.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/help/IContextHelpIds.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.ui.interfaces;
+package org.eclipse.tcf.te.ui.help;
import org.eclipse.tcf.te.ui.activator.UIPlugin;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/IFilteringLabelDecorator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/IFilteringLabelDecorator.java
deleted file mode 100644
index f54423681..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/IFilteringLabelDecorator.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * 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.ui.interfaces;
-
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.TreeViewer;
-
-/**
- * The interface to define a label decorator which has a method
- * to check if the label decorator is enabled for specified viewer and
- * element.
- * <p>
- * An ordinary label decorator's enablement state is only checked upon the
- * cell element, which is an issue when the decoration depends on the
- * tree viewer's state besides the element. This interface is designed
- * to check the enablement state with both the tree viewer and the element
- * itself.
- * <p>
- * This interface is used in TreeControl and Target Explorer view to decorate
- * the tree node that are being filtered.
- *
- * @see TreeViewerDecoratingLabelProvider
- * @see ViewViewerDecoratingLabelProvider
- */
-public interface IFilteringLabelDecorator extends ILabelDecorator {
-
- /**
- * Check if this decorator is enabled to the specified viewer and
- * element.
- *
- * @param viewer The tree viewer
- * @param element The element
- * @return true if this decorator is enabled over this viewer and this element.
- */
- public boolean isEnabled(TreeViewer viewer, Object element);
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IDeleteHandlerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IDeleteHandlerDelegate.java
new file mode 100644
index 000000000..83fef66e8
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IDeleteHandlerDelegate.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 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.ui.interfaces.handler;
+
+import org.eclipse.jface.viewers.TreePath;
+
+/**
+ * A delete handler delegate supports the delegate handler determine
+ * if the delete operation can be executed and/or how the delete is executed.
+ */
+public interface IDeleteHandlerDelegate {
+
+ /**
+ * Returns if or if not the given tree path can be deleted in its current state.
+ * <p>
+ * The method is expected to return <code>true</code> if the passed in tree path
+ * cannot be analyzed by the handler.
+ *
+ * @param treePath The tree path. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the tree path is deletable, <code>false</code> otherwise.
+ */
+ public boolean canDelete(TreePath treePath);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.java
index 7e20aebce..e58c091c1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.java
@@ -1,36 +1,36 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.ui.wizards.newWizard;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.tcf.te.ui.interfaces.IContextHelpIds;
-import org.eclipse.tcf.te.ui.wizards.AbstractWizardCommandHandler;
-
-/**
- * &quot;org.eclipse.tcf.te.ui.command.newWizards" default command handler implementation.
- */
-public class NewWizardCommandHandler extends AbstractWizardCommandHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.wizards.AbstractWizardCommandHandler#createWizard()
- */
- @Override
- protected IWizard createWizard() {
- return new NewWizard();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.wizards.AbstractWizardCommandHandler#getHelpId()
- */
- @Override
- protected String getHelpId() {
- return IContextHelpIds.NEW_TARGET_WIZARD;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 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.ui.wizards.newWizard;
+
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.tcf.te.ui.help.IContextHelpIds;
+import org.eclipse.tcf.te.ui.wizards.AbstractWizardCommandHandler;
+
+/**
+ * &quot;org.eclipse.tcf.te.ui.command.newWizards" default command handler implementation.
+ */
+public class NewWizardCommandHandler extends AbstractWizardCommandHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.wizards.AbstractWizardCommandHandler#createWizard()
+ */
+ @Override
+ protected IWizard createWizard() {
+ return new NewWizard();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.wizards.AbstractWizardCommandHandler#getHelpId()
+ */
+ @Override
+ protected String getHelpId() {
+ return IContextHelpIds.NEW_TARGET_WIZARD;
+ }
+}

Back to the top