Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-10-19 07:30:27 +0000
committerUwe Stieber2012-10-19 07:30:27 +0000
commit9e67197c0926037c896b009194d253510fd89034 (patch)
treeea1b1f3ad9c716b6ea400a075a05485aaa909a26 /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf
parent302fe78676a2c56dbd6466c2b8281620a60d67f3 (diff)
downloadorg.eclipse.tcf-9e67197c0926037c896b009194d253510fd89034.tar.gz
org.eclipse.tcf-9e67197c0926037c896b009194d253510fd89034.tar.xz
org.eclipse.tcf-9e67197c0926037c896b009194d253510fd89034.zip
Target Explorer: Label decorations are delegated too
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java
index 3058b9d5c..2f038e46c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java
@@ -181,6 +181,14 @@ public class DelegatingLabelProvider extends LabelProvider implements ILabelDeco
Image decoratedImage = null;
if (image != null && element instanceof IPeerModel) {
+ ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
+ if (delegates != null && delegates.length > 0) {
+ if (delegates[0] instanceof ILabelDecorator) {
+ Image candidate = ((ILabelDecorator)delegates[0]).decorateImage(image, element);
+ if (candidate != null) image = candidate;
+ }
+ }
+
String value = ((IPeerModel)element).getPeer().getAttributes().get("static.transient"); //$NON-NLS-1$
boolean isStatic = value != null && Boolean.parseBoolean(value.trim());
if (!isStatic) {
@@ -199,9 +207,17 @@ public class DelegatingLabelProvider extends LabelProvider implements ILabelDeco
*/
@Override
public String decorateText(final String text, final Object element) {
- if (element instanceof IPeerModel) {
- String label = text;
+ String label = text;
+
+ ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
+ if (delegates != null && delegates.length > 0) {
+ if (delegates[0] instanceof ILabelDecorator) {
+ String candidate = ((ILabelDecorator)delegates[0]).decorateText(label, element);
+ if (candidate != null) label = candidate;
+ }
+ }
+ if (element instanceof IPeerModel) {
final StringBuilder builder = new StringBuilder(label != null && !"".equals(label.trim()) ? label.trim() : "<noname>"); //$NON-NLS-1$ //$NON-NLS-2$
Runnable runnable = new Runnable() {
@@ -211,12 +227,8 @@ public class DelegatingLabelProvider extends LabelProvider implements ILabelDeco
}
};
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
label = builder.toString();

Back to the top