Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-05-03 06:59:23 +0000
committerTobias Schwarz2013-05-03 07:07:51 +0000
commit02bfa2eaed8ff5c875f871288f0a34eaeedf0412 (patch)
tree47acb217fd55da1fe69cd61a8e7bc7128a210d2c /target_explorer
parenteade832e0345596d9da905d22c400773dba2b13a (diff)
downloadorg.eclipse.tcf-02bfa2eaed8ff5c875f871288f0a34eaeedf0412.tar.gz
org.eclipse.tcf-02bfa2eaed8ff5c875f871288f0a34eaeedf0412.tar.xz
org.eclipse.tcf-02bfa2eaed8ff5c875f871288f0a34eaeedf0412.zip
Target Explorer: fix and extend DnD (duplicate, unlink, link)
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java1161
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java376
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java24
5 files changed, 899 insertions, 685 deletions
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 1f07cf1cb..5e7d83825 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
@@ -25,6 +25,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Shell;
@@ -135,9 +136,11 @@ public class DeleteHandler extends AbstractHandler {
canDelete = false;
break;
}
- else if (IUIConstants.ID_CAT_MY_TARGETS.equals(category.getId()) && isStartedByCurrentUser) {
- canDelete = false;
- break;
+ else if (IUIConstants.ID_CAT_MY_TARGETS.equals(category.getId())) {
+ if (isStartedByCurrentUser) {
+ canDelete = false;
+ break;
+ }
}
else if (!IUIConstants.ID_CAT_FAVORITES.equals(category.getId())) {
canDelete = false;
@@ -249,6 +252,7 @@ public class DeleteHandler extends AbstractHandler {
IURIPersistenceService service = ServiceManager.getInstance().getService(IURIPersistenceService.class);
if (service == null) throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
service.delete(node, null);
+ ViewsUtil.setSelection(IUIConstants.ID_EXPLORER, new StructuredSelection(parentCategory));
// Close the configuration editor if open
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
@@ -276,6 +280,7 @@ public class DeleteHandler extends AbstractHandler {
Assert.isNotNull(categorizable);
manager.remove(parentCategory.getId(), categorizable.getId());
+ ViewsUtil.setSelection(IUIConstants.ID_EXPLORER, new StructuredSelection(parentCategory));
}
}
}
@@ -397,8 +402,8 @@ public class DeleteHandler extends AbstractHandler {
op.type = Operation.TYPE.Remove;
} else {
op.type = Operation.TYPE.Unlink;
- op.parentCategory = category;
}
+ op.parentCategory = category;
operations.add(op);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java
index 8b33d9f9f..1a23410b1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java
@@ -1,581 +1,580 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2013 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.ui.navigator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.ITreePathContentProvider;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
-import org.eclipse.tcf.te.tcf.locator.ScannerRunnable;
-import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerRedirector;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshService;
-import org.eclipse.tcf.te.tcf.locator.model.Model;
-import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
-import org.eclipse.tcf.te.tcf.ui.internal.preferences.IPreferenceKeys;
-import org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode;
-import org.eclipse.tcf.te.ui.swt.DisplayUtil;
-import org.eclipse.tcf.te.ui.views.Managers;
-import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.interfaces.IRoot;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategorizable;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.internal.navigator.NavigatorFilterService;
-import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-import org.eclipse.ui.navigator.ICommonFilterDescriptor;
-import org.eclipse.ui.navigator.INavigatorContentService;
-import org.eclipse.ui.navigator.INavigatorFilterService;
-
-
-/**
- * Content provider delegate implementation.
- */
-@SuppressWarnings("restriction")
-public class ContentProviderDelegate implements ICommonContentProvider, ITreePathContentProvider {
- private final static Object[] NO_ELEMENTS = new Object[0];
-
- // The "Redirected Peers" filter id
- private final static String REDIRECT_PEERS_FILTER_ID = "org.eclipse.tcf.te.tcf.ui.navigator.RedirectPeersFilter"; //$NON-NLS-1$
- // The current user filter id
- private final static String CURRENT_USER_FILTER_ID = "org.eclipse.tcf.te.tcf.ui.navigator.PeersByCurrentUserFilter"; //$NON-NLS-1$
-
-
- // The locator model listener instance
- /* default */ IModelListener modelListener = null;
- // The tree view listener instance
- /* default */ TreeViewerListener treeViewerListener = null;
-
- // Internal map of PeerRedirectorGroupNodes per peer id
- private final Map<String, PeerRedirectorGroupNode> roots = new HashMap<String, PeerRedirectorGroupNode>();
-
- // Flag to remember if invisible nodes are to be included in the list of
- // returned children.
- private final boolean showInvisible;
-
- INavigatorFilterService navFilterService = null;
-
- /**
- * Constructor.
- */
- public ContentProviderDelegate() {
- this(false);
- }
-
- /**
- * Constructor.
- *
- * @param showInvisible If <code>true</code>, {@link #getChildren(Object)} will include invisible nodes too.
- */
- public ContentProviderDelegate(boolean showInvisible) {
- super();
- this.showInvisible = showInvisible;
- }
-
- /**
- * Determines if the given peer model node is a value-add.
- *
- * @param peerModel The peer model node. Must not be <code>null</code>.
- * @return <code>True</code> if the peer model node is a value-add, <code>false</code> otherwise.
- */
- /* default */ final boolean isValueAdd(IPeerModel peerModel) {
- Assert.isNotNull(peerModel);
-
- String value = peerModel.getPeer().getAttributes().get("ValueAdd"); //$NON-NLS-1$
- boolean isValueAdd = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$
-
- return isValueAdd;
- }
-
- /**
- * Determines if the given peer model node is filtered from the view completely.
- *
- * @param peerModel The peer model node. Must not be <code>null</code>.
- * @return <code>True</code> if filtered, <code>false</code> otherwise.
- */
- /* default */ final boolean isFiltered(IPeerModel peerModel) {
- Assert.isNotNull(peerModel);
-
- boolean filtered = false;
-
- filtered |= isValueAdd(peerModel) && UIPlugin.getDefault().getPreferenceStore().getBoolean(IPreferenceKeys.PREF_HIDE_VALUEADDS);
- if (!showInvisible) {
- filtered |= !peerModel.isVisible();
- }
-
- return filtered;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- @Override
- public Object[] getChildren(Object parentElement) {
- Object[] children = NO_ELEMENTS;
-
- // The category element if the parent element is a category node
- final ICategory category = parentElement instanceof ICategory ? (ICategory)parentElement : null;
- // The category id if the parent element is a category node
- final String catID = category != null ? category.getId() : null;
-
- // Determine if both the "My Targets" and "Neighborhood" categories are hidden
- boolean allHidden = false;
-
- ICategory myTargetsCat = CategoriesExtensionPointManager.getInstance().getCategory(IUIConstants.ID_CAT_MY_TARGETS, false);
- ICategory neighborhoodCat = CategoriesExtensionPointManager.getInstance().getCategory(IUIConstants.ID_CAT_NEIGHBORHOOD, false);
-
- allHidden = neighborhoodCat != null && !neighborhoodCat.isEnabled() && myTargetsCat != null && !myTargetsCat.isEnabled();
-
- // If the parent element is a category, than we assume
- // the locator model as parent element.
- if (parentElement instanceof ICategory) {
- parentElement = Model.getModel();
- }
- // If the parent element is the root element and "all"
- // categories are hidden, assume the locator model as parent element
- if (parentElement instanceof IRoot && allHidden) {
- parentElement = Model.getModel();
- }
-
- // If it is the locator model, get the peers
- if (parentElement instanceof ILocatorModel) {
- final ILocatorModel model = (ILocatorModel)parentElement;
- final IPeerModel[] peers = model.getPeers();
- final List<IPeerModel> candidates = new ArrayList<IPeerModel>();
-
- if (IUIConstants.ID_CAT_FAVORITES.equals(catID)) {
- for (IPeerModel peer : peers) {
- ICategorizable categorizable = (ICategorizable)peer.getAdapter(ICategorizable.class);
- if (categorizable == null) {
- categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(peer, ICategorizable.class);
- }
- Assert.isNotNull(categorizable);
-
- boolean isFavorite = Managers.getCategoryManager().belongsTo(catID, categorizable.getId());
- if (isFavorite && !candidates.contains(peer)) {
- candidates.add(peer);
- }
- }
- }
- else if (IUIConstants.ID_CAT_MY_TARGETS.equals(catID)) {
- for (IPeerModel peer : peers) {
- // Check for filtered nodes (Value-add's and Proxies)
- if (isFiltered(peer)) {
- continue;
- }
-
- ICategorizable categorizable = (ICategorizable)peer.getAdapter(ICategorizable.class);
- if (categorizable == null) {
- categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(peer, ICategorizable.class);
- }
- Assert.isNotNull(categorizable);
-
- boolean isStatic = peer.isStatic();
-
- // Static peers, or if launched by current user -> add automatically to "My Targets"
- boolean startedByCurrentUser = System.getProperty("user.name").equals(peer.getPeer().getUserName()); //$NON-NLS-1$
- if (!startedByCurrentUser) {
- // If the "Neighborhood" category is not visible, ignore the startedByCurrentUser flag
- if (neighborhoodCat != null && !neighborhoodCat.isEnabled()) {
- startedByCurrentUser = true;
- }
- }
-
- boolean isMyTargets = Managers.getCategoryManager().belongsTo(catID, categorizable.getId());
- if (!isMyTargets && (isStatic || startedByCurrentUser)) {
- // "Value-add's" are not saved to the category persistence automatically
- if (isValueAdd(peer)) {
- Managers.getCategoryManager().addTransient(catID, categorizable.getId());
- } else {
- Managers.getCategoryManager().add(catID, categorizable.getId());
- }
- isMyTargets = true;
- }
-
- if (isMyTargets && !candidates.contains(peer)) {
- candidates.add(peer);
- }
- }
- }
- else if (IUIConstants.ID_CAT_NEIGHBORHOOD.equals(catID)) {
- for (IPeerModel peer : peers) {
- // Check for filtered nodes (Value-add's and Proxies)
- if (isFiltered(peer)) {
- continue;
- }
-
- ICategorizable categorizable = (ICategorizable)peer.getAdapter(ICategorizable.class);
- if (categorizable == null) {
- categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(peer, ICategorizable.class);
- }
- Assert.isNotNull(categorizable);
-
- boolean isStatic = peer.isStatic();
-
- boolean startedByCurrentUser = System.getProperty("user.name").equals(peer.getPeer().getUserName()); //$NON-NLS-1$
- if (startedByCurrentUser) {
- // If the "My Targets" category is not visible, ignore the startedByCurrentUser flag
- if (myTargetsCat != null && !myTargetsCat.isEnabled()) {
- startedByCurrentUser = false;
- }
- }
-
- boolean isNeighborhood = Managers.getCategoryManager().belongsTo(catID, categorizable.getId());
- if (!isNeighborhood && !isStatic && !startedByCurrentUser) {
- // "Neighborhood" is always transient
- Managers.getCategoryManager().addTransient(catID, categorizable.getId());
- isNeighborhood = true;
- }
-
- if (isNeighborhood && !candidates.contains(peer)) {
- candidates.add(peer);
- }
- }
- }
- else if (catID != null) {
- for (IPeerModel peer : peers) {
- ICategorizable categorizable = (ICategorizable)peer.getAdapter(ICategorizable.class);
- if (categorizable == null) {
- categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(peer, ICategorizable.class);
- }
- Assert.isNotNull(categorizable);
-
- boolean belongsTo = category.belongsTo(peer);
- if (belongsTo) {
- candidates.add(peer);
- }
- }
- }
- else {
- for (IPeerModel peer : peers) {
- // Check for filtered nodes (Value-add's and Proxies)
- if (isFiltered(peer)) {
- continue;
- }
- candidates.add(peer);
- }
- }
-
- children = candidates.toArray(new IPeerModel[candidates.size()]);
- }
- // If it is a peer model itself, get the child peers
- else if (parentElement instanceof IPeerModel) {
- String parentPeerId = ((IPeerModel)parentElement).getPeerId();
- List<IPeerModel> candidates = Model.getModel().getChildren(parentPeerId);
- if (candidates != null && candidates.size() > 0) {
- PeerRedirectorGroupNode rootNode = roots.get(parentPeerId);
- if (rootNode == null) {
- rootNode = new PeerRedirectorGroupNode(parentPeerId);
- roots.put(parentPeerId, rootNode);
- }
- children = new Object[] { rootNode };
- } else {
- roots.remove(parentPeerId);
- }
- }
- // If it is a remote peer discover root node, return the children
- // for the associated peer id.
- else if (parentElement instanceof PeerRedirectorGroupNode) {
- List<IPeerModel> candidates = Model.getModel().getChildren(((PeerRedirectorGroupNode)parentElement).peerId);
- if (candidates != null && candidates.size() > 0) {
- // Mark all candidates to be included in the scan process and
- // schedule an scan asynchronously
- for (final IPeerModel candidate: candidates) {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- candidate.setProperty(IPeerModelProperties.PROP_SCANNER_EXCLUDE, false);
-
- ScannerRunnable runnable = new ScannerRunnable(null, candidate);
- runnable.run();
- }
- });
- }
-
- children = candidates.toArray();
- }
- }
-
- return children;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreePathContentProvider#getChildren(org.eclipse.jface.viewers.TreePath)
- */
- @Override
- public Object[] getChildren(TreePath parentPath) {
- // getChildren is independent of the elements tree path
- return parentPath != null ? getChildren(parentPath.getLastSegment()) : NO_ELEMENTS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- @Override
- public Object getParent(final Object element) {
- // If it is a peer model node, return the parent locator model
- if (element instanceof IPeerModel) {
- // If it is a peer redirector, return the parent remote peer discover root node
- if (((IPeerModel)element).getPeer() instanceof IPeerRedirector) {
- IPeer parentPeer = ((IPeerRedirector)((IPeerModel)element).getPeer()).getParent();
- String parentPeerId = parentPeer.getID();
- if (!roots.containsKey(parentPeerId)) {
- roots.put(parentPeer.getID(), new PeerRedirectorGroupNode(parentPeerId));
- }
- return roots.get(parentPeerId);
- }
-
- // Determine the parent category node
- ICategory category = null;
- String[] categoryIds = Managers.getCategoryManager().getCategoryIds(((IPeerModel)element).getPeerId());
- // If we have more than one, take the first one as parent category.
- // To get all parents, the getParents(Object) method must be called
- if (categoryIds != null && categoryIds.length > 0) {
- category = CategoriesExtensionPointManager.getInstance().getCategory(categoryIds[0], false);
- }
-
- return category != null ? category : ((IPeerModel)element).getModel();
- } else if (element instanceof PeerRedirectorGroupNode) {
- // Return the parent peer model node
- final AtomicReference<IPeerModel> parent = new AtomicReference<IPeerModel>();
- final Runnable runnable = new Runnable() {
- @Override
- public void run() {
- parent.set(Model.getModel().getService(ILocatorModelLookupService.class).lkupPeerModelById(((PeerRedirectorGroupNode)element).peerId));
- }
- };
-
- Assert.isTrue(!Protocol.isDispatchThread());
-
- // The caller thread is very likely the display thread. We have to us a little
- // trick here to avoid blocking the display thread via a wait on a monitor as
- // this can (and has) lead to dead-locks with the TCF event dispatch thread if
- // something fatal (OutOfMemoryError in example) happens in-between.
- ExecutorsUtil.executeWait(new Runnable() {
- @Override
- public void run() {
- Protocol.invokeAndWait(runnable);
- }
- });
-
- return parent.get();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreePathContentProvider#getParents(java.lang.Object)
- */
- @Override
- public TreePath[] getParents(Object element) {
- // Not sure if we ever have to calculate the _full_ tree path. The parent NavigatorContentServiceContentProvider
- // is consuming only the last segment.
- List<TreePath> pathes = new ArrayList<TreePath>();
-
- if (element instanceof IPeerModel) {
- if (Managers.getCategoryManager().belongsTo(IUIConstants.ID_CAT_FAVORITES, ((IPeerModel)element).getPeerId())) {
- // Get the "Favorites" category
- ICategory favCategory = CategoriesExtensionPointManager.getInstance().getCategory(IUIConstants.ID_CAT_FAVORITES, false);
- if (favCategory != null) {
- pathes.add(new TreePath(new Object[] { favCategory }));
- }
- }
-
- // Determine the default parent
- Object parent = getParent(element);
- if (parent != null) {
- pathes.add(new TreePath(new Object[] { parent }));
- }
- }
-
- return pathes.toArray(new TreePath[pathes.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- @Override
- public boolean hasChildren(Object element) {
- Object[] children = getChildren(element);
-
- if (children != null && children.length > 0 && navFilterService != null) {
- for (ViewerFilter filter : navFilterService.getVisibleFilters(true)) {
- children = filter.filter(null, element, children);
- }
- }
-
- return children != null && children.length > 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreePathContentProvider#hasChildren(org.eclipse.jface.viewers.TreePath)
- */
- @Override
- public boolean hasChildren(TreePath path) {
- // hasChildren is independent of the elements tree path
- return path != null ? hasChildren(path.getLastSegment()) : false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- @Override
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- @Override
- public void dispose() {
- if (modelListener != null) {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- Model.getModel().removeListener(modelListener);
- }
- };
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
- modelListener = null;
- }
-
- if (treeViewerListener != null) {
- treeViewerListener.dispose();
- treeViewerListener = null;
- }
-
- roots.clear();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public void inputChanged(final Viewer viewer, Object oldInput, Object newInput) {
- final ILocatorModel model = Model.getModel();
-
- // Create and attach the model listener if not yet done
- if (modelListener == null && model != null && viewer instanceof CommonViewer) {
- modelListener = new ModelListener(model, (CommonViewer)viewer);
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- model.addListener(modelListener);
- }
- });
- }
-
- // Create and attach the tree listener if not yet done
- if (treeViewerListener == null && viewer instanceof CommonViewer) {
- CommonViewer v = (CommonViewer)viewer;
- treeViewerListener = new TreeViewerListener(v);
- v.addTreeListener(treeViewerListener);
- }
-
- if (model != null && newInput instanceof IRoot) {
- // Refresh the model asynchronously
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- model.getService(ILocatorModelRefreshService.class).refresh(null);
- }
- });
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.ICommonContentProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite)
- */
- @Override
- public void init(ICommonContentExtensionSite config) {
- Assert.isNotNull(config);
-
- // Make sure that the hidden "Redirected Peers" filter is active
- INavigatorContentService cs = config.getService();
- navFilterService = cs != null ? cs.getFilterService() : null;
- if (navFilterService instanceof NavigatorFilterService) {
- final NavigatorFilterService filterService = (NavigatorFilterService)navFilterService;
- boolean activeFiltersChanged = false;
-
- // Reconstruct the list of active filters based on the visible filter descriptors
- List<String> activeFilderIds = new ArrayList<String>();
-
- ICommonFilterDescriptor[] descriptors = filterService.getVisibleFilterDescriptors();
- for (ICommonFilterDescriptor descriptor : descriptors) {
- if (descriptor.getId() != null && !"".equals(descriptor.getId()) && filterService.isActive(descriptor.getId())) { //$NON-NLS-1$
- activeFilderIds.add(descriptor.getId());
- }
- }
-
- if (!activeFilderIds.contains(REDIRECT_PEERS_FILTER_ID)) {
- activeFilderIds.add(REDIRECT_PEERS_FILTER_ID);
- activeFiltersChanged = true;
- }
-
- if (UIPlugin.getDefault().getPreferenceStore().getBoolean(IPreferenceKeys.PREF_ACTIVATE_CURRENT_USER_FILTER)
- && !navFilterService.isActive(CURRENT_USER_FILTER_ID)) {
- IDialogSettings settings = UIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(this.getClass().getSimpleName());
- if (section == null) section = settings.addNewSection(this.getClass().getSimpleName());
- if (!section.getBoolean(IPreferenceKeys.PREF_ACTIVATE_CURRENT_USER_FILTER + ".done")) { //$NON-NLS-1$
- activeFilderIds.add(CURRENT_USER_FILTER_ID);
- activeFiltersChanged = true;
- section.put(IPreferenceKeys.PREF_ACTIVATE_CURRENT_USER_FILTER + ".done", true); //$NON-NLS-1$
- }
- }
-
- if (activeFiltersChanged) {
- final String[] finActiveFilterIds = activeFilderIds.toArray(new String[activeFilderIds.size()]);
- // Do the update view asynchronous to avoid reentrant viewer calls
- DisplayUtil.safeAsyncExec(new Runnable() {
- @Override
- public void run() {
- filterService.activateFilterIdsAndUpdateViewer(finActiveFilterIds);
- }
- });
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento)
- */
- @Override
- public void restoreState(IMemento aMemento) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento aMemento) {
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 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.ui.navigator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ITreePathContentProvider;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
+import org.eclipse.tcf.te.tcf.locator.ScannerRunnable;
+import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerRedirector;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshService;
+import org.eclipse.tcf.te.tcf.locator.model.Model;
+import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
+import org.eclipse.tcf.te.tcf.ui.internal.preferences.IPreferenceKeys;
+import org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode;
+import org.eclipse.tcf.te.ui.swt.DisplayUtil;
+import org.eclipse.tcf.te.ui.views.Managers;
+import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+import org.eclipse.tcf.te.ui.views.interfaces.IRoot;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategorizable;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.internal.navigator.NavigatorFilterService;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonContentExtensionSite;
+import org.eclipse.ui.navigator.ICommonContentProvider;
+import org.eclipse.ui.navigator.ICommonFilterDescriptor;
+import org.eclipse.ui.navigator.INavigatorContentService;
+import org.eclipse.ui.navigator.INavigatorFilterService;
+
+
+/**
+ * Content provider delegate implementation.
+ */
+@SuppressWarnings("restriction")
+public class ContentProviderDelegate implements ICommonContentProvider, ITreePathContentProvider {
+ private final static Object[] NO_ELEMENTS = new Object[0];
+
+ // The "Redirected Peers" filter id
+ private final static String REDIRECT_PEERS_FILTER_ID = "org.eclipse.tcf.te.tcf.ui.navigator.RedirectPeersFilter"; //$NON-NLS-1$
+ // The current user filter id
+ private final static String CURRENT_USER_FILTER_ID = "org.eclipse.tcf.te.tcf.ui.navigator.PeersByCurrentUserFilter"; //$NON-NLS-1$
+
+
+ // The locator model listener instance
+ /* default */ IModelListener modelListener = null;
+ // The tree view listener instance
+ /* default */ TreeViewerListener treeViewerListener = null;
+
+ // Internal map of PeerRedirectorGroupNodes per peer id
+ private final Map<String, PeerRedirectorGroupNode> roots = new HashMap<String, PeerRedirectorGroupNode>();
+
+ // Flag to remember if invisible nodes are to be included in the list of
+ // returned children.
+ private final boolean showInvisible;
+
+ INavigatorFilterService navFilterService = null;
+
+ /**
+ * Constructor.
+ */
+ public ContentProviderDelegate() {
+ this(false);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param showInvisible If <code>true</code>, {@link #getChildren(Object)} will include invisible nodes too.
+ */
+ public ContentProviderDelegate(boolean showInvisible) {
+ super();
+ this.showInvisible = showInvisible;
+ }
+
+ /**
+ * Determines if the given peer model node is a value-add.
+ *
+ * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @return <code>True</code> if the peer model node is a value-add, <code>false</code> otherwise.
+ */
+ /* default */ final boolean isValueAdd(IPeerModel peerModel) {
+ Assert.isNotNull(peerModel);
+
+ String value = peerModel.getPeer().getAttributes().get("ValueAdd"); //$NON-NLS-1$
+ boolean isValueAdd = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$
+
+ return isValueAdd;
+ }
+
+ /**
+ * Determines if the given peer model node is filtered from the view completely.
+ *
+ * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @return <code>True</code> if filtered, <code>false</code> otherwise.
+ */
+ /* default */ final boolean isFiltered(IPeerModel peerModel) {
+ Assert.isNotNull(peerModel);
+
+ boolean filtered = false;
+
+ filtered |= isValueAdd(peerModel) && UIPlugin.getDefault().getPreferenceStore().getBoolean(IPreferenceKeys.PREF_HIDE_VALUEADDS);
+ if (!showInvisible) {
+ filtered |= !peerModel.isVisible();
+ }
+
+ return filtered;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ Object[] children = NO_ELEMENTS;
+
+ // The category element if the parent element is a category node
+ final ICategory category = parentElement instanceof ICategory ? (ICategory)parentElement : null;
+ // The category id if the parent element is a category node
+ final String catID = category != null ? category.getId() : null;
+
+ // Determine if both the "My Targets" and "Neighborhood" categories are hidden
+ boolean allHidden = false;
+
+ ICategory myTargetsCat = CategoriesExtensionPointManager.getInstance().getCategory(IUIConstants.ID_CAT_MY_TARGETS, false);
+ ICategory neighborhoodCat = CategoriesExtensionPointManager.getInstance().getCategory(IUIConstants.ID_CAT_NEIGHBORHOOD, false);
+
+ allHidden = neighborhoodCat != null && !neighborhoodCat.isEnabled() && myTargetsCat != null && !myTargetsCat.isEnabled();
+
+ // If the parent element is a category, than we assume
+ // the locator model as parent element.
+ if (parentElement instanceof ICategory) {
+ parentElement = Model.getModel();
+ }
+ // If the parent element is the root element and "all"
+ // categories are hidden, assume the locator model as parent element
+ if (parentElement instanceof IRoot && allHidden) {
+ parentElement = Model.getModel();
+ }
+
+ // If it is the locator model, get the peers
+ if (parentElement instanceof ILocatorModel) {
+ final ILocatorModel model = (ILocatorModel)parentElement;
+ final IPeerModel[] peers = model.getPeers();
+ final List<IPeerModel> candidates = new ArrayList<IPeerModel>();
+
+ if (IUIConstants.ID_CAT_FAVORITES.equals(catID)) {
+ for (IPeerModel peer : peers) {
+ ICategorizable categorizable = (ICategorizable)peer.getAdapter(ICategorizable.class);
+ if (categorizable == null) {
+ categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(peer, ICategorizable.class);
+ }
+ Assert.isNotNull(categorizable);
+
+ boolean isFavorite = Managers.getCategoryManager().belongsTo(catID, categorizable.getId());
+ if (isFavorite && !candidates.contains(peer)) {
+ candidates.add(peer);
+ }
+ }
+ }
+ else if (IUIConstants.ID_CAT_MY_TARGETS.equals(catID)) {
+ for (IPeerModel peer : peers) {
+ // Check for filtered nodes (Value-add's and Proxies)
+ if (isFiltered(peer)) {
+ continue;
+ }
+
+ ICategorizable categorizable = (ICategorizable)peer.getAdapter(ICategorizable.class);
+ if (categorizable == null) {
+ categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(peer, ICategorizable.class);
+ }
+ Assert.isNotNull(categorizable);
+
+ boolean isStatic = peer.isStatic();
+
+ // Static peers, or if launched by current user -> add automatically to "My Targets"
+ boolean startedByCurrentUser = System.getProperty("user.name").equals(peer.getPeer().getUserName()); //$NON-NLS-1$
+ if (!startedByCurrentUser) {
+ // If the "Neighborhood" category is not visible, ignore the startedByCurrentUser flag
+ if (neighborhoodCat != null && !neighborhoodCat.isEnabled()) {
+ startedByCurrentUser = true;
+ }
+ }
+
+ boolean isMyTargets = Managers.getCategoryManager().belongsTo(catID, categorizable.getId());
+ if (!isMyTargets && (isStatic || startedByCurrentUser)) {
+ // "Value-add's" are not saved to the category persistence automatically
+ Managers.getCategoryManager().addTransient(catID, categorizable.getId());
+ isMyTargets = true;
+ }
+
+ if (isMyTargets && !candidates.contains(peer)) {
+ candidates.add(peer);
+ }
+ }
+ }
+ else if (IUIConstants.ID_CAT_NEIGHBORHOOD.equals(catID)) {
+ for (IPeerModel peer : peers) {
+ // Check for filtered nodes (Value-add's and Proxies)
+ if (isFiltered(peer)) {
+ continue;
+ }
+
+ ICategorizable categorizable = (ICategorizable)peer.getAdapter(ICategorizable.class);
+ if (categorizable == null) {
+ categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(peer, ICategorizable.class);
+ }
+ Assert.isNotNull(categorizable);
+
+ boolean isStatic = peer.isStatic();
+
+ boolean startedByCurrentUser = System.getProperty("user.name").equals(peer.getPeer().getUserName()); //$NON-NLS-1$
+ if (startedByCurrentUser) {
+ // If the "My Targets" category is not visible, ignore the startedByCurrentUser flag
+ if (myTargetsCat != null && !myTargetsCat.isEnabled()) {
+ startedByCurrentUser = false;
+ }
+ }
+
+ boolean isNeighborhood = Managers.getCategoryManager().belongsTo(catID, categorizable.getId());
+ if (!isNeighborhood && !isStatic && !startedByCurrentUser) {
+ // "Neighborhood" is always transient
+ Managers.getCategoryManager().addTransient(catID, categorizable.getId());
+ isNeighborhood = true;
+ }
+
+ if (isNeighborhood && !candidates.contains(peer)) {
+ candidates.add(peer);
+ }
+ }
+ }
+ else if (catID != null) {
+ for (IPeerModel peer : peers) {
+ ICategorizable categorizable = (ICategorizable)peer.getAdapter(ICategorizable.class);
+ if (categorizable == null) {
+ categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(peer, ICategorizable.class);
+ }
+ Assert.isNotNull(categorizable);
+
+ boolean belongsTo = category.belongsTo(peer);
+ if (belongsTo && !candidates.contains(peer)) {
+ Managers.getCategoryManager().addTransient(catID, categorizable.getId());
+ candidates.add(peer);
+ }
+ }
+ }
+ else {
+ for (IPeerModel peer : peers) {
+ // Check for filtered nodes (Value-add's and Proxies)
+ if (isFiltered(peer)) {
+ continue;
+ }
+ if (!candidates.contains(peer)) {
+ candidates.add(peer);
+ }
+ }
+ }
+
+ children = candidates.toArray(new IPeerModel[candidates.size()]);
+ }
+ // If it is a peer model itself, get the child peers
+ else if (parentElement instanceof IPeerModel) {
+ String parentPeerId = ((IPeerModel)parentElement).getPeerId();
+ List<IPeerModel> candidates = Model.getModel().getChildren(parentPeerId);
+ if (candidates != null && candidates.size() > 0) {
+ PeerRedirectorGroupNode rootNode = roots.get(parentPeerId);
+ if (rootNode == null) {
+ rootNode = new PeerRedirectorGroupNode(parentPeerId);
+ roots.put(parentPeerId, rootNode);
+ }
+ children = new Object[] { rootNode };
+ } else {
+ roots.remove(parentPeerId);
+ }
+ }
+ // If it is a remote peer discover root node, return the children
+ // for the associated peer id.
+ else if (parentElement instanceof PeerRedirectorGroupNode) {
+ List<IPeerModel> candidates = Model.getModel().getChildren(((PeerRedirectorGroupNode)parentElement).peerId);
+ if (candidates != null && candidates.size() > 0) {
+ // Mark all candidates to be included in the scan process and
+ // schedule an scan asynchronously
+ for (final IPeerModel candidate: candidates) {
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ candidate.setProperty(IPeerModelProperties.PROP_SCANNER_EXCLUDE, false);
+
+ ScannerRunnable runnable = new ScannerRunnable(null, candidate);
+ runnable.run();
+ }
+ });
+ }
+
+ children = candidates.toArray();
+ }
+ }
+
+ return children;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreePathContentProvider#getChildren(org.eclipse.jface.viewers.TreePath)
+ */
+ @Override
+ public Object[] getChildren(TreePath parentPath) {
+ // getChildren is independent of the elements tree path
+ return parentPath != null ? getChildren(parentPath.getLastSegment()) : NO_ELEMENTS;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+ @Override
+ public Object getParent(final Object element) {
+ // If it is a peer model node, return the parent locator model
+ if (element instanceof IPeerModel) {
+ // If it is a peer redirector, return the parent remote peer discover root node
+ if (((IPeerModel)element).getPeer() instanceof IPeerRedirector) {
+ IPeer parentPeer = ((IPeerRedirector)((IPeerModel)element).getPeer()).getParent();
+ String parentPeerId = parentPeer.getID();
+ if (!roots.containsKey(parentPeerId)) {
+ roots.put(parentPeer.getID(), new PeerRedirectorGroupNode(parentPeerId));
+ }
+ return roots.get(parentPeerId);
+ }
+
+ // Determine the parent category node
+ ICategory category = null;
+ String[] categoryIds = Managers.getCategoryManager().getCategoryIds(((IPeerModel)element).getPeerId());
+ // If we have more than one, take the first one as parent category.
+ // To get all parents, the getParents(Object) method must be called
+ if (categoryIds != null && categoryIds.length > 0) {
+ category = CategoriesExtensionPointManager.getInstance().getCategory(categoryIds[0], false);
+ }
+
+ return category != null ? category : ((IPeerModel)element).getModel();
+ } else if (element instanceof PeerRedirectorGroupNode) {
+ // Return the parent peer model node
+ final AtomicReference<IPeerModel> parent = new AtomicReference<IPeerModel>();
+ final Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ parent.set(Model.getModel().getService(ILocatorModelLookupService.class).lkupPeerModelById(((PeerRedirectorGroupNode)element).peerId));
+ }
+ };
+
+ Assert.isTrue(!Protocol.isDispatchThread());
+
+ // The caller thread is very likely the display thread. We have to us a little
+ // trick here to avoid blocking the display thread via a wait on a monitor as
+ // this can (and has) lead to dead-locks with the TCF event dispatch thread if
+ // something fatal (OutOfMemoryError in example) happens in-between.
+ ExecutorsUtil.executeWait(new Runnable() {
+ @Override
+ public void run() {
+ Protocol.invokeAndWait(runnable);
+ }
+ });
+
+ return parent.get();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreePathContentProvider#getParents(java.lang.Object)
+ */
+ @Override
+ public TreePath[] getParents(Object element) {
+ // Not sure if we ever have to calculate the _full_ tree path. The parent NavigatorContentServiceContentProvider
+ // is consuming only the last segment.
+ List<TreePath> pathes = new ArrayList<TreePath>();
+
+ if (element instanceof IPeerModel) {
+ if (Managers.getCategoryManager().belongsTo(IUIConstants.ID_CAT_FAVORITES, ((IPeerModel)element).getPeerId())) {
+ // Get the "Favorites" category
+ ICategory favCategory = CategoriesExtensionPointManager.getInstance().getCategory(IUIConstants.ID_CAT_FAVORITES, false);
+ if (favCategory != null) {
+ pathes.add(new TreePath(new Object[] { favCategory }));
+ }
+ }
+
+ // Determine the default parent
+ Object parent = getParent(element);
+ if (parent != null) {
+ pathes.add(new TreePath(new Object[] { parent }));
+ }
+ }
+
+ return pathes.toArray(new TreePath[pathes.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ @Override
+ public boolean hasChildren(Object element) {
+ Object[] children = getChildren(element);
+
+ if (children != null && children.length > 0 && navFilterService != null) {
+ for (ViewerFilter filter : navFilterService.getVisibleFilters(true)) {
+ children = filter.filter(null, element, children);
+ }
+ }
+
+ return children != null && children.length > 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreePathContentProvider#hasChildren(org.eclipse.jface.viewers.TreePath)
+ */
+ @Override
+ public boolean hasChildren(TreePath path) {
+ // hasChildren is independent of the elements tree path
+ return path != null ? hasChildren(path.getLastSegment()) : false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (modelListener != null) {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ Model.getModel().removeListener(modelListener);
+ }
+ };
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+ modelListener = null;
+ }
+
+ if (treeViewerListener != null) {
+ treeViewerListener.dispose();
+ treeViewerListener = null;
+ }
+
+ roots.clear();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void inputChanged(final Viewer viewer, Object oldInput, Object newInput) {
+ final ILocatorModel model = Model.getModel();
+
+ // Create and attach the model listener if not yet done
+ if (modelListener == null && model != null && viewer instanceof CommonViewer) {
+ modelListener = new ModelListener(model, (CommonViewer)viewer);
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ model.addListener(modelListener);
+ }
+ });
+ }
+
+ // Create and attach the tree listener if not yet done
+ if (treeViewerListener == null && viewer instanceof CommonViewer) {
+ CommonViewer v = (CommonViewer)viewer;
+ treeViewerListener = new TreeViewerListener(v);
+ v.addTreeListener(treeViewerListener);
+ }
+
+ if (model != null && newInput instanceof IRoot) {
+ // Refresh the model asynchronously
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ model.getService(ILocatorModelRefreshService.class).refresh(null);
+ }
+ });
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.ICommonContentProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite)
+ */
+ @Override
+ public void init(ICommonContentExtensionSite config) {
+ Assert.isNotNull(config);
+
+ // Make sure that the hidden "Redirected Peers" filter is active
+ INavigatorContentService cs = config.getService();
+ navFilterService = cs != null ? cs.getFilterService() : null;
+ if (navFilterService instanceof NavigatorFilterService) {
+ final NavigatorFilterService filterService = (NavigatorFilterService)navFilterService;
+ boolean activeFiltersChanged = false;
+
+ // Reconstruct the list of active filters based on the visible filter descriptors
+ List<String> activeFilderIds = new ArrayList<String>();
+
+ ICommonFilterDescriptor[] descriptors = filterService.getVisibleFilterDescriptors();
+ for (ICommonFilterDescriptor descriptor : descriptors) {
+ if (descriptor.getId() != null && !"".equals(descriptor.getId()) && filterService.isActive(descriptor.getId())) { //$NON-NLS-1$
+ activeFilderIds.add(descriptor.getId());
+ }
+ }
+
+ if (!activeFilderIds.contains(REDIRECT_PEERS_FILTER_ID)) {
+ activeFilderIds.add(REDIRECT_PEERS_FILTER_ID);
+ activeFiltersChanged = true;
+ }
+
+ if (UIPlugin.getDefault().getPreferenceStore().getBoolean(IPreferenceKeys.PREF_ACTIVATE_CURRENT_USER_FILTER)
+ && !navFilterService.isActive(CURRENT_USER_FILTER_ID)) {
+ IDialogSettings settings = UIPlugin.getDefault().getDialogSettings();
+ IDialogSettings section = settings.getSection(this.getClass().getSimpleName());
+ if (section == null) section = settings.addNewSection(this.getClass().getSimpleName());
+ if (!section.getBoolean(IPreferenceKeys.PREF_ACTIVATE_CURRENT_USER_FILTER + ".done")) { //$NON-NLS-1$
+ activeFilderIds.add(CURRENT_USER_FILTER_ID);
+ activeFiltersChanged = true;
+ section.put(IPreferenceKeys.PREF_ACTIVATE_CURRENT_USER_FILTER + ".done", true); //$NON-NLS-1$
+ }
+ }
+
+ if (activeFiltersChanged) {
+ final String[] finActiveFilterIds = activeFilderIds.toArray(new String[activeFilderIds.size()]);
+ // Do the update view asynchronous to avoid reentrant viewer calls
+ DisplayUtil.safeAsyncExec(new Runnable() {
+ @Override
+ public void run() {
+ filterService.activateFilterIdsAndUpdateViewer(finActiveFilterIds);
+ }
+ });
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void restoreState(IMemento aMemento) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState(IMemento aMemento) {
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java
index 2e561649b..9ba4385ee 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java
@@ -9,21 +9,45 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.ui.navigator.dnd;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicReference;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.callback.Callback;
+import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableNodeProperties;
+import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.tcf.core.peers.Peer;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshService;
+import org.eclipse.tcf.te.tcf.locator.model.Model;
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;
import org.eclipse.tcf.te.ui.views.interfaces.IRoot;
import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategorizable;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.navigator.CommonDropAdapter;
+import org.eclipse.ui.navigator.CommonNavigator;
/**
* Common DND operation implementations.
@@ -69,55 +93,173 @@ public class CommonDnD {
* @return true if the dropping is successful.
*/
public static boolean dropLocalSelection(CommonDropAdapter dropAdapter, Object target, int operations, IStructuredSelection selection) {
- if (target instanceof ICategory) {
- ICategory hovered = (ICategory) target;
- if (IUIConstants.ID_CAT_FAVORITES.equals(hovered.getId())
- || IUIConstants.ID_CAT_MY_TARGETS.equals(hovered.getId())) {
- Iterator<?> iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (!isDraggableObject(element)) {
- continue;
- }
- Managers.getCategoryManager().add(hovered.getId(), ((IPeerModel)element).getPeerId());
- }
- // Fire a refresh of the view
- ViewsUtil.refresh(IUIConstants.ID_EXPLORER);
- }
- } else if (target instanceof IRoot) {
- Iterator<?> iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (!isDraggableObject(element)) {
- continue;
- }
- // To determine the parent category, we have to look at the tree path
- TreePath[] pathes = selection instanceof TreeSelection ? ((TreeSelection)selection).getPathsFor(element) : null;
- if (pathes != null && pathes.length > 0) {
- for (TreePath path : pathes) {
- ICategory category = null;
- TreePath parentPath = path.getParentPath();
- while (parentPath != null) {
- if (parentPath.getLastSegment() instanceof ICategory) {
- category = (ICategory)parentPath.getLastSegment();
- break;
+ boolean result = false;
+ boolean refreshModel = false;
+
+ ICategory catToSelect = null;
+ Object elementToSelect = null;
+
+ Iterator<?> iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object element = iterator.next();
+ if (!isDraggableObject(element)) {
+ continue;
+ }
+
+ ICategorizable categorizable = getCategorizable(element);
+ if (categorizable == null || !isDraggableObject(element)) {
+ continue;
+ }
+ ICategory[] parentCategories = getParentCategories(element, selection);
+ if (parentCategories.length == 0) {
+ continue;
+ }
+
+ for (ICategory parentCategory : parentCategories) {
+ if (target instanceof ICategory) {
+ ICategory category = (ICategory) target;
+
+ if (element instanceof IPeerModel && category.getId().equals(parentCategory.getId()) && ((IPeerModel)element).isStatic()) {
+ List<String> usedNames = getUsedNames();
+ Map<String,String> attrs = new HashMap<String,String>(((IPeerModel)element).getPeer().getAttributes());
+ attrs.put(IPeer.ATTR_ID, UUID.randomUUID().toString());
+ attrs.remove(IPersistableNodeProperties.PROPERTY_URI);
+ int i = 0;
+ String baseName = attrs.get(IPeer.ATTR_NAME);
+ baseName = baseName.replaceAll("\\s*\\([\\d*]\\)$", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ String name = baseName + " (" + i + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ while (usedNames.contains(name.toUpperCase())) {
+ i++;
+ name = baseName + " (" + i + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ attrs.put(IPeer.ATTR_NAME, name);
+ IPeer newPeer = new Peer(attrs);
+ // Save the new peer
+ IURIPersistenceService persistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
+ if (persistenceService != null) {
+ try {
+ persistenceService.write(newPeer, null);
+ refreshModel = true;
+ if (catToSelect == null || elementToSelect == null) {
+ catToSelect = category;
+ elementToSelect = newPeer;
+ }
+ result = true;
+ }
+ catch (Exception e) {
}
- parentPath = parentPath.getParentPath();
}
-
- if (category != null) {
- Managers.getCategoryManager().remove(category.getId(), ((IPeerModel)element).getPeerId());
+ }
+ else if (!Managers.getCategoryManager().isLinked(category.getId(), categorizable.getId()) &&
+ categorizable.isValid(ICategorizable.OPERATION.ADD, parentCategory, category)) {
+ Managers.getCategoryManager().add(category.getId(), categorizable.getId());
+ if (catToSelect == null || elementToSelect == null) {
+ catToSelect = category;
+ elementToSelect = element;
}
+ result = true;
}
}
+ else if (target instanceof IRoot) {
+ if (Managers.getCategoryManager().isLinked(parentCategory.getId(), categorizable.getId())) {
+ Managers.getCategoryManager().remove(parentCategory.getId(), categorizable.getId());
+ catToSelect = parentCategory;
+ result = true;
+ }
+ }
+ }
+ }
+
+ if (result) {
+ final CommonNavigator cNav = getCommonNavigator();
+ if (refreshModel) {
+ final ICategory finalCat = catToSelect;
+ final Object finalElement = elementToSelect;
+ final IPeer finalNewPeer = (elementToSelect instanceof IPeer) ? (IPeer)elementToSelect : null;
+ // Trigger a refresh of the model to read in the newly created static peer
+ final ILocatorModelRefreshService service = Model.getModel().getService(ILocatorModelRefreshService.class);
+ if (service != null) {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ service.refresh(new Callback() {
+ @Override
+ protected void internalDone(Object caller, org.eclipse.core.runtime.IStatus status) {
+ IPeerModel peerModel = null;
+ if (finalNewPeer != null) {
+ ILocatorModelLookupService service = Model.getModel().getService(ILocatorModelLookupService.class);
+ if (service != null) {
+ peerModel = service.lkupPeerModelById(finalNewPeer.getID());
+ }
+ }
+ refresh(cNav, finalCat, peerModel != null ? peerModel : finalElement);
+ }
+ });
+
+ }
+ };
+ if (Protocol.isDispatchThread())
+ runnable.run();
+ else
+ Protocol.invokeLater(runnable);
+ }
+ else {
+ refresh(cNav, catToSelect, elementToSelect);
+ }
+ }
+ else {
+ refresh(cNav, catToSelect, elementToSelect);
+ }
+ }
+
+ return result;
+ }
+
+ protected static void refresh(final CommonNavigator cNav, final ICategory category, final Object element) {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ cNav.getCommonViewer().refresh();
+ if (category != null) {
+ cNav.getCommonViewer().setSelection(new StructuredSelection(category), true);
+ cNav.getCommonViewer().expandToLevel(category, 1);
+ }
+ if (element != null)
+ cNav.getCommonViewer().setSelection(new TreeSelection(new TreePath(new Object[]{category, element})), true);
}
+ };
- // Fire a refresh of the view
- ViewsUtil.refresh(IUIConstants.ID_EXPLORER);
+ // Execute asynchronously
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(runnable);
}
+ }
- return false;
+ protected static CommonNavigator getCommonNavigator() {
+ final AtomicReference<IViewPart> viewPart = new AtomicReference<IViewPart>();
+ // Create the runnable
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ // Check the active workbench window and active page instances
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null && PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
+ // show the view
+ try {
+ viewPart.set(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IUIConstants.ID_EXPLORER));
+ }
+ catch (Exception e) {
+ }
+ }
+ }
+ };
+ // Execute asynchronously
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getDisplay().syncExec(runnable);
+ }
+
+ return viewPart.get() instanceof CommonNavigator ? (CommonNavigator)viewPart.get() : null;
}
/**
@@ -134,76 +276,60 @@ public class CommonDnD {
int overrideOperation = -1;
boolean valid = false;
- // The default operation should be always "DROP_MOVE"
- if ((operation & DND.DROP_MOVE) == 0) {
- overrideOperation = DND.DROP_MOVE;
- }
-
LocalSelectionTransfer transfer = LocalSelectionTransfer.getTransfer();
IStructuredSelection selection = (IStructuredSelection) transfer.getSelection();
- if (target instanceof ICategory) {
- ICategory category = (ICategory) target;
+ boolean allow = true;
+ boolean link = false;
+ boolean copy = false;
- // Dragging to the "Neighborhood" category is not possible
- if (!IUIConstants.ID_CAT_NEIGHBORHOOD.equals(category.getId())) {
- boolean allow = true;
- Iterator<?> iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (!isDraggableObject(element)) {
- allow = false;
- break;
+ Iterator<?> iterator = selection.iterator();
+ while (allow && iterator.hasNext()) {
+ Object element = iterator.next();
+ if (!isDraggableObject(element)) {
+ allow = false;
+ break;
+ }
+
+ ICategorizable categorizable = getCategorizable(element);
+ if (categorizable == null || !isDraggableObject(element)) {
+ allow = false;
+ break;
+ }
+ ICategory[] parentCategories = getParentCategories(element, selection);
+ if (parentCategories.length == 0) {
+ allow = false;
+ }
+
+ for (ICategory parentCategory : parentCategories) {
+ if (target instanceof ICategory) {
+ ICategory category = (ICategory) target;
+
+ if (!link && element instanceof IPeerModel && category.getId().equals(parentCategory.getId()) && ((IPeerModel)element).isStatic()) {
+ overrideOperation = DND.DROP_COPY;
+ copy = true;
+ }
+ else if (!copy && !Managers.getCategoryManager().isLinked(category.getId(), categorizable.getId()) &&
+ categorizable.isValid(ICategorizable.OPERATION.ADD, parentCategory, category)) {
+ overrideOperation = DND.DROP_LINK;
+ link = true;
}
- if (Managers.getCategoryManager().belongsTo(category.getId(), ((IPeerModel)element).getPeerId())) {
+ else {
allow = false;
break;
}
- }
- valid = allow;
- // If the target is the "Favorites" or the "My Targets" category,
- // force DROP_LINK operation
- if ((IUIConstants.ID_CAT_FAVORITES.equals(category.getId()) || IUIConstants.ID_CAT_MY_TARGETS.equals(category.getId()))
- && (operation & DND.DROP_LINK) == 0) {
- overrideOperation = DND.DROP_LINK;
}
- }
- } else if (target instanceof IRoot) {
- // Allow to drag into empty space either from "Favorites"
- // or "My Targets" category only
- boolean allow = true;
- Iterator<?> iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (!isDraggableObject(element)) {
- allow = false;
- break;
- }
-
- // To determine the parent category, we have to look at the tree path
- TreePath[] pathes = selection instanceof TreeSelection ? ((TreeSelection)selection).getPathsFor(element) : null;
- if (pathes != null && pathes.length > 0) {
- for (TreePath path : pathes) {
- ICategory category = null;
- TreePath parentPath = path.getParentPath();
- while (parentPath != null) {
- if (parentPath.getLastSegment() instanceof ICategory) {
- category = (ICategory)parentPath.getLastSegment();
- break;
- }
- parentPath = parentPath.getParentPath();
- }
-
- if (category == null || IUIConstants.ID_CAT_NEIGHBORHOOD.equals(category.getId())) {
- allow = false;
- break;
- }
+ else if (target instanceof IRoot) {
+ overrideOperation = DND.DROP_DEFAULT;
+ if (!Managers.getCategoryManager().isLinked(parentCategory.getId(), categorizable.getId())) {
+ allow = false;
+ break;
}
}
}
- valid = allow;
}
+ valid = allow;
if (dropAdapter != null) {
if (!valid) {
@@ -212,8 +338,66 @@ public class CommonDnD {
else if (overrideOperation != -1) {
dropAdapter.overrideOperation(overrideOperation);
}
+ else {
+ dropAdapter.overrideOperation(operation);
+ }
}
return valid;
}
+
+ protected static ICategory[] getParentCategories(Object element, ISelection selection) {
+ List<ICategory> candidates = new ArrayList<ICategory>();
+ // To determine the parent category, we have to look at the tree path
+ TreePath[] pathes = selection instanceof TreeSelection ? ((TreeSelection)selection).getPathsFor(element) : null;
+ if (pathes != null && pathes.length > 0) {
+ for (TreePath path : pathes) {
+ TreePath parentPath = path.getParentPath();
+ while (parentPath != null) {
+ if (parentPath.getLastSegment() instanceof ICategory) {
+ if (!candidates.contains(parentPath.getLastSegment())) {
+ candidates.add((ICategory)parentPath.getLastSegment());
+ break;
+ }
+ }
+ parentPath = parentPath.getParentPath();
+ }
+ }
+ }
+ return candidates.toArray(new ICategory[candidates.size()]);
+ }
+
+ protected static ICategorizable getCategorizable(Object element) {
+ ICategorizable categorizable = element instanceof IAdaptable ? (ICategorizable)((IAdaptable)element).getAdapter(ICategorizable.class) : null;
+ if (categorizable == null) categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(element, ICategorizable.class);
+ return categorizable;
+ }
+
+ protected static List<String> getUsedNames() {
+ final List<String> usedNames = new ArrayList<String>();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ // Get all peer model objects
+ IPeerModel[] peers = Model.getModel().getPeers();
+ // Loop them and find the ones which are of our handled types
+ for (IPeerModel peerModel : peers) {
+ if (peerModel.isStatic()) {
+ String name = peerModel.getPeer().getName();
+ Assert.isNotNull(name);
+ if (!"".equals(name) && !usedNames.contains(name)) { //$NON-NLS-1$
+ usedNames.add(name.trim().toUpperCase());
+ }
+ }
+ }
+ }
+ };
+
+ if (Protocol.isDispatchThread())
+ runnable.run();
+ else
+ Protocol.invokeAndWait(runnable);
+ return usedNames;
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java
index b526b5b6a..614034a21 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java
@@ -63,6 +63,16 @@ public interface ICategoryManager {
public boolean belongsTo(String categoryId, String id);
/**
+ * Returns if or if not the given id is linked to the given category.
+ *
+ * @param categoryId The category id. Must not be <code>null</code>.
+ * @param id The id. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the id is linekd to the category, <code>false</code> if not.
+ */
+ public boolean isLinked(String categoryId, String id);
+
+ /**
* Returns the list of categories the given id belongs to.
*
* @param id The id. Must not be <code>null</code>.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java
index 620217b32..228bc0d25 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java
@@ -279,12 +279,10 @@ public class CategoryManager implements ICategoryManager {
Assert.isNotNull(categoryId);
Assert.isNotNull(id);
- boolean belongsTo = false;
+ boolean belongsTo = isLinked(categoryId, id);
List<String> ids = cat2id.get(categoryId);
- if (ids != null && ids.contains(id)) {
- belongsTo = true;
- } else {
+ if (!belongsTo) {
ids = _t_cat2id.get(categoryId);
if (ids != null && ids.contains(id)) {
belongsTo = true;
@@ -295,6 +293,24 @@ public class CategoryManager implements ICategoryManager {
}
/* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.interfaces.categories.ICategoryManager#isLinked(java.lang.String, java.lang.String)
+ */
+ @Override
+ public boolean isLinked(String categoryId, String id) {
+ Assert.isNotNull(categoryId);
+ Assert.isNotNull(id);
+
+ boolean belongsTo = false;
+
+ List<String> ids = cat2id.get(categoryId);
+ if (ids != null && ids.contains(id)) {
+ belongsTo = true;
+ }
+
+ return belongsTo;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#getCategoryIds(java.lang.String)
*/
@Override

Back to the top