[jsword-svn] r1779 - trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Sat Mar 8 19:53:29 MST 2008


Author: dmsmith
Date: 2008-03-08 19:53:28 -0700 (Sat, 08 Mar 2008)
New Revision: 1779

Modified:
   trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ToolBar.java
Log:
Made large toolbar icons the default.

Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ToolBar.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ToolBar.java	2008-03-08 22:52:30 UTC (rev 1778)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ToolBar.java	2008-03-09 02:53:28 UTC (rev 1779)
@@ -48,6 +48,7 @@
  * <li>small/large icons</li>
  * <li>showing/hiding toolbar</li>
  * </ul>
+ * It starts with large icons.
  *
  * @see gnu.lgpl.License for license details.
  *      The copyright to this program is held by it's authors.
@@ -74,6 +75,16 @@
         GuiUtil.applyDefaultOrientation(this);
     }
 
+    /* (non-Javadoc)
+     * @see javax.swing.JToolBar#add(javax.swing.Action)
+     */
+    public JButton add(Action a)
+    {
+        JButton button = super.add(a);
+        button.setIcon((Icon) a.getValue(CWAction.LARGE_ICON));
+        return button;
+    }
+
     /**
      * Show or hide the tool bar.
      * @param show indicates whether the toolbar is visible
@@ -105,7 +116,7 @@
 
     /**
      * Set the tool tip text for the buttons on the tool bar.
-     * @param show indicates whether the buttons should be labelled
+     * @param show indicates whether the buttons should be labeled
      */
     public void showText(boolean show)
     {
@@ -191,7 +202,9 @@
      */
     public JMenuItem getIconSizeToggle()
     {
-        return new JCheckBoxMenuItem(actions.getAction(TOOLBAR_LARGE));
+        JCheckBoxMenuItem toggle = new JCheckBoxMenuItem(actions.getAction(TOOLBAR_LARGE));
+        toggle.setSelected(true);
+        return toggle;
     }
 
     /**




More information about the jsword-svn mailing list