Author: bobtarling
Date: 2010-04-12 09:52:36-0700
New Revision: 18243
Modified:
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java
Log:
Hide the action name of a toolbutton by placing it in a toolbar.
Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java?view=diff&pathrev=18243&r1=18242&r2=18243
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java (original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java 2010-04-12 09:52:36-0700
@@ -50,24 +50,25 @@
* @return the panel containing the actions required.
*/
protected JPanel createSingleButtonPanel(List<Action> actions) {
- JPanel buttonPanel =
+ final JPanel buttonPanel =
new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));
- final ToolButton tb;
+ final JToolBar toolbar;
if (actions.size() == 1) {
- tb = new ToolButton(actions.get(0));
- // TODO: Following is only in Java 6 and later
-// tb.setHideActionText(true);
+ final ToolButton tb = new ToolButton(actions.get(0));
+ final ToolBarFactory tbf = new ToolBarFactory(actions);
+ toolbar = tbf.createToolBar();
+ toolbar.setRollover(true);
} else {
- PopupToolBoxButton ptb = new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);
+ final PopupToolBoxButton ptb =
+ new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);
for (Action action : actions) {
ptb.add(action);
}
- tb = ptb;
+ final ToolBarFactory tbf = new ToolBarFactory(new Object[] {});
+ toolbar = tbf.createToolBar();
+ toolbar.setRollover(true);
+ toolbar.add(ptb);
}
- final ToolBarFactory tbf = new ToolBarFactory(new Object[] {});
- JToolBar toolbar = tbf.createToolBar();
- toolbar.setRollover(true);
- toolbar.add(tb);
buttonPanel.add(toolbar);
return buttonPanel;
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2576570
To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.