### Eclipse Workspace Patch 1.0 #P org.eclipse.gef Index: src/org/eclipse/gef/palette/PaletteDrawer.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.gef/src/org/eclipse/gef/palette/PaletteDrawer.java,v retrieving revision 1.12 diff -u -r1.12 PaletteDrawer.java --- src/org/eclipse/gef/palette/PaletteDrawer.java 30 Mar 2005 21:27:02 -0000 1.12 +++ src/org/eclipse/gef/palette/PaletteDrawer.java 31 Jan 2008 21:21:42 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -56,6 +56,7 @@ private int initialState; private Object drawerType; +private boolean showDefaultIcon = true; /** * Constructor @@ -157,5 +158,28 @@ initialState = state; listeners.firePropertyChange(PROPERTY_INITIAL_STATUS, oldState, state); } - + +/** + * Should the default icon be shown for this drawer if no icon is set? + * + * @return true if the default icon should be shown if no icon is set; false + * otherwise + * @since 3.4 + */ +public boolean showDefaultIcon() { + return showDefaultIcon; +} + +/** + * Should the default icon be shown for this drawer if no icon is set? + * + * @param showDefaultIcon + * true if the default icon should be shown if no icon is set; false + * otherwise + * @since 3.4 + */ +public void setShowDefaultIcon(boolean showDefaultIcon) { + this.showDefaultIcon = showDefaultIcon; +} + } Index: src/org/eclipse/gef/internal/ui/palette/editparts/DrawerEditPart.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.gef/src/org/eclipse/gef/internal/ui/palette/editparts/DrawerEditPart.java,v retrieving revision 1.24 diff -u -r1.24 DrawerEditPart.java --- src/org/eclipse/gef/internal/ui/palette/editparts/DrawerEditPart.java 19 Oct 2007 19:47:06 -0000 1.24 +++ src/org/eclipse/gef/internal/ui/palette/editparts/DrawerEditPart.java 31 Jan 2008 21:21:42 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -188,8 +188,8 @@ protected void refreshVisuals() { getDrawerFigure().setToolTip(createToolTip()); - ImageDescriptor img = getPaletteEntry().getSmallIcon(); - if (img == null) { + ImageDescriptor img = getDrawer().getSmallIcon(); + if (img == null && getDrawer().showDefaultIcon()) { img = InternalImages.DESC_FOLDER_OPEN; } setImageDescriptor(img);