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 76794 Details for
Bug 198443
[Presentation] [API] Make Part label creation configurable from the outside
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
A first draft to kick off discussion
clipboard.txt (text/plain), 24.78 KB, created by
Thomas Schindl
on 2007-08-23 13:24:17 EDT
(
hide
)
Description:
A first draft to kick off discussion
Filename:
MIME Type:
Creator:
Thomas Schindl
Created:
2007-08-23 13:24:17 EDT
Size:
24.78 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/presentations/r33/DefaultTabItem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/r33/DefaultTabItem.java,v >retrieving revision 1.4 >diff -u -r1.4 DefaultTabItem.java >--- Eclipse UI/org/eclipse/ui/internal/presentations/r33/DefaultTabItem.java 19 Mar 2007 19:26:14 -0000 1.4 >+++ Eclipse UI/org/eclipse/ui/internal/presentations/r33/DefaultTabItem.java 23 Aug 2007 17:25:35 -0000 >@@ -12,10 +12,14 @@ > > import org.eclipse.jface.resource.FontRegistry; > import org.eclipse.jface.util.Geometry; >+import org.eclipse.jface.viewers.IBaseLabelProvider; >+import org.eclipse.jface.viewers.ILabelDecorator; > import org.eclipse.swt.custom.CTabFolder; > import org.eclipse.swt.custom.CTabItem; > import org.eclipse.swt.graphics.Font; >+import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.graphics.Rectangle; >+import org.eclipse.ui.IWorkbenchPreferenceConstants; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.internal.IWorkbenchThemeConstants; > import org.eclipse.ui.internal.WorkbenchMessages; >@@ -49,7 +53,7 @@ > > /** > * Get a new tab for the receiver. >- * >+ * > * @return CTabItem > */ > private static CTabItem getTab(CTabFolder parent, int index, int flags) { >@@ -58,7 +62,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#getBounds() > */ > public Rectangle getBounds() { >@@ -71,7 +75,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#isShowing() > */ > public boolean isShowing() { >@@ -80,19 +84,53 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#setInfo(org.eclipse.ui.internal.presentations.util.PartInfo) > */ > public void setInfo(PartInfo info) { > CTabItem tabItem = getItem(); > >- shortName = computeShortName(info); >- longName = computeLongName(info); >+ String decoratorIds = PlatformUI.getPreferenceStore().getString(IWorkbenchPreferenceConstants.PRESENTATION_DECORATORS); >+ IBaseLabelProvider l = null; >+ >+ if( decoratorIds != null ) { >+ l = PlatformUI.getWorkbench().getDecoratorManager().getBaseLabelProvider(decoratorIds); >+ } >+ >+ ILabelDecorator ld = null; >+ >+ if( l instanceof ILabelDecorator ) { >+ ld = (ILabelDecorator)l; >+ } >+ >+ Image img = info.image; >+ >+ if( ld != null ) { >+ Image tmp = ld.decorateImage(img, info); >+ if( tmp != null ) { >+ img = tmp; >+ } >+ } >+ >+ if( ld != null ) { >+ String tmp = ld.decorateText(info.name, info); >+ >+ if( tmp != null ) { >+ shortName = tmp; >+ longName = tmp; >+ } else { >+ shortName = computeShortName(info); >+ longName = computeLongName(info); >+ } >+ } else { >+ shortName = computeShortName(info); >+ longName = computeLongName(info); >+ } > > updateTabText(); > >- if (tabItem.getImage() != info.image) { >- tabItem.setImage(info.image); >+ if (tabItem.getImage() != img) { >+ tabItem.setImage(img); > } > > String toolTipText = info.toolTip; >@@ -120,9 +158,9 @@ > /** > * Escapes all the ampersands in the given string such that they can be > * displayed verbatim in an SWT label rather than treated as accelerators. >- * >+ * > * @since 3.1 >- * >+ * > * @return a string where all ampersands are escaped > */ > public static String escapeAmpersands(String input) { >@@ -139,7 +177,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#setBold(boolean) > */ > public void setBold(boolean bold) { >@@ -150,7 +188,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#setBusy(boolean) > */ > public void setBusy(boolean busy) { >Index: Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java,v >retrieving revision 1.52 >diff -u -r1.52 IWorkbenchPreferenceConstants.java >--- Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java 19 Mar 2007 20:58:53 -0000 1.52 >+++ Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java 23 Aug 2007 17:25:35 -0000 >@@ -16,12 +16,12 @@ > * Preference ids exposed by the Eclipse Platform User Interface. > * These preference settings can be obtained from the UI plug-in's > * preference store. >- * >+ * > * @see PlatformUI#PLUGIN_ID > * @see PlatformUI#getPreferenceStore() > */ > public interface IWorkbenchPreferenceConstants { >- >+ > /** > * A named preference for whether to show an editor when its > * input file is selected in the Navigator (and vice versa). >@@ -34,11 +34,11 @@ > /** > * A named preference for how a new perspective is opened. > * <p> >- * Value is of type <code>String</code>. The possible values are defined >- * by <code>OPEN_PERSPECTIVE_WINDOW, OPEN_PERSPECTIVE_PAGE and >+ * Value is of type <code>String</code>. The possible values are defined >+ * by <code>OPEN_PERSPECTIVE_WINDOW, OPEN_PERSPECTIVE_PAGE and > * OPEN_PERSPECTIVE_REPLACE</code>. > * </p> >- * >+ * > * @see #OPEN_PERSPECTIVE_WINDOW > * @see #OPEN_PERSPECTIVE_PAGE > * @see #OPEN_PERSPECTIVE_REPLACE >@@ -51,8 +51,8 @@ > * when the alternate key modifiers are pressed. The alternate key modifiers > * are platform dependent. > * <p> >- * Value is of type <code>String</code>. The possible values are defined >- * by <code>OPEN_PERSPECTIVE_WINDOW, OPEN_PERSPECTIVE_PAGE and >+ * Value is of type <code>String</code>. The possible values are defined >+ * by <code>OPEN_PERSPECTIVE_WINDOW, OPEN_PERSPECTIVE_PAGE and > * OPEN_PERSPECTIVE_REPLACE</code>. > * </p> > * @deprecated Workbench no longer supports alternate key modifier to open >@@ -62,13 +62,13 @@ > > /** > * A named preference for how a new perspective is opened >- * when the shift key modifier is pressed. >+ * when the shift key modifier is pressed. > * <p> >- * Value is of type <code>String</code>. The possible values are defined >- * by <code>OPEN_PERSPECTIVE_WINDOW, OPEN_PERSPECTIVE_PAGE and >+ * Value is of type <code>String</code>. The possible values are defined >+ * by <code>OPEN_PERSPECTIVE_WINDOW, OPEN_PERSPECTIVE_PAGE and > * OPEN_PERSPECTIVE_REPLACE</code>. > * </p> >- * >+ * > * @deprecated Workbench no longer supports shift key modifier to open > * a new perspective. Callers should use IWorkbench.showPerspective methods. > */ >@@ -78,34 +78,34 @@ > * A named preference for how a new perspective should be opened > * when a new project is created. > * <p> >- * Value is of type <code>String</code>. The possible values are defined >- * by the constants <code>OPEN_PERSPECTIVE_WINDOW, OPEN_PERSPECTIVE_PAGE, >+ * Value is of type <code>String</code>. The possible values are defined >+ * by the constants <code>OPEN_PERSPECTIVE_WINDOW, OPEN_PERSPECTIVE_PAGE, > * OPEN_PERSPECTIVE_REPLACE, and NO_NEW_PERSPECTIVE</code>. > * </p> >- * >+ * > * @see #OPEN_PERSPECTIVE_WINDOW > * @see #OPEN_PERSPECTIVE_PAGE > * @see #OPEN_PERSPECTIVE_REPLACE > * @see #NO_NEW_PERSPECTIVE > * @deprecated in 3.0. This preference is IDE-specific, and is therefore found >- * only in IDE configurations. IDE-specific tools should use >+ * only in IDE configurations. IDE-specific tools should use > * <code>org.eclipse.ui.ide.IDE.Preferences.PROJECT_OPEN_NEW_PERSPECTIVE</code> > * instead. > */ > public static final String PROJECT_OPEN_NEW_PERSPECTIVE = "PROJECT_OPEN_NEW_PERSPECTIVE"; //$NON-NLS-1$ > > /** >- * A preference value indicating that an action should open a new >+ * A preference value indicating that an action should open a new > * perspective in a new window. >- * >+ * > * @see #PROJECT_OPEN_NEW_PERSPECTIVE > */ > public static final String OPEN_PERSPECTIVE_WINDOW = "OPEN_PERSPECTIVE_WINDOW"; //$NON-NLS-1$ > > /** >- * A preference value indicating that an action should open a new >+ * A preference value indicating that an action should open a new > * perspective in a new page. >- * >+ * > * @see #PROJECT_OPEN_NEW_PERSPECTIVE > * @deprecated Opening a Perspective in a new page is no longer > * supported functionality as of 2.0. >@@ -113,17 +113,17 @@ > public static final String OPEN_PERSPECTIVE_PAGE = "OPEN_PERSPECTIVE_PAGE"; //$NON-NLS-1$ > > /** >- * A preference value indicating that an action should open a new >+ * A preference value indicating that an action should open a new > * perspective by replacing the current perspective. >- * >+ * > * @see #PROJECT_OPEN_NEW_PERSPECTIVE > */ > public static final String OPEN_PERSPECTIVE_REPLACE = "OPEN_PERSPECTIVE_REPLACE"; //$NON-NLS-1$ > > /** >- * A preference value indicating that an action should not open a >+ * A preference value indicating that an action should not open a > * new perspective. >- * >+ * > * @see #PROJECT_OPEN_NEW_PERSPECTIVE > */ > public static final String NO_NEW_PERSPECTIVE = "NO_NEW_PERSPECTIVE"; //$NON-NLS-1$ >@@ -136,7 +136,7 @@ > /** > * A named preference indicating the presentation factory > * to use for the workbench look and feel. >- * >+ * > * @since 3.0 > */ > public static final String PRESENTATION_FACTORY_ID = "presentationFactoryId"; //$NON-NLS-1$ >@@ -151,7 +151,7 @@ > * > * @since 3.0 > */ >- public static String DOCK_PERSPECTIVE_BAR = "DOCK_PERSPECTIVE_BAR"; //$NON-NLS-1$ >+ public static String DOCK_PERSPECTIVE_BAR = "DOCK_PERSPECTIVE_BAR"; //$NON-NLS-1$ > > /** > * A named preference indicating where the fast view bar should be docked in a >@@ -160,7 +160,7 @@ > * preference is intended for applications that want the initial docking location > * to be somewhere specific. The default value (when this preference is not set) > * is the bottom. >- * >+ * > * @see #LEFT > * @see #BOTTOM > * @see #RIGHT >@@ -169,7 +169,7 @@ > public static final String INITIAL_FAST_VIEW_BAR_LOCATION = "initialFastViewBarLocation"; //$NON-NLS-1$ > > /** >- * Constant to be used when referring to the top right of the workbench window. >+ * Constant to be used when referring to the top right of the workbench window. > * > * @see #DOCK_PERSPECTIVE_BAR > * @since 3.0 >@@ -177,7 +177,7 @@ > public static final String TOP_RIGHT = "topRight"; //$NON-NLS-1$ > > /** >- * Constant to be used when referring to the top left of the workbench window. >+ * Constant to be used when referring to the top left of the workbench window. > * > * @see #DOCK_PERSPECTIVE_BAR > * @since 3.0 >@@ -185,7 +185,7 @@ > public static final String TOP_LEFT = "topLeft"; //$NON-NLS-1$ > > /** >- * Constant to be used when referring to the left side of the workbench window. >+ * Constant to be used when referring to the left side of the workbench window. > * > * @see #DOCK_PERSPECTIVE_BAR > * @see #INITIAL_FAST_VIEW_BAR_LOCATION >@@ -194,7 +194,7 @@ > public static final String LEFT = "left"; //$NON-NLS-1$ > > /** >- * Constant to be used when referring to the bottom of the workbench window. >+ * Constant to be used when referring to the bottom of the workbench window. > * > * @see #INITIAL_FAST_VIEW_BAR_LOCATION > * @since 3.0 >@@ -202,7 +202,7 @@ > public static final String BOTTOM = "bottom"; //$NON-NLS-1$ > > /** >- * Constant to be used when referring to the right side of the workbench window. >+ * Constant to be used when referring to the right side of the workbench window. > * > * @see #INITIAL_FAST_VIEW_BAR_LOCATION > * @since 3.0 >@@ -210,13 +210,13 @@ > public static final String RIGHT = "right"; //$NON-NLS-1$ > > /** >- * A named preference indicating whether the workbench should show the >+ * A named preference indicating whether the workbench should show the > * introduction component (if available) on startup. >- * >+ * > * <p> > * The default value for this preference is: <code>true</code> (show intro) >- * </p> >- * >+ * </p> >+ * > * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#openIntro() > * @since 3.0 > */ >@@ -225,77 +225,77 @@ > /** > * A named preference for whether the workbench should show traditional style tabs in > * editors and views. >- * >+ * > * Boolean-valued: <code>true</code> if editors and views should use a traditional style of tab and > * <code>false</code> if editors should show new style tab (3.0 style) > * <p> > * The default value for this preference is: <code>true</code> > * </p> >- * >+ * > * @since 3.0 > */ > public static String SHOW_TRADITIONAL_STYLE_TABS = "SHOW_TRADITIONAL_STYLE_TABS"; //$NON-NLS-1$ > > /** >- * A named preference for whether the workbench should show text >- * on the perspective bar. >- * >+ * A named preference for whether the workbench should show text >+ * on the perspective bar. >+ * > * Boolean-valued: <code>true</code>, if editors should show text on the perspective bar, > * <code>false</code> otherwise. > * <p> > * The default value for this preference is: <code>true</code> (show text on the perspective bar) > * </p> >- * >+ * > * @since 3.0 > */ > public static String SHOW_TEXT_ON_PERSPECTIVE_BAR = "SHOW_TEXT_ON_PERSPECTIVE_BAR"; //$NON-NLS-1$ > > /** >- * A named preference for the text of the Help Contents action. >- * >+ * A named preference for the text of the Help Contents action. >+ * > * String-valued. If not specified, <code>"&Help Contents"</code> is used. > * <p> > * The default value for this preference is: <code>null</code> > * </p> >- * >+ * > * @since 3.0 > */ > public static String HELP_CONTENTS_ACTION_TEXT = "helpContentsActionText"; //$NON-NLS-1$ >- >+ > /** >- * A named preference for the text of the Help Search action. >- * >+ * A named preference for the text of the Help Search action. >+ * > * String-valued. If not specified, <code>"S&earch"</code> is used. > * <p> > * The default value for this preference is: <code>null</code> > * </p> >- * >+ * > * @since 3.1 > */ > public static String HELP_SEARCH_ACTION_TEXT = "helpSearchActionText"; //$NON-NLS-1$ >- >+ > /** >- * A named preference for the text of the Dynamic Help action. >- * >+ * A named preference for the text of the Dynamic Help action. >+ * > * String-valued. If not specified, <code>"&Dynamic Help"</code> is used. > * <p> > * The default value for this preference is: <code>null</code> > * </p> >- * >+ * > * @since 3.1 > */ > public static String DYNAMIC_HELP_ACTION_TEXT = "dynamicHelpActionText"; //$NON-NLS-1$ >- >+ > /** > * A named preference for enabling animations when a layout transition occurs > * <p> > * The default value for this preference is: <code>true</code> (show animations when a transition occurs) > * </p> >- * >+ * > * @since 3.1 > */ > public static final String ENABLE_ANIMATIONS = "ENABLE_ANIMATIONS"; //$NON-NLS-1$ >- >+ > /** > * <p> > * Workbench preference id for the key configuration identifier to be >@@ -305,11 +305,11 @@ > * The default value for this preference is > * <code>"org.eclipse.ui.defaultAcceleratorConfiguration"</code>. > * <p> >- * >+ * > * @since 3.1 > */ > public static final String KEY_CONFIGURATION_ID = "KEY_CONFIGURATION_ID"; //$NON-NLS-1$ >- >+ > /** > * <p> > * Workbench preference identifier for the minimum width of editor tabs. By >@@ -320,80 +320,80 @@ > * <p> > * The default value for this preference is <code>-1</code>. > * </p> >- * >+ * > * @since 3.1 > */ > public static final String EDITOR_MINIMUM_CHARACTERS = "EDITOR_MINIMUM_CHARACTERS"; //$NON-NLS-1$ > > /** > * <p> >- * Workbench preference identifier for the minimum width of view tabs. >+ * Workbench preference identifier for the minimum width of view tabs. > * </p> > * <p> > * The default value for this preference is <code>1</code>. > * </p> >- * >+ * > * @since 3.2 > */ > public static final String VIEW_MINIMUM_CHARACTERS = "VIEW_MINIMUM_CHARACTERS"; //$NON-NLS-1$ >- >+ > /** > * Stores whether or not system jobs are being shown. >- * >+ * > * @since 3.1 > */ > public static final String SHOW_SYSTEM_JOBS = "SHOW_SYSTEM_JOBS";//$NON-NLS-1$ > > /** > * Workbench preference for the current theme. >- * >+ * > * @since 3.1 > */ > public static String CURRENT_THEME_ID = "CURRENT_THEME_ID"; //$NON-NLS-1$ > > /** >- * A preference value indicating whether editors should be closed before saving >+ * A preference value indicating whether editors should be closed before saving > * the workbench state when exiting. The default is <code>false</code>. >- * >+ * > * @since 3.1 > */ > public static final String CLOSE_EDITORS_ON_EXIT = "CLOSE_EDITORS_ON_EXIT"; //$NON-NLS-1$ >- >+ > /** > * Stores whether or not to show progress while starting the workbench. > * The default is <code>false</code>. >- * >+ * > * @since 3.1 > */ > public static final String SHOW_PROGRESS_ON_STARTUP = "SHOW_PROGRESS_ON_STARTUP"; //$NON-NLS-1$ >- >+ > /** > * Stores whether or not to show the memory monitor in the workbench window. >- * >+ * > * @since 3.1 > */ > public static final String SHOW_MEMORY_MONITOR = "SHOW_MEMORY_MONITOR"; //$NON-NLS-1$ >- >+ > /** > * Stores whether or not to use the window working set as the default > * working set for newly created views (without previously stored state). > * This is a hint that view implementors should honor. >- * >+ * > * @since 3.2 > */ > public static final String USE_WINDOW_WORKING_SET_BY_DEFAULT = "USE_WINDOW_WORKING_SET_BY_DEFAULT"; //$NON-NLS-1$ >- >+ > /** >- * Stores whether or not to show the text widget that allows type-ahead search >+ * Stores whether or not to show the text widget that allows type-ahead search > * in the case where a FilteredTree is used to display and filter tree items. >- * >+ * > * @since 3.2 > */ > public static final String SHOW_FILTERED_TEXTS = "SHOW_FILTERED_TEXTS"; //$NON-NLS-1$ > > /** > * Stores whether or not views may be detached. The default is <code>true</code>. >- * >+ * > * @since 3.2 > */ > public static final String ENABLE_DETACHED_VIEWS = "ENABLE_DETACHED_VIEWS"; //$NON-NLS-1$ >@@ -404,17 +404,17 @@ > * other parts. If > * <code>true<code> (default), the user will be prompted. If <code>false</code>, there will be > * no prompt. >- * >+ * > * @see Saveable > * @since 3.2 > */ > public static final String PROMPT_WHEN_SAVEABLE_STILL_OPEN = "PROMPT_WHEN_SAVEABLE_STILL_OPEN"; //$NON-NLS-1$ >- >+ > /** > * Lists the extra perspectives to show in the perspective bar. > * The value is a comma-separated list of perspective ids. > * The default is the empty string. >- * >+ * > * @since 3.2 > */ > public static final String PERSPECTIVE_BAR_EXTRAS = "PERSPECTIVE_BAR_EXTRAS"; //$NON-NLS-1$ >@@ -422,23 +422,23 @@ > /** > * Allows locking the trim to prevent user dragging on startup. > * The default is <code>false</code>. >- * >+ * > * @since 3.2 > */ > public static final String LOCK_TRIM = "LOCK_TRIM"; //$NON-NLS-1$ >- >+ > /** > * A named preference for providing the 3.3 presentation's min/max behaviour > * <p> > * The default value for this preference is: <code>false</code>; use the 3.2 > * behaviour. > * </p> >- * >+ * > * @since 3.3 > */ > public static final String ENABLE_NEW_MIN_MAX = "ENABLE_MIN_MAX"; //$NON-NLS-1$ > >- /** >+ /** > * A named preference for disabling opening a new fast view > * from the fast view bar controls ("Show View as a fast view" button > * or "New Fast View" submenu). >@@ -447,11 +447,11 @@ > * </p><p> > * The default is <code>false</code>. > * </p> >- * >+ * > * @since 3.3 > */ > public static final String DISABLE_NEW_FAST_VIEW = "disableNewFastView"; //$NON-NLS-1$ >- >+ > /** > * A named preference for enabling the 3.2 behavior for closing sticky views. > * When not enabled a sticky view is closed in all perspectives when the view is closed. >@@ -459,8 +459,13 @@ > * The default value for this preference is: <code>false</code>; use the 3.2 > * behaviour. > * </p> >- * >+ * > * @since 3.3 > */ > public static final String ENABLE_32_STICKY_CLOSE_BEHAVIOR = "ENABLE_32_STICKY_CLOSE_BEHAVIOR"; //$NON-NLS-1$ >+ >+ /** >+ * Decorators used by the presentation >+ */ >+ public static final String PRESENTATION_DECORATORS = "PRESENTATION_DECORATORS"; //$NON-NLS-1$ > } >Index: Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultTabItem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultTabItem.java,v >retrieving revision 1.16 >diff -u -r1.16 DefaultTabItem.java >--- Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultTabItem.java 16 Mar 2007 18:00:35 -0000 1.16 >+++ Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultTabItem.java 23 Aug 2007 17:25:35 -0000 >@@ -12,10 +12,14 @@ > > import org.eclipse.jface.resource.FontRegistry; > import org.eclipse.jface.util.Geometry; >+import org.eclipse.jface.viewers.IBaseLabelProvider; >+import org.eclipse.jface.viewers.ILabelDecorator; > import org.eclipse.swt.custom.CTabFolder; > import org.eclipse.swt.custom.CTabItem; > import org.eclipse.swt.graphics.Font; >+import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.graphics.Rectangle; >+import org.eclipse.ui.IWorkbenchPreferenceConstants; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.internal.IWorkbenchThemeConstants; > import org.eclipse.ui.internal.WorkbenchMessages; >@@ -49,7 +53,7 @@ > > /** > * Get a new tab for the receiver. >- * >+ * > * @return CTabItem > */ > private static CTabItem getTab(CTabFolder parent, int index, int flags) { >@@ -58,7 +62,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#getBounds() > */ > public Rectangle getBounds() { >@@ -71,7 +75,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#isShowing() > */ > public boolean isShowing() { >@@ -80,19 +84,53 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#setInfo(org.eclipse.ui.internal.presentations.util.PartInfo) > */ > public void setInfo(PartInfo info) { > CTabItem tabItem = getItem(); > >- shortName = computeShortName(info); >- longName = computeLongName(info); >+ String decoratorIds = PlatformUI.getPreferenceStore().getString(IWorkbenchPreferenceConstants.PRESENTATION_DECORATORS); >+ IBaseLabelProvider l = null; >+ >+ if( decoratorIds != null ) { >+ l = PlatformUI.getWorkbench().getDecoratorManager().getBaseLabelProvider(decoratorIds); >+ } >+ >+ ILabelDecorator ld = null; >+ >+ if( l instanceof ILabelDecorator ) { >+ ld = (ILabelDecorator)l; >+ } >+ >+ Image img = info.image; >+ >+ if( ld != null ) { >+ Image tmp = ld.decorateImage(img, info); >+ if( tmp != null ) { >+ img = tmp; >+ } >+ } >+ >+ if( ld != null ) { >+ String tmp = ld.decorateText(info.name, info); >+ >+ if( tmp != null ) { >+ shortName = tmp; >+ longName = tmp; >+ } else { >+ shortName = computeShortName(info); >+ longName = computeLongName(info); >+ } >+ } else { >+ shortName = computeShortName(info); >+ longName = computeLongName(info); >+ } > > updateTabText(); > >- if (tabItem.getImage() != info.image) { >- tabItem.setImage(info.image); >+ if (tabItem.getImage() != img) { >+ tabItem.setImage(img); > } > > String toolTipText = info.toolTip; >@@ -120,9 +158,9 @@ > /** > * Escapes all the ampersands in the given string such that they can be > * displayed verbatim in an SWT label rather than treated as accelerators. >- * >+ * > * @since 3.1 >- * >+ * > * @return a string where all ampersands are escaped > */ > public static String escapeAmpersands(String input) { >@@ -139,7 +177,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#setBold(boolean) > */ > public void setBold(boolean bold) { >@@ -150,7 +188,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see org.eclipse.ui.internal.presentations.util.AbstractTabItem#setBusy(boolean) > */ > public void setBusy(boolean busy) {
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 198443
: 76794 |
76795
|
76796