Author: linus
Date: 2010-04-17 09:09:28-0700
New Revision: 18277
Added:
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java
- copied, changed from r18236, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java
Modified:
branches/BRANCH_0_30_x/ (props changed)
branches/BRANCH_0_30_x/src/argouml-app/ (props changed)
branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/ (props changed)
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java
Log:
Merging rev 18236 and 18241 from trunk for Issue 6059.
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java?view=diff&pathrev=18277&r1=18276&r2=18277
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java 2010-04-17 09:09:28-0700
@@ -89,6 +89,7 @@
import org.tigris.toolbar.ToolBar;
import org.tigris.toolbar.ToolBarFactory;
import org.tigris.toolbar.toolbutton.PopupToolBoxButton;
+import org.tigris.toolbar.toolbutton.ToolButton;
/**
* A control for displaying the contents of a list model elements in a panel
@@ -98,7 +99,7 @@
* @author Bob Tarling
* @since 0.29.2
*/
-class RowSelector extends JPanel
+class RowSelector extends UmlControl
implements MouseListener, ListDataListener, ListSelectionListener {
/**
@@ -358,13 +359,25 @@
}
if (!actions.isEmpty()) {
- PopupToolBoxButton tb = new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);
- for (Action action : actions) {
- tb.add(action);
- }
- JPanel buttonPanel =
- new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));
- buttonPanel.add(tb);
+ final JPanel buttonPanel =
+ createSingleButtonPanel(actions);
+
+// new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));
+// final ToolButton tb;
+// if (actions.size() == 1) {
+// tb = new ToolButton(actions.get(0));
+// } else {
+// 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[] {});
+// JToolBar toolbar = tbf.createToolBar();
+// toolbar.setRollover(true);
+// toolbar.add(tb);
+// buttonPanel.add(toolbar);
add(buttonPanel, BorderLayout.WEST);
}
}
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java?view=diff&pathrev=18277&r1=18276&r2=18277
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java 2010-04-17 09:09:28-0700
@@ -52,11 +52,14 @@
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JPanel;
+import javax.swing.JToolBar;
import org.argouml.application.helpers.ResourceLoaderWrapper;
import org.argouml.ui.targetmanager.TargetManager;
import org.tigris.swidgets.FlexiGridLayout;
+import org.tigris.toolbar.ToolBarFactory;
import org.tigris.toolbar.toolbutton.PopupToolBoxButton;
+import org.tigris.toolbar.toolbutton.ToolButton;
/**
* This class implements a panel that adds a navigation button to the right of
@@ -65,7 +68,7 @@
* @author Curt Arnold
* @since 0.9
*/
-public class UMLComboBoxNavigator extends JPanel implements ActionListener,
+public class UMLComboBoxNavigator extends UmlControl implements ActionListener,
ItemListener {
private static ImageIcon icon = ResourceLoaderWrapper
@@ -101,14 +104,26 @@
if (model instanceof UMLComboBoxModel) {
final List<Action> actions = ((UMLComboBoxModel) model).getActions();
if (!actions.isEmpty()) {
- PopupToolBoxButton tb = new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);
- for (Action action : actions) {
- tb.add(action);
- }
- JPanel buttonPanel =
- new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));
- buttonPanel.add(tb);
+ final JPanel buttonPanel =
+ createSingleButtonPanel(actions);
+// new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));
+// final ToolButton tb;
+// if (actions.size() == 1) {
+// tb = new ToolButton(actions.get(0));
+// } else {
+// 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[] {});
+// JToolBar toolbar = tbf.createToolBar();
+// toolbar.setRollover(true);
+// toolbar.add(tb);
+// buttonPanel.add(toolbar);
add(buttonPanel, BorderLayout.WEST);
+
}
}
Object item = theComboBox.getSelectedItem();
Copied: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java (from r18236, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java?view=diff&pathrev=18277&r1=18236&r2=18277
==============================================================================
--- /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java 2010-04-17 09:09:28-0700
@@ -55,7 +55,8 @@
final ToolButton tb;
if (actions.size() == 1) {
tb = new ToolButton(actions.get(0));
- tb.setHideActionText(true);
+ // TODO: Following is only in Java 6 and later
+// tb.setHideActionText(true);
} else {
PopupToolBoxButton ptb = new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);
for (Action action : actions) {
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2586838
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.