Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-08-16 05:13:09 +0000
committerTobias Schwarz2013-08-16 05:13:09 +0000
commit36c64ccf43f41d65a74a585322cb3e423b7b4143 (patch)
tree555f880117bd48592deca0570004e0b25fa65875 /target_explorer
parent969a955eec9b6ba99e1b5655c8b615d99ae1a90c (diff)
downloadorg.eclipse.tcf-36c64ccf43f41d65a74a585322cb3e423b7b4143.tar.gz
org.eclipse.tcf-36c64ccf43f41d65a74a585322cb3e423b7b4143.tar.xz
org.eclipse.tcf-36c64ccf43f41d65a74a585322cb3e423b7b4143.zip
Target Explorer: fix properties view not showing info
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/DelegatingLabelProvider.java27
3 files changed, 44 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
index 192d1fc11..301589175 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
@@ -67,7 +67,7 @@
contentProvider="org.eclipse.tcf.te.tcf.processes.ui.navigator.runtime.ContentProvider"
icon="icons/obj16/process_root.gif"
id="org.eclipse.tcf.te.tcf.processes.ui.navigator.content"
- labelProvider="org.eclipse.tcf.te.tcf.processes.ui.navigator.runtime.LabelProviderDelegate"
+ labelProvider="org.eclipse.tcf.te.ui.views.navigator.DelegatingLabelProvider"
name="%navigatorContent.name"
priority="normal">
@@ -107,6 +107,22 @@
</extension>
+<!-- Label provider delegates -->
+ <extension point="org.eclipse.tcf.te.ui.views.labelProviderDelegates">
+ <labelProviderDelegate
+ class="org.eclipse.tcf.te.tcf.processes.ui.navigator.runtime.LabelProviderDelegate"
+ id="org.eclipse.tcf.te.tcf.processes.ui.labelProviderDelegate"
+ rank="10">
+ <enablement>
+ <or>
+ <instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModel"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IPendingOperationNode"/>
+ </or>
+ </enablement>
+ </labelProviderDelegate>
+ </extension>
+
<!-- Editor page contributions -->
<extension point="org.eclipse.tcf.te.ui.views.editorPages">
<editorPage
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java
index 161dfb4ca..a2a434693 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java
@@ -99,7 +99,7 @@ public class PeerLabelProviderDelegate extends LabelProvider implements ILabelDe
return Messages.RemotePeerDiscoveryRootNode_label;
}
- return super.getText(element);
+ return null;
}
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/DelegatingLabelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/DelegatingLabelProvider.java
index ba54e3b36..5ca4d1585 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/DelegatingLabelProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/DelegatingLabelProvider.java
@@ -15,12 +15,13 @@ import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.tcf.te.runtime.services.interfaces.delegates.ILabelProviderDelegate;
import org.eclipse.tcf.te.ui.views.extensions.LabelProviderDelegateExtensionPointManager;
+import org.eclipse.ui.navigator.IDescriptionProvider;
/**
* Label provider implementation.
*/
-public class DelegatingLabelProvider extends LabelProvider implements ILabelDecorator, ILabelProviderDelegate {
+public class DelegatingLabelProvider extends LabelProvider implements ILabelDecorator, ILabelProviderDelegate, IDescriptionProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
@@ -101,4 +102,28 @@ public class DelegatingLabelProvider extends LabelProvider implements ILabelDeco
return text;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.IDescriptionProvider#getDescription(java.lang.Object)
+ */
+ @Override
+ public String getDescription(Object element) {
+ ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
+
+ String description = null;
+
+ if (delegates != null && delegates.length > 0) {
+ for (ILabelProvider delegate : delegates) {
+ if (delegate instanceof IDescriptionProvider) {
+ String candidate = ((IDescriptionProvider)delegate).getDescription(element);
+ if (candidate != null) {
+ description = candidate;
+ break;
+ }
+ }
+ }
+ }
+
+ return decorateText(getText(element), element) + (description != null ? " - " + description : ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}

Back to the top