Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 233624 Details for
Bug 413346
[outline] Support StyledText in outline
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
a patch for this bug
Bug-413346--outline-Support-StyledText-in-outline.patch (text/plain), 8.40 KB, created by
Simon Bernard
on 2013-07-19 12:41:12 EDT
(
hide
)
Description:
a patch for this bug
Filename:
MIME Type:
Creator:
Simon Bernard
Created:
2013-07-19 12:41:12 EDT
Size:
8.40 KB
patch
obsolete
>diff --git a/core/plugins/org.eclipse.dltk.ui/META-INF/MANIFEST.MF b/core/plugins/org.eclipse.dltk.ui/META-INF/MANIFEST.MF >index fc80423..b902c52 100644 >--- a/core/plugins/org.eclipse.dltk.ui/META-INF/MANIFEST.MF >+++ b/core/plugins/org.eclipse.dltk.ui/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.dltk.ui;singleton:=true >-Bundle-Version: 5.0.0.qualifier >+Bundle-Version: 5.1.0.qualifier > Bundle-Activator: org.eclipse.dltk.ui.DLTKUIPlugin > Bundle-Vendor: %pluginProvider > Bundle-Localization: plugin >diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java >index fea3a00..a2b4f8b 100644 >--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java >+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java >@@ -49,9 +49,9 @@ > import org.eclipse.dltk.ui.actions.OpenViewActionGroup; > import org.eclipse.dltk.ui.actions.SearchActionGroup; > import org.eclipse.dltk.ui.viewsupport.AppearanceAwareLabelProvider; >-import org.eclipse.dltk.ui.viewsupport.DecoratingModelLabelProvider; > import org.eclipse.dltk.ui.viewsupport.SourcePositionSorter; > import org.eclipse.dltk.ui.viewsupport.StatusBarUpdater; >+import org.eclipse.dltk.ui.viewsupport.StyledDecoratingModelLabelProvider; > import org.eclipse.jface.action.Action; > import org.eclipse.jface.action.GroupMarker; > import org.eclipse.jface.action.IAction; >@@ -673,7 +673,7 @@ > fOutlineViewer = new ScriptOutlineViewer(tree); > initDragAndDrop(); > fOutlineViewer.setContentProvider(new ChildrenProvider()); >- fOutlineViewer.setLabelProvider(new DecoratingModelLabelProvider( >+ fOutlineViewer.setLabelProvider(new StyledDecoratingModelLabelProvider( > lprovider)); > > Object[] listeners = fSelectionChangedListeners.getListeners(); >diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/DecoratingModelLabelProvider.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/DecoratingModelLabelProvider.java >index 91de162..e1baab6 100644 >--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/DecoratingModelLabelProvider.java >+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/DecoratingModelLabelProvider.java >@@ -16,6 +16,9 @@ > import org.eclipse.swt.graphics.Color; > import org.eclipse.ui.PlatformUI; > >+/** >+ * @deprecated use StyledDecoratingModelLabelProvider instead >+ */ > public class DecoratingModelLabelProvider extends DecoratingLabelProvider > implements IColorProvider { > >diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/ScriptUILabelProvider.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/ScriptUILabelProvider.java >index 6c2b43e..aa85c33 100644 >--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/ScriptUILabelProvider.java >+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/ScriptUILabelProvider.java >@@ -24,17 +24,20 @@ > import org.eclipse.dltk.ui.ScriptElementLabels; > import org.eclipse.jface.resource.CompositeImageDescriptor; > import org.eclipse.jface.util.SafeRunnable; >+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; > import org.eclipse.jface.viewers.IColorProvider; > import org.eclipse.jface.viewers.ILabelDecorator; > import org.eclipse.jface.viewers.ILabelProvider; > import org.eclipse.jface.viewers.ILabelProviderListener; > import org.eclipse.jface.viewers.LabelProviderChangedEvent; >+import org.eclipse.jface.viewers.StyledCellLabelProvider; >+import org.eclipse.jface.viewers.StyledString; > import org.eclipse.swt.graphics.Color; > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.graphics.ImageData; > import org.eclipse.swt.graphics.Point; > >-public class ScriptUILabelProvider implements ILabelProvider, IColorProvider { >+public class ScriptUILabelProvider implements ILabelProvider, IColorProvider, IStyledLabelProvider { > > protected ListenerList fListeners = new ListenerList(1); > >@@ -337,4 +340,36 @@ > } > return text; > } >+ >+ /** >+ * @since 5.1 >+ */ >+ public StyledString getStyledText(Object element) { >+ ILabelProvider[] providers = getProviders(element); >+ StyledString result = null; >+ if (providers != null) { >+ for (int i = 0; i < providers.length; i++) { >+ if (providers[i] instanceof IStyledLabelProvider) { >+ StyledString string = ((IStyledLabelProvider) providers[i]).getStyledText(element); >+ if (string != null) { >+ result = string; >+ break; >+ } >+ } >+ } >+ } >+ if (result == null) { >+ result = new StyledString(ScriptElementLabels.getDefault().getTextLabel(element, evaluateTextFlags(element))); >+ } >+ >+ if (result.length() == 0 && (element instanceof IStorage)) { >+ result = new StyledString(fStorageLabelProvider.getText(element)); >+ } >+ >+ String decorated = decorateText(result.getString(), element); >+ if (decorated != null) { >+ return StyledCellLabelProvider.styleDecoratedString(decorated, StyledString.DECORATIONS_STYLER, result); >+ } >+ return result; >+ } > } >diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/StyledDecoratingModelLabelProvider.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/StyledDecoratingModelLabelProvider.java >new file mode 100644 >index 0000000..339ffec >--- /dev/null >+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/viewsupport/StyledDecoratingModelLabelProvider.java >@@ -0,0 +1,81 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2007 IBM Corporation 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 >+ * >+ >+ *******************************************************************************/ >+package org.eclipse.dltk.ui.viewsupport; >+ >+import org.eclipse.dltk.ui.ProblemsLabelDecorator; >+import org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider; >+import org.eclipse.jface.viewers.DecorationContext; >+import org.eclipse.jface.viewers.ILabelProvider; >+import org.eclipse.ui.PlatformUI; >+ >+/** >+ * a DecoratingModelLabelProvider which support StyledText >+ * >+ * replace org.eclipse.dltk.ui.viewsupport.StyledDecoratingModelLabelProvider >+ * >+ * @since 5.1 >+ */ >+public class StyledDecoratingModelLabelProvider extends DecoratingStyledCellLabelProvider implements ILabelProvider { >+ >+ /** >+ * Decorating label provider for DLTK. Combines a ScriptUILabelProvider with >+ * problem and override indicuator with the workbench decorator (label >+ * decorator extension point). >+ */ >+ public StyledDecoratingModelLabelProvider(ScriptUILabelProvider labelProvider) { >+ this(labelProvider, true); >+ } >+ >+ /** >+ * Decorating label provider for dltk. Combines a ScriptUILabelProvider (if >+ * enabled with problem indicator) with the workbench decorator (label >+ * decorator extension point). >+ */ >+ public StyledDecoratingModelLabelProvider(ScriptUILabelProvider labelProvider, >+ boolean errorTick) { >+ this(labelProvider, errorTick, true); >+ } >+ >+ /** >+ * Decorating label provider for dltk. Combines a ScriptUILabelProvider (if >+ * enabled with problem indicator) with the workbench decorator (label >+ * decorator extension point). >+ */ >+ public StyledDecoratingModelLabelProvider(ScriptUILabelProvider labelProvider, >+ boolean errorTick, boolean flatPackageMode) { >+ super(labelProvider, PlatformUI.getWorkbench().getDecoratorManager() >+ .getLabelDecorator(),null); >+ >+ if (errorTick) { >+ labelProvider.addLabelDecorator(new ProblemsLabelDecorator(null)); >+ } >+ setFlatPackageMode(flatPackageMode); >+ } >+ >+ /** >+ * Tells the label decorator if the view presents packages flat or >+ * hierarchical. >+ * >+ * @param enable >+ * If set, packages are presented in flat mode. >+ */ >+ public void setFlatPackageMode(boolean enable) { >+ if (enable) { >+ setDecorationContext(DecorationContext.DEFAULT_CONTEXT); >+ } else { >+ setDecorationContext(DecorationContext.DEFAULT_CONTEXT); >+ // TODO setDecorationContext(HierarchicalDecorationContext.CONTEXT); >+ } >+ } >+ >+ public String getText(Object element) { >+ return getStyledText(element).toString(); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 413346
:
233624
|
233626
|
233697
|
233698
|
233889
|
233890