Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.Platform;
import org.eclipse.e4.ui.internal.workbench.PartStackUtil;
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
import org.eclipse.e4.ui.model.application.ui.MElementContainer;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.model.application.ui.MUILabel;
import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering;
import org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ColumnLabelProvider;
Expand Down Expand Up @@ -78,6 +81,10 @@ public String getText(Object element) {

@Override
public Image getImage(Object element) {
// Check if icons should be hidden for view tabs
if (shouldHideIcons()) {
return null;
}
return renderer.getImage((MUILabel) element);
}

Expand Down Expand Up @@ -208,4 +215,24 @@ protected boolean deleteSelectedElement(Object selectedElement) {
return false;

}

/**
* Checks if icons should be hidden based on the preference setting.
* Icons are only hidden for view stacks, not for editor stacks.
*
* @return true if icons should be hidden, false otherwise
*/
private boolean shouldHideIcons() {
// Check if this is an editor stack - if so, don't hide icons
if (PartStackUtil.isEditorStack(input)) {
return false;
}

// Get the preference value for hiding icons in view tabs
return Platform.getPreferencesService().getBoolean(
CTabRendering.PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT,
CTabRendering.HIDE_ICONS_FOR_VIEW_TABS,
CTabRendering.HIDE_ICONS_FOR_VIEW_TABS_DEFAULT,
null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class CTabRendering extends CTabFolderRenderer implements ICTabRendering,
/**
* The preference qualifier.
*/
private static final String PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT = "org.eclipse.e4.ui.workbench.renderers.swt"; //$NON-NLS-1$
public static final String PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT = "org.eclipse.e4.ui.workbench.renderers.swt"; //$NON-NLS-1$

/**
* A named preference for setting CTabFolder's to be rendered with rounded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public class StackRenderer extends LazyStackRenderer {
private static final String TAB_FONT_KEY = "org.eclipse.ui.workbench.TAB_TEXT_FONT"; //$NON-NLS-1$

@Inject
@Preference(nodePath = "org.eclipse.e4.ui.workbench.renderers.swt")
@Preference(nodePath = CTabRendering.PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT)
private IEclipsePreferences preferences;

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering;
import org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer;
import org.eclipse.jface.viewers.BoldStylerProvider;
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
Expand Down Expand Up @@ -62,11 +63,6 @@
*/
public class WorkbookEditorsHandler extends FilteredTableBaseHandler {

/**
* Preference node for the workbench SWT renderer
*/
private static final String ORG_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT = "org.eclipse.e4.ui.workbench.renderers.swt"; //$NON-NLS-1$

/**
* Id for the command that opens the editor drop down
*/
Expand Down Expand Up @@ -98,7 +94,7 @@ public class WorkbookEditorsHandler extends FilteredTableBaseHandler {
* @return Returns the enableMRU.
*/
private static boolean isMruEnabled() {
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(ORG_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT);
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(CTabRendering.PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT);
boolean initialMRUValue = preferences.getBoolean(StackRenderer.MRU_KEY_DEFAULT, StackRenderer.MRU_DEFAULT);
return preferences.getBoolean(StackRenderer.MRU_KEY, initialMRUValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@
*/
public class ViewsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {

private static final String PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT = "org.eclipse.e4.ui.workbench.renderers.swt"; //$NON-NLS-1$

private static final String E4_THEME_EXTENSION_POINT = "org.eclipse.e4.ui.css.swt.theme"; //$NON-NLS-1$

/** The workbench theme engine; may be {@code null} if no engine */
Expand Down Expand Up @@ -248,7 +246,7 @@ protected void createHideIconsForViewTabs(Composite composite) {
}

private boolean getSwtRendererPreference(String prefName, boolean defaultValue) {
return Platform.getPreferencesService().getBoolean(PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT,
return Platform.getPreferencesService().getBoolean(CTabRendering.PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT,
prefName, defaultValue, null);
}

Expand Down Expand Up @@ -332,7 +330,7 @@ public void init(IWorkbench workbench) {
@Override
public boolean performOk() {
IEclipsePreferences prefs = InstanceScope.INSTANCE
.getNode(PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT);
.getNode(CTabRendering.PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT);
if (isThemingPossible()) {
ITheme theme = getSelectedTheme();
if (theme != null) {
Expand Down Expand Up @@ -441,7 +439,7 @@ private void setColorsAndFontsTheme(ColorsAndFontsTheme theme) {
@Override
protected void performDefaults() {
IEclipsePreferences defaultPrefs = DefaultScope.INSTANCE
.getNode(PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT);
.getNode(CTabRendering.PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT);
if (isThemingPossible()) {
setColorsAndFontsTheme(currentColorsAndFontsTheme);

Expand Down
Loading