Index: openide/loaders/src/org/openide/awt/Toolbar.java
===================================================================
RCS file: /cvs/openide/loaders/src/org/openide/awt/Toolbar.java,v
retrieving revision 1.12
diff -c -r1.12 Toolbar.java
*** openide/loaders/src/org/openide/awt/Toolbar.java 5 May 2004 18:50:28 -0000 1.12
--- openide/loaders/src/org/openide/awt/Toolbar.java 13 May 2004 09:48:23 -0000
***************
*** 36,44 ****
* @author David Peroutka, Libor Kramolis
*/
public class Toolbar extends JToolBar /*implemented by patchsuperclass MouseInputListener*/ {
! /** Basic toolbar height. */
public static final int BASIC_HEIGHT = 34;
!
/** 5 pixels is tolerance of toolbar height so toolbar can be high (BASIC_HEIGHT + HEIGHT_TOLERANCE)
but it will be set to BASIC_HEIGHT high. */
static int HEIGHT_TOLERANCE = 5;
--- 36,45 ----
* @author David Peroutka, Libor Kramolis
*/
public class Toolbar extends JToolBar /*implemented by patchsuperclass MouseInputListener*/ {
! /** Basic toolbar height.
! @deprecated Use getBasicHeight instead. */
public static final int BASIC_HEIGHT = 34;
!
/** 5 pixels is tolerance of toolbar height so toolbar can be high (BASIC_HEIGHT + HEIGHT_TOLERANCE)
but it will be set to BASIC_HEIGHT high. */
static int HEIGHT_TOLERANCE = 5;
***************
*** 148,153 ****
--- 149,167 ----
initAll(name, f);
}
+ /** Returns basic toolbar height according to preferred icons size. Used by
+ * toolbar layout manager.
+ * @return basic toolbar height
+ * @since 4.15
+ */
+ public static int getBasicHeight () {
+ if (ToolbarPool.getDefault().getPreferredIconSize() == 24) {
+ return 44;
+ } else {
+ return 34;
+ }
+ }
+
private void initAll(String name, boolean f) {
floatable = f;
mouseListener = null;
***************
*** 195,208 ****
String lf = UIManager.getLookAndFeel().getName();
String lfid = UIManager.getLookAndFeel().getID();
int minheight;
! if ("Aqua".equals(lfid)) {
! minheight = 29;
! } else if ("Metal".equals(lf)) {
! minheight = 36;
! } else if ("Windows".equals(lf)) {
! minheight = isXPTheme() ? 23 : 27;
} else {
! minheight = 28;
}
Dimension result = super.getPreferredSize();
result.height = Math.max (result.height, minheight);
--- 209,234 ----
String lf = UIManager.getLookAndFeel().getName();
String lfid = UIManager.getLookAndFeel().getID();
int minheight;
! if (ToolbarPool.getDefault().getPreferredIconSize() == 24) {
! if ("Aqua".equals(lfid)) {
! minheight = 29 + 8;
! } else if ("Metal".equals(lf)) {
! minheight = 36 + 8;
! } else if ("Windows".equals(lf)) {
! minheight = isXPTheme() ? (23 + 8) : (27 + 8);
! } else {
! minheight = 28 + 8;
! }
} else {
! if ("Aqua".equals(lfid)) {
! minheight = 29;
! } else if ("Metal".equals(lf)) {
! minheight = 36;
! } else if ("Windows".equals(lf)) {
! minheight = isXPTheme() ? 23 : 27;
! } else {
! minheight = 28;
! }
}
Dimension result = super.getPreferredSize();
result.height = Math.max (result.height, minheight);
***************
*** 246,252 ****
* @return number of rows
*/
static public int rowCount (int height) {
! return 1 + height / (BASIC_HEIGHT + HEIGHT_TOLERANCE);
}
/** Set DnDListener to Toolbar.
--- 272,278 ----
* @return number of rows
*/
static public int rowCount (int height) {
! return 1 + height / (getBasicHeight() + HEIGHT_TOLERANCE);
}
/** Set DnDListener to Toolbar.
***************
*** 465,476 ****
--- 491,510 ----
Toolbar.this.removeAll();
setBorder(null);
}
+ if (obj instanceof JComponent) {
+ if (ToolbarPool.getDefault().getPreferredIconSize() == 24) {
+ ((JComponent) obj).putClientProperty("PreferredIconSize","24"); //NOI18N
+ }
+ }
Toolbar.this.add ((Component)obj);
continue;
}
if (obj instanceof Action) {
Action a = (Action)obj;
JButton b = new JButton();
+ if (ToolbarPool.getDefault().getPreferredIconSize() == 24) {
+ b.putClientProperty("PreferredIconSize","24"); //NOI18N
+ }
Actions.connect (b, a);
Toolbar.this.add (b);
continue;
Index: openide/loaders/src/org/openide/awt/ToolbarPool.java
===================================================================
RCS file: /cvs/openide/loaders/src/org/openide/awt/ToolbarPool.java,v
retrieving revision 1.10
diff -c -r1.10 ToolbarPool.java
*** openide/loaders/src/org/openide/awt/ToolbarPool.java 15 Apr 2004 09:10:12 -0000 1.10
--- openide/loaders/src/org/openide/awt/ToolbarPool.java 13 May 2004 09:48:23 -0000
***************
*** 71,76 ****
--- 71,79 ----
private TPTaskListener taskListener;
+ /** Preferred icon size. 2 sizes are supported now: 16 and 24. */
+ private int preferredIconSize = 24;
+
/**
* Returns default toolbar pool.
* @return default system pool
***************
*** 137,143 ****
super.removeNotify();
}
}
!
public Border getBorder() {
//Issue 36867, hide border if there are no toolbars. Not the most
--- 140,166 ----
super.removeNotify();
}
}
!
! /** Returns preferred size of icons used by toolbar buttons. Default icons size
! * is 16x16. Icon size 24x24 is also supported.
! * @return preferred size of toolbar icons in pixels
! * @since 4.15
! */
! public int getPreferredIconSize () {
! return preferredIconSize;
! }
!
! /** Sets preferred size of icons used by toolbar buttons.
! * @param preferred size of toolbar icons in pixels. 2 values are now
! * supported: 16 and 24
! * @since 4.15
! */
! public void setPreferredIconSize (int preferredIconSize) {
! if ((preferredIconSize != 16) && (preferredIconSize != 24)) {
! throw new IllegalArgumentException("Unsupported argument value:" + preferredIconSize);
! }
! this.preferredIconSize = preferredIconSize;
! }
public Border getBorder() {
//Issue 36867, hide border if there are no toolbars. Not the most
Index: openide/src/org/openide/awt/Actions.java
===================================================================
RCS file: /cvs/openide/src/org/openide/awt/Actions.java,v
retrieving revision 1.93
diff -c -r1.93 Actions.java
*** openide/src/org/openide/awt/Actions.java 7 Apr 2004 23:44:31 -0000 1.93
--- openide/src/org/openide/awt/Actions.java 13 May 2004 09:48:24 -0000
***************
*** 374,397 ****
button.addActionListener(action);
this.button = button;
}
!
protected void updateButtonIcon() {
Object i = null;
! if (action instanceof SystemAction) {
! SystemAction sa = (SystemAction)action;
! i = sa.getIcon (useTextIcons ());
! button.setIcon((Icon)i);
} else {
! i = action.getValue (Action.SMALL_ICON);
! if (i instanceof Icon) {
button.setIcon((Icon)i);
} else {
! button.setIcon(nonNullIcon(null));
}
}
! Object base = action.getValue("iconBase"); // NOI18N
if (base instanceof String) {
String b = (String) base;
if (i == null) {
// even for regular icon
Image img = Utilities.loadImage(b, true);
--- 374,453 ----
button.addActionListener(action);
this.button = button;
}
!
protected void updateButtonIcon() {
Object i = null;
! Object base = action.getValue("iconBase"); // NOI18N
! boolean useSmallIcon;
! if ("24".equals(button.getClientProperty("PreferredIconSize"))) { //NOI18N
! useSmallIcon = false;
} else {
! useSmallIcon = true;
! }
! if (action instanceof SystemAction) {
! if (base instanceof String) {
! String b = (String) base;
! Image img = null;
! if (!useSmallIcon) {
! img = Utilities.loadImage(insertBeforeSuffix(b, "24"), true); // NOI18N
! if (img == null) {
! img = Utilities.loadImage(b, true);
! }
! } else {
! img = Utilities.loadImage(b, true);
! }
! if (img != null) {
! i = new ImageIcon(img);
! button.setIcon((Icon)i);
! } else {
! SystemAction sa = (SystemAction)action;
! i = sa.getIcon (useTextIcons ());
! button.setIcon((Icon)i);
! }
! } else {
! SystemAction sa = (SystemAction)action;
! i = sa.getIcon (useTextIcons ());
button.setIcon((Icon)i);
+ }
+ } else {
+ //Try to get icon from iconBase for non SystemAction action
+ if (base instanceof String) {
+ String b = (String) base;
+ Image img = null;
+ if (!useSmallIcon) {
+ img = Utilities.loadImage(insertBeforeSuffix(b, "24"), true); // NOI18N
+ if (img == null) {
+ img = Utilities.loadImage(b, true);
+ }
+ } else {
+ img = Utilities.loadImage(b, true);
+ }
+ if (img != null) {
+ i = new ImageIcon(img);
+ button.setIcon((Icon)i);
+ } else {
+ i = action.getValue (Action.SMALL_ICON);
+ if (i instanceof Icon) {
+ button.setIcon((Icon)i);
+ } else {
+ button.setIcon(nonNullIcon(null));
+ }
+ }
} else {
! i = action.getValue (Action.SMALL_ICON);
! if (i instanceof Icon) {
! button.setIcon((Icon)i);
! } else {
! button.setIcon(nonNullIcon(null));
! }
}
}
!
if (base instanceof String) {
String b = (String) base;
+ if (!useSmallIcon) {
+ b = insertBeforeSuffix(b,"24"); //NOI18N
+ }
if (i == null) {
// even for regular icon
Image img = Utilities.loadImage(b, true);
***************
*** 414,420 ****
}
}
! private static String insertBeforeSuffix(String path, String toInsert) {
String withoutSuffix = path;
String suffix = ""; // NOI18N
if (path.lastIndexOf('.') >= 0) {
--- 470,476 ----
}
}
! static String insertBeforeSuffix(String path, String toInsert) {
String withoutSuffix = path;
String suffix = ""; // NOI18N
if (path.lastIndexOf('.') >= 0) {
***************
*** 536,541 ****
--- 592,636 ----
Object s = action.getValue (Action.NAME);
if (s instanceof String) {
setMenuText (((JMenuItem)comp), (String)s, !popup);
+ }
+ }
+ }
+
+ protected void updateButtonIcon() {
+ Object i = null;
+ if (action instanceof SystemAction) {
+ SystemAction sa = (SystemAction)action;
+ i = sa.getIcon (useTextIcons ());
+ button.setIcon((Icon)i);
+ } else {
+ i = action.getValue (Action.SMALL_ICON);
+ if (i instanceof Icon) {
+ button.setIcon((Icon)i);
+ } else {
+ button.setIcon(nonNullIcon(null));
+ }
+ }
+ Object base = action.getValue("iconBase"); // NOI18N
+ if (base instanceof String) {
+ String b = (String) base;
+ if (i == null) {
+ // even for regular icon
+ Image img = Utilities.loadImage(b, true);
+ if (img != null) {
+ button.setIcon(new ImageIcon(img));
+ }
+ }
+ Image pImg = Utilities.loadImage(insertBeforeSuffix(b, "_pressed"), true); // NOI18N
+ if (pImg != null) {
+ button.setPressedIcon(new ImageIcon(pImg));
+ }
+ Image rImg = Utilities.loadImage(insertBeforeSuffix(b, "_rollover"), true); // NOI18N
+ if (rImg != null) {
+ button.setRolloverIcon(new ImageIcon(rImg));
+ }
+ Image dImg = Utilities.loadImage(insertBeforeSuffix(b, "_disabled"), true); // NOI18N
+ if (dImg != null) {
+ button.setDisabledIcon(new ImageIcon(dImg));
}
}
}
Index: core/windows/src/org/netbeans/core/windows/PersistenceHandler.java
===================================================================
RCS file: /cvs/core/windows/src/org/netbeans/core/windows/PersistenceHandler.java,v
retrieving revision 1.26
diff -c -r1.26 PersistenceHandler.java
*** core/windows/src/org/netbeans/core/windows/PersistenceHandler.java 22 Apr 2004 13:09:30 -0000 1.26
--- core/windows/src/org/netbeans/core/windows/PersistenceHandler.java 13 May 2004 09:48:26 -0000
***************
*** 17,22 ****
--- 17,23 ----
import org.netbeans.core.windows.persistence.*;
import org.openide.ErrorManager;
+ import org.openide.awt.ToolbarPool;
import org.openide.util.Utilities;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;
***************
*** 94,99 ****
--- 95,102 ----
wmc = ConfigFactory.createDefaultConfig();
}
+ ToolbarPool.getDefault().setPreferredIconSize(wmc.preferredToolbarIconSize);
+
WindowManagerImpl wm = WindowManagerImpl.getInstance();
if (wmc.tcIdViewList.length > 0) {
List tcList = new ArrayList(wmc.tcIdViewList.length);
***************
*** 370,375 ****
--- 373,380 ----
private WindowManagerConfig getConfig() {
WindowManagerConfig wmc = new WindowManagerConfig();
+
+ wmc.preferredToolbarIconSize = ToolbarPool.getDefault().getPreferredIconSize();
WindowManagerImpl wmi = WindowManagerImpl.getInstance();
Index: core/windows/src/org/netbeans/core/windows/persistence/WindowManagerConfig.java
===================================================================
RCS file: /cvs/core/windows/src/org/netbeans/core/windows/persistence/WindowManagerConfig.java,v
retrieving revision 1.3
diff -c -r1.3 WindowManagerConfig.java
*** core/windows/src/org/netbeans/core/windows/persistence/WindowManagerConfig.java 22 Apr 2004 13:09:40 -0000 1.3
--- core/windows/src/org/netbeans/core/windows/persistence/WindowManagerConfig.java 13 May 2004 09:48:26 -0000
***************
*** 164,169 ****
--- 164,171 ----
public String maximizedModeName;
/** Name of toolbar configuration. */
public String toolbarConfiguration;
+ /** Preferred size of toolbar icons. */
+ public int preferredToolbarIconSize;
/** List of ModeConfig
S. */
public ModeConfig[] modes;
/** List of GroupConfig
S. */
***************
*** 283,288 ****
--- 285,293 ----
if (!toolbarConfiguration.equals(wmCfg.toolbarConfiguration)) {
return false;
}
+ if (preferredToolbarIconSize != wmCfg.preferredToolbarIconSize) {
+ return false;
+ }
//Order of modes array is NOT defined
if (modes.length != wmCfg.modes.length) {
return false;
***************
*** 379,384 ****
--- 384,390 ----
hash = 37 * hash + activeModeName.hashCode();
hash = 37 * hash + maximizedModeName.hashCode();
hash = 37 * hash + toolbarConfiguration.hashCode();
+ hash = 37 * hash + preferredToolbarIconSize;
for (int i = 0; i < modes.length; i++) {
hash = 37 * hash + modes[i].hashCode();
}
Index: core/windows/src/org/netbeans/core/windows/persistence/WindowManagerParser.java
===================================================================
RCS file: /cvs/core/windows/src/org/netbeans/core/windows/persistence/WindowManagerParser.java,v
retrieving revision 1.11
diff -c -r1.11 WindowManagerParser.java
*** core/windows/src/org/netbeans/core/windows/persistence/WindowManagerParser.java 22 Apr 2004 13:09:41 -0000 1.11
--- core/windows/src/org/netbeans/core/windows/persistence/WindowManagerParser.java 13 May 2004 09:48:26 -0000
***************
*** 48,53 ****
--- 48,55 ----
= "-//NetBeans//DTD Window Manager Properties 1.1//EN"; // NOI18N
private static final String INSTANCE_DTD_ID_2_0
= "-//NetBeans//DTD Window Manager Properties 2.0//EN"; // NOI18N
+ private static final String INSTANCE_DTD_ID_2_1
+ = "-//NetBeans//DTD Window Manager Properties 2.1//EN"; // NOI18N
private static final boolean DEBUG = Debug.isLoggable(WindowManagerParser.class);
***************
*** 849,856 ****
public void startElement (String nameSpace, String name, String qname, Attributes attrs) throws SAXException {
if ("windowmanager".equals(qname)) { // NOI18N
handleWindowManager(attrs);
! } else if (internalConfig.specVersion.compareTo(new SpecificationVersion("2.0")) == 0) {
! //Parse version 2.0
if ("main-window".equals(qname)) { // NOI18N
handleMainWindow(attrs);
} else if ("joined-properties".equals(qname)) { // NOI18N
--- 851,858 ----
public void startElement (String nameSpace, String name, String qname, Attributes attrs) throws SAXException {
if ("windowmanager".equals(qname)) { // NOI18N
handleWindowManager(attrs);
! } else if (internalConfig.specVersion.compareTo(new SpecificationVersion("2.0")) >= 0) { //NOI18N
! //Parse version 2.0 and 2.1
if ("main-window".equals(qname)) { // NOI18N
handleMainWindow(attrs);
} else if ("joined-properties".equals(qname)) { // NOI18N
***************
*** 1610,1615 ****
--- 1612,1633 ----
} else {
winMgrConfig.toolbarConfiguration = ""; // NOI18N
}
+ String prefIconSize = attrs.getValue("preferred-icon-size"); // NOI18N
+ if (prefIconSize != null) {
+ try {
+ winMgrConfig.preferredToolbarIconSize = Integer.parseInt(prefIconSize);
+ } catch (NumberFormatException exc) {
+ ErrorManager em = ErrorManager.getDefault();
+ em.log(ErrorManager.WARNING,
+ "[WinSys.WindowManagerParser.handleToolbar]" // NOI18N
+ + " Warning: Cannot read attribute \"preferred-icon-size\"" //NOI18N
+ + " of element \"relative-bounds\"."); // NOI18N
+ em.notify(ErrorManager.INFORMATIONAL,exc);
+ winMgrConfig.preferredToolbarIconSize = 24;
+ }
+ } else {
+ winMgrConfig.preferredToolbarIconSize = 24;
+ }
}
/** Reads element "tc-id" and updates window manager config content */
***************
*** 1753,1759 ****
/*buff.append("\n\n"); // NOI18N*/
! append("\n"); // NOI18N
appendMainWindow(wmc, buff);
appendEditorArea(wmc, buff);
--- 1771,1777 ----
/*buff.append("\n\n"); // NOI18N*/
! append("\n"); // NOI18N
appendMainWindow(wmc, buff);
appendEditorArea(wmc, buff);
***************
*** 1858,1866 ****
}
private void appendToolbar (WindowManagerConfig wmc, StringBuffer buff) {
! if ((wmc.toolbarConfiguration != null) && !"".equals(wmc.toolbarConfiguration)) {
! buff.append(" \n"); // NOI18N
}
}
private void appendRecentViewList (WindowManagerConfig wmc, StringBuffer buff) {
--- 1876,1886 ----
}
private void appendToolbar (WindowManagerConfig wmc, StringBuffer buff) {
! buff.append(" \n"); //NOI18N
}
private void appendRecentViewList (WindowManagerConfig wmc, StringBuffer buff) {
***************
*** 1908,1914 ****
throws SAXException {
if (INSTANCE_DTD_ID_1_0.equals(publicId)
|| INSTANCE_DTD_ID_1_1.equals(publicId)
! || INSTANCE_DTD_ID_2_0.equals(publicId)) {
InputStream is = new ByteArrayInputStream(new byte[0]);
//getClass().getResourceAsStream(INSTANCE_DTD_LOCAL);
// if (is == null) {
--- 1928,1935 ----
throws SAXException {
if (INSTANCE_DTD_ID_1_0.equals(publicId)
|| INSTANCE_DTD_ID_1_1.equals(publicId)
! || INSTANCE_DTD_ID_2_0.equals(publicId)
! || INSTANCE_DTD_ID_2_1.equals(publicId)) {
InputStream is = new ByteArrayInputStream(new byte[0]);
//getClass().getResourceAsStream(INSTANCE_DTD_LOCAL);
// if (is == null) {
Index: core/windows/src/org/netbeans/core/windows/resources/windowmanager/windowmanager.wswmgr
===================================================================
RCS file: /cvs/core/windows/src/org/netbeans/core/windows/resources/windowmanager/windowmanager.wswmgr,v
retrieving revision 1.6
diff -c -r1.6 windowmanager.wswmgr
*** core/windows/src/org/netbeans/core/windows/resources/windowmanager/windowmanager.wswmgr 10 Feb 2004 15:35:47 -0000 1.6
--- core/windows/src/org/netbeans/core/windows/resources/windowmanager/windowmanager.wswmgr 13 May 2004 09:48:27 -0000
***************
*** 1,10 ****
!
--- 1,10 ----
!
***************
*** 21,25 ****
!
--- 21,25 ----
!
Index: core/windows/src/org/netbeans/core/windows/view/ui/toolbars/Bundle.properties
===================================================================
RCS file: /cvs/core/windows/src/org/netbeans/core/windows/view/ui/toolbars/Bundle.properties,v
retrieving revision 1.3
diff -c -r1.3 Bundle.properties
*** core/windows/src/org/netbeans/core/windows/view/ui/toolbars/Bundle.properties 6 Feb 2004 15:06:35 -0000 1.3
--- core/windows/src/org/netbeans/core/windows/view/ui/toolbars/Bundle.properties 13 May 2004 09:48:27 -0000
***************
*** 15,20 ****
--- 15,21 ----
PROP_saveName=Configuration
PROP_saveLabel=&Name:
PROP_saveDialog=Save Toolbar Configuration
+ PROP_smallToolbarIcons=Small Toolbar Icons
MSG_replaceConfiguration=Configuration {0} already exists.\n Do you want to replace it?
CTL_DisplayToolbars=Customize Toolbars...
Index: core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConfiguration.java
===================================================================
RCS file: /cvs/core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConfiguration.java,v
retrieving revision 1.14
diff -c -r1.14 ToolbarConfiguration.java
*** core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConfiguration.java 22 Apr 2004 13:10:20 -0000 1.14
--- core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConfiguration.java 13 May 2004 09:48:27 -0000
***************
*** 568,577 ****
tb = tbs[i];
name = tb.getName();
tc = (ToolbarConstraints)allToolbars.get (name);
! if (tc == null) { /* If there is no toolbar constraints description defined yet ... */
if (newRow == null)
newRow = createLastRow();
! tc = new ToolbarConstraints (this, name, null, Boolean.TRUE); /* ... there is created a new constraints. */
addToolbar (newRow, tc);
someBarAdded = true;
}
--- 568,577 ----
tb = tbs[i];
name = tb.getName();
tc = (ToolbarConstraints)allToolbars.get (name);
! if (tc == null) { /* If there is no toolbar constraints description defined yet ... */
if (newRow == null)
newRow = createLastRow();
! tc = new ToolbarConstraints (this, name, null, Boolean.TRUE); /* ... there is created a new constraints. */
addToolbar (newRow, tc);
someBarAdded = true;
}
***************
*** 581,587 ****
revalidateWindow();
}
!
/**
* @return true if if important reactivate component.
*/
--- 581,628 ----
revalidateWindow();
}
!
! /** Rebuild toolbar panel when size of icons is changed.
! * All components are removed and again added using ToolbarPool's list of correct toolbars.
! */
! private void rebuildPanel () {
! toolbarPanel().removeAll();
! prefWidth = 0;
!
! Toolbar tbs[] = toolbarPool ().getToolbars();
! Toolbar tb;
! ToolbarConstraints tc;
! String name;
! ToolbarRow newRow = null;
! boolean someBarAdded = false;
! boolean smallToolbarIcons = (ToolbarPool.getDefault().getPreferredIconSize() == 16);
! for (int i = 0; i < tbs.length; i++) {
! tb = tbs[i];
! name = tb.getName();
! Component [] comps = tb.getComponents();
! for (int j = 0; j < comps.length; j++) {
! if (comps[j] instanceof JComponent) {
! if (smallToolbarIcons) {
! ((JComponent) comps[j]).putClientProperty("PreferredIconSize",""); //NOI18N
! } else {
! ((JComponent) comps[j]).putClientProperty("PreferredIconSize","24"); //NOI18N
! }
! }
! }
! tc = (ToolbarConstraints)allToolbars.get (name);
! if (tc == null) { /* If there is no toolbar constraints description defined yet ... */
! if (newRow == null) {
! newRow = createLastRow();
! }
! tc = new ToolbarConstraints (this, name, null, Boolean.TRUE); /* ... there is created a new constraints. */
! addToolbar (newRow, tc);
! someBarAdded = true;
! }
! toolbarPanel().add (tb, tc);
! }
! revalidateWindow();
! }
!
/**
* @return true if if important reactivate component.
*/
***************
*** 715,720 ****
--- 756,786 ----
menu.add (mi);
}
}
+ menu.add (new JPopupMenu.Separator());
+
+ //Bigger toolbar icons
+ boolean smallToolbarIcons = (ToolbarPool.getDefault().getPreferredIconSize() == 16);
+
+ JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem (
+ getBundleString("PROP_smallToolbarIcons"), smallToolbarIcons
+ );
+ cbmi.addActionListener (new ActionListener () {
+ public void actionPerformed (ActionEvent ev) {
+ if (ev.getSource() instanceof JCheckBoxMenuItem) {
+ JCheckBoxMenuItem cb = (JCheckBoxMenuItem) ev.getSource();
+ boolean state = cb.getState();
+ if (state) {
+ ToolbarPool.getDefault().setPreferredIconSize(16);
+ } else {
+ ToolbarPool.getDefault().setPreferredIconSize(24);
+ }
+ //Rebuild toolbars
+ rebuildPanel();
+ }
+ }
+ });
+ menu.add (cbmi);
+
menu.add (new JPopupMenu.Separator());
// generate list of available toolbar configurations
List configList = Arrays.asList (ToolbarPool.getDefault ().getConfigurations ());
Index: core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarDnDListener.java
===================================================================
RCS file: /cvs/core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarDnDListener.java,v
retrieving revision 1.2
diff -c -r1.2 ToolbarDnDListener.java
*** core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarDnDListener.java 12 Nov 2003 07:52:24 -0000 1.2
--- core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarDnDListener.java 13 May 2004 09:48:27 -0000
***************
*** 25,33 ****
* @author Libor Kramolis
*/
public class ToolbarDnDListener extends Object implements Toolbar.DnDListener {
- protected static final int BASIC_HEIGHT_2 = (Toolbar.BASIC_HEIGHT/2) + 2;
- protected static final int BASIC_HEIGHT_4 = (Toolbar.BASIC_HEIGHT/4) + 1;
-
/** now dragged toolbar */
private ToolbarConstraints draggedToolbar;
private ToolbarConfiguration configuration;
--- 25,30 ----
***************
*** 86,92 ****
* @param dy vertical distance
*/
protected void moveUp (ToolbarConstraints tc, int dy) {
! if (dy < BASIC_HEIGHT_2)
return;
int rI = tc.rowIndex();
--- 83,89 ----
* @param dy vertical distance
*/
protected void moveUp (ToolbarConstraints tc, int dy) {
! if (dy < ((Toolbar.getBasicHeight() / 2) + 2))
return;
int rI = tc.rowIndex();
***************
*** 117,128 ****
public void moveDown (ToolbarConstraints tc, int dy) {
int rI = tc.rowIndex();
! int step = BASIC_HEIGHT_2;
if (draggedToolbar.isAlone()) { // is alone on row(s) -> no new rows
if (rI == (configuration.getRowCount() - tc.getRowCount())) // in last rows
return;
! step = BASIC_HEIGHT_4;
}
if (dy < step)
--- 114,125 ----
public void moveDown (ToolbarConstraints tc, int dy) {
int rI = tc.rowIndex();
! int step = ((Toolbar.getBasicHeight() / 2) + 2);
if (draggedToolbar.isAlone()) { // is alone on row(s) -> no new rows
if (rI == (configuration.getRowCount() - tc.getRowCount())) // in last rows
return;
! step = ((Toolbar.getBasicHeight() / 4) + 2);
}
if (dy < step)
Index: core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarRow.java
===================================================================
RCS file: /cvs/core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarRow.java,v
retrieving revision 1.3
diff -c -r1.3 ToolbarRow.java
*** core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarRow.java 22 Apr 2004 13:10:21 -0000 1.3
--- core/windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarRow.java 13 May 2004 09:48:27 -0000
***************
*** 320,326 ****
}
}
}
! prefHeight = prefHeight <= 0 ? Toolbar.BASIC_HEIGHT : Math.min(Toolbar.BASIC_HEIGHT, prefHeight);
return prefHeight;
}
--- 320,326 ----
}
}
}
! prefHeight = prefHeight <= 0 ? Toolbar.getBasicHeight() : Math.min(Toolbar.getBasicHeight(), prefHeight);
return prefHeight;
}