Skip to content

Commit 1e8d28a

Browse files
HeikoKlareHannesWell
authored andcommitted
Replace pre-generated disabled icon with on-the-fly generated ones
SWT's algorithm to calculate disabled icons on the fly has been enhanced to produce results that are equal to the existing, pre-generated disabled icons being used. This makes the usage of pre-generated disabled icons obsolete. This is particularly important for the introduction of SVG icons, as the quality of on-the-fly generated disabled icons based on the original SVGs is better for arbitrary zooms than the scaled up or scaled downs versions of the PNG-based disabled icons. This change removes all explicit specifications of disabled icons unless it's a usage of one of Platform's shared images.
1 parent e83df80 commit 1e8d28a

File tree

21 files changed

+0
-100
lines changed

21 files changed

+0
-100
lines changed

apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/ApiUIPlugin.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ public class ApiUIPlugin extends AbstractUIPlugin {
6464
*/
6565
private static final String ICONS_PATH = "$nl$/icons/full/"; //$NON-NLS-1$
6666

67-
private static final String DLCL = ICONS_PATH + "dlcl16/"; //basic colors - size 16x16 disabled//$NON-NLS-1$
68-
6967
private static final String ELCL = ICONS_PATH + "elcl16/"; //basic colors - size 16x16 //$NON-NLS-1$
7068

7169
/**
@@ -300,17 +298,11 @@ protected void initializeImageRegistry(ImageRegistry reg) {
300298
declareRegistryImage(reg, IApiToolsConstants.IMG_ELCL_HELP_PAGE, ELCL + "help.png"); //$NON-NLS-1$
301299
declareRegistryImage(reg, IApiToolsConstants.IMG_ELCL_COMPARE_APIS, ELCL + "compare_apis.png"); //$NON-NLS-1$
302300
declareRegistryImage(reg, IApiToolsConstants.IMG_ELCL_CONFIG_SEV, ELCL + "configure_problem_severity.png"); //$NON-NLS-1$
303-
declareRegistryImage(reg, IApiToolsConstants.IMG_ELCL_COMPARE_APIS_DISABLED, DLCL + "compare_apis.png"); //$NON-NLS-1$
304301
declareRegistryImage(reg, IApiToolsConstants.IMG_ELCL_EXPORT, ELCL + "export.png"); //$NON-NLS-1$
305302
declareRegistryImage(reg, IApiToolsConstants.IMG_ELCL_NEXT_NAV, ELCL + "next_nav.png"); //$NON-NLS-1$
306303
declareRegistryImage(reg, IApiToolsConstants.IMG_ELCL_PREV_NAV, ELCL + "prev_nav.png"); //$NON-NLS-1$
307304
declareRegistryImage(reg, IApiToolsConstants.IMG_ELCL_EXPANDALL, ELCL + "expandall.png"); //$NON-NLS-1$
308305
declareRegistryImage(reg, IApiToolsConstants.IMG_ELCL_TEXT_EDIT, ELCL + "text_edit.png"); //$NON-NLS-1$
309-
// disabled images
310-
declareRegistryImage(reg, IApiToolsConstants.IMG_DLCL_EXPORT, DLCL + "export.png"); //$NON-NLS-1$
311-
declareRegistryImage(reg, IApiToolsConstants.IMG_DLCL_NEXT_NAV, DLCL + "next_nav.png"); //$NON-NLS-1$
312-
declareRegistryImage(reg, IApiToolsConstants.IMG_DLCL_PREV_NAV, DLCL + "prev_nav.png"); //$NON-NLS-1$
313-
declareRegistryImage(reg, IApiToolsConstants.IMG_DLCL_EXPANDALL, DLCL + "expandall.png"); //$NON-NLS-1$
314306
}
315307

316308
void showAPIToolingView() {

apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/IApiToolsConstants.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ public interface IApiToolsConstants {
5555
public static final String IMG_ELCL_COMPARE_APIS = "IMG_ELCL_COMPARE_APIS"; //$NON-NLS-1$
5656

5757
public static final String IMG_ELCL_CONFIG_SEV = "IMG_ELCL_CONFIG_SEV"; //$NON-NLS-1$
58-
/**
59-
* Key for a compare api disabled image
60-
*/
61-
public static final String IMG_ELCL_COMPARE_APIS_DISABLED = "IMG_ELCL_COMPARE_APIS_DISABLED"; //$NON-NLS-1$
6258
/**
6359
* Key for filter resolution image
6460
*/
@@ -152,10 +148,6 @@ public interface IApiToolsConstants {
152148
* Key for enabled export image
153149
*/
154150
public static final String IMG_ELCL_EXPORT = "IMG_ELCL_EXPORT"; //$NON-NLS-1$
155-
/**
156-
* Key for disabled export image
157-
*/
158-
public static final String IMG_DLCL_EXPORT = "IMG_DLCL_EXPORT"; //$NON-NLS-1$
159151
/**
160152
* Key for enabled next navigation image
161153
*/
@@ -164,20 +156,8 @@ public interface IApiToolsConstants {
164156
* Key for enabled previous navigation image
165157
*/
166158
public static final String IMG_ELCL_PREV_NAV = "IMG_ELCL_PREV_NAV"; //$NON-NLS-1$
167-
/**
168-
* Key for disabled next navigation image
169-
*/
170-
public static final String IMG_DLCL_NEXT_NAV = "IMG_DLCL_NEXT_NAV"; //$NON-NLS-1$
171-
/**
172-
* Key for disabled previous navigation image
173-
*/
174-
public static final String IMG_DLCL_PREV_NAV = "IMG_DLCL_PREV_NAV"; //$NON-NLS-1$
175159
/**
176160
* Key for enabled expand all image
177161
*/
178162
public static final String IMG_ELCL_EXPANDALL = "IMG_ELCL_EXPANDALL"; //$NON-NLS-1$
179-
/**
180-
* Key for disabled expand all image
181-
*/
182-
public static final String IMG_DLCL_EXPANDALL = "IMG_DLCL_EXPANDALL"; //$NON-NLS-1$
183163
}

apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/actions/ExpandAllAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public ExpandAllAction(TreeViewer viewer) {
3131
setToolTipText(ActionMessages.ExpandAllAction_tooltip);
3232
ImageDescriptor enabledImageDescriptor = ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_ELCL_EXPANDALL);
3333
setImageDescriptor(enabledImageDescriptor);
34-
ImageDescriptor disabledImageDescriptor = ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_DLCL_EXPANDALL);
35-
setDisabledImageDescriptor(disabledImageDescriptor);
3634
fViewer = viewer;
3735
}
3836

apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/actions/ExportSessionAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ public ExportSessionAction(APIToolingView view) {
6262
setToolTipText(ActionMessages.ExportSessionAction_tooltip);
6363
ImageDescriptor enabledImageDescriptor = ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_ELCL_EXPORT);
6464
setImageDescriptor(enabledImageDescriptor);
65-
ImageDescriptor disabledImageDescriptor = ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_DLCL_EXPORT);
66-
setDisabledImageDescriptor(disabledImageDescriptor);
6765
setEnabled(false);
6866
this.view = view;
6967
}

apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/actions/NavigateAction.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public NavigateAction(APIToolingView view, boolean next) {
4141
setToolTipText(ActionMessages.NextAction_tooltip);
4242
ImageDescriptor enabledImageDescriptor = ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_ELCL_NEXT_NAV);
4343
setImageDescriptor(enabledImageDescriptor);
44-
ImageDescriptor disabledImageDescriptor = ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_DLCL_NEXT_NAV);
45-
setDisabledImageDescriptor(disabledImageDescriptor);
4644
setActionDefinitionId(ActionFactory.NEXT.getCommandId());
4745
if (bars != null) {
4846
bars.setGlobalActionHandler(ActionFactory.NEXT.getId(), this);
@@ -52,8 +50,6 @@ public NavigateAction(APIToolingView view, boolean next) {
5250
setToolTipText(ActionMessages.PreviousAction_tooltip);
5351
ImageDescriptor enabledImageDescriptor = ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_ELCL_PREV_NAV);
5452
setImageDescriptor(enabledImageDescriptor);
55-
ImageDescriptor disabledImageDescriptor = ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_DLCL_PREV_NAV);
56-
setDisabledImageDescriptor(disabledImageDescriptor);
5753
setActionDefinitionId(ActionFactory.PREVIOUS.getCommandId());
5854
if (bars != null) {
5955
bars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), this);

apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/actions/SelectSessionAction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public SelectSessionAction() {
3838
setText(ActionMessages.SelectSessionAction_label);
3939
setToolTipText(ActionMessages.SelectSessionAction_tooltip);
4040
setImageDescriptor(ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_ELCL_COMPARE_APIS));
41-
setDisabledImageDescriptor(ApiUIPlugin.getImageDescriptor(IApiToolsConstants.IMG_ELCL_COMPARE_APIS_DISABLED));
4241
setMenuCreator(this);
4342
setEnabled(false);
4443
}

ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/views/repository/RepositoriesView.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ private void setPrefrences(BndPreferences preferences) {
513513
offlineAction.setChecked(false);
514514
offlineAction.setToolTipText("Go Offline");
515515
offlineAction.setImageDescriptor(Resources.getImageDescriptor("connect.png"));
516-
offlineAction.setDisabledImageDescriptor(Resources.getImageDescriptor("connect_d.png"));
517516
offlineAction.setEnabled(false);
518517
return;
519518
}
@@ -526,12 +525,10 @@ protected void updateOfflineAction(boolean offline) {
526525
offlineAction.setChecked(true);
527526
offlineAction.setToolTipText("Go Online");
528527
offlineAction.setImageDescriptor(Resources.getImageDescriptor("disconnect.png"));
529-
offlineAction.setDisabledImageDescriptor(Resources.getImageDescriptor("disconnect_d.png"));
530528
} else {
531529
offlineAction.setChecked(false);
532530
offlineAction.setToolTipText("Go Offline");
533531
offlineAction.setImageDescriptor(Resources.getImageDescriptor("connect.png"));
534-
offlineAction.setDisabledImageDescriptor(Resources.getImageDescriptor("connect_d.png"));
535532
}
536533
offlineAction.setEnabled(true);
537534
}
@@ -622,7 +619,6 @@ public void run() {
622619
collapseAllAction.setText("Collapse All");
623620
collapseAllAction.setToolTipText("Collapse All");
624621
collapseAllAction.setImageDescriptor(Resources.getImageDescriptor("collapseall.png"));
625-
collapseAllAction.setDisabledImageDescriptor(Resources.getImageDescriptor("collapseall_d.png"));
626622

627623
refreshAction = new Action() {
628624
@Override
@@ -658,7 +654,6 @@ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
658654
refreshAction.setText("Refresh");
659655
refreshAction.setToolTipText("Refresh Repositories Tree");
660656
refreshAction.setImageDescriptor(Resources.getImageDescriptor("arrow_refresh.png"));
661-
refreshAction.setDisabledImageDescriptor(Resources.getImageDescriptor("arrow_refresh_d.png"));
662657

663658
addBundlesAction = new Action() {
664659
@Override
@@ -681,7 +676,6 @@ public void run() {
681676
addBundlesAction.setText("Add");
682677
addBundlesAction.setToolTipText("Add Bundles to Repository");
683678
addBundlesAction.setImageDescriptor(Resources.getImageDescriptor("add_obj.png"));
684-
addBundlesAction.setDisabledImageDescriptor(Resources.getImageDescriptor("add_obj_d.png"));
685679

686680
advancedSearchAction = new Action("Advanced Search", IAction.AS_CHECK_BOX) {
687681
@Override
@@ -728,7 +722,6 @@ public void run() {
728722
advancedSearchAction.setText("Advanced Search");
729723
advancedSearchAction.setToolTipText("Toggle Advanced Search");
730724
advancedSearchAction.setImageDescriptor(Resources.getImageDescriptor("search.png"));
731-
advancedSearchAction.setDisabledImageDescriptor(Resources.getImageDescriptor("search_d.png"));
732725

733726
downloadAction = new Action() {
734727
@Override
@@ -781,7 +774,6 @@ private <T> List<T> selectionByType(IStructuredSelection selection, Class<T> typ
781774
downloadAction.setEnabled(false);
782775
downloadAction.setText("Download Repository Content");
783776
downloadAction.setImageDescriptor(Resources.getImageDescriptor("download.png"));
784-
downloadAction.setDisabledImageDescriptor(Resources.getImageDescriptor("download_d.png"));
785777

786778
offlineAction = new Action("Online/Offline Mode", IAction.AS_CHECK_BOX) {
787779
@Override
@@ -795,7 +787,6 @@ public void run() {
795787
offlineAction.setEnabled(false);
796788
offlineAction.setToolTipText("Go Offline");
797789
offlineAction.setImageDescriptor(Resources.getImageDescriptor("connect.png"));
798-
offlineAction.setDisabledImageDescriptor(Resources.getImageDescriptor("connect_d.png"));
799790

800791
viewer.addSelectionChangedListener(event -> {
801792
IStructuredSelection selection = (IStructuredSelection) event.getSelection();

ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePluginImages.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class PDERuntimePluginImages {
2828
public final static String ICONS_PATH = "icons/"; //$NON-NLS-1$
2929

3030
private static final String PATH_OBJ = ICONS_PATH + "obj16/"; //$NON-NLS-1$
31-
private static final String PATH_DCL = ICONS_PATH + "dlcl16/"; //$NON-NLS-1$
3231
private static final String PATH_LCL = ICONS_PATH + "elcl16/"; //$NON-NLS-1$
3332
private static final String PATH_OVR = ICONS_PATH + "ovr16/"; //$NON-NLS-1$
3433

@@ -57,7 +56,6 @@ public class PDERuntimePluginImages {
5756
public static final ImageDescriptor COPY_QNAME = create(PATH_LCL, IMG_COPY_QNAME);
5857
public static final ImageDescriptor UP_NAV = create(PATH_LCL, IMG_UP_NAV);
5958

60-
public static final ImageDescriptor DESC_REFRESH_DISABLED = create(PATH_DCL, "refresh.png"); //$NON-NLS-1$
6159
public static final ImageDescriptor DESC_REFRESH = create(PATH_LCL, "refresh.svg"); //$NON-NLS-1$
6260
public static final ImageDescriptor DESC_COLLAPSE_ALL = create(PATH_LCL, "collapseall.svg"); //$NON-NLS-1$
6361
public static final ImageDescriptor DESC_EXT_POINT_OBJ = create(PATH_OBJ, "ext_point_obj.svg"); //$NON-NLS-1$

ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ public void run() {
412412
fRefreshAction.setText(PDERuntimeMessages.RegistryView_refresh_label);
413413
fRefreshAction.setToolTipText(PDERuntimeMessages.RegistryView_refresh_tooltip);
414414
fRefreshAction.setImageDescriptor(PDERuntimePluginImages.DESC_REFRESH);
415-
fRefreshAction.setDisabledImageDescriptor(PDERuntimePluginImages.DESC_REFRESH_DISABLED);
416415

417416
fShowPluginsAction = new Action(PDERuntimeMessages.RegistryView_showRunning_label) {
418417
@Override

ui/org.eclipse.pde.ui.tests/tests/performance/plugin/org.eclipse.jdt.ui/plugin.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,6 @@
11251125
toolbarPath="org.eclipse.ui.edit.text.actionSet.presentation/Presentation"
11261126
id="org.eclipse.jdt.ui.edit.text.java.toggleMarkOccurrences"
11271127
definitionId="org.eclipse.jdt.ui.edit.text.java.toggleMarkOccurrences"
1128-
disabledIcon="$nl$/icons/full/dtool16/mark_occurrences.gif"
11291128
icon="$nl$/icons/full/etool16/mark_occurrences.gif"
11301129
helpContextId="toggle_mark_occurrences_action_context"
11311130
label="%toggleMarkOccurrences.label"
@@ -1515,7 +1514,6 @@
15151514
id="org.eclipse.jdt.ui.actions.NewTypeDropDown"
15161515
toolbarPath="Normal/JavaWizards"
15171516
class="org.eclipse.jdt.internal.ui.wizards.NewTypeDropDownAction"
1518-
disabledIcon="$nl$/icons/full/dtool16/newclass_wiz.gif"
15191517
icon="$nl$/icons/full/etool16/newclass_wiz.gif"
15201518
label="%OpenClassWizardAction.label"
15211519
style="pulldown"

0 commit comments

Comments
 (0)