Changeset 5331 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-07-13T23:57:26+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r5330 r5331 25 25 import java.awt.event.WindowEvent; 26 26 import java.util.ArrayList; 27 import java.util.Arrays; 27 28 import java.util.Collection; 28 import java.util. Collections;29 import java.util.LinkedList; 29 30 import java.util.List; 30 31 … … 757 758 } 758 759 759 @SuppressWarnings("unchecked")760 760 protected Component createLayout(Component data, boolean scroll, Collection<SideButton> buttons) { 761 return createLayout(data, scroll, Collections.singletonList(buttons));762 } 763 764 protected Component createLayout(Component data, boolean scroll, List<Collection<SideButton>> buttons) {761 return createLayout(data, scroll, buttons, (Collection<SideButton>[]) null); 762 } 763 764 protected Component createLayout(Component data, boolean scroll, Collection<SideButton> firstButtons, Collection<SideButton>... nextButtons) { 765 765 if (scroll) { 766 766 data = new JScrollPane(data); 767 767 } 768 LinkedList<Collection<SideButton>> buttons = new LinkedList<Collection<SideButton>>(); 769 buttons.addFirst(firstButtons); 770 if (nextButtons != null) { 771 buttons.addAll(Arrays.asList(nextButtons)); 772 } 768 773 add(data, BorderLayout.CENTER); 769 if (buttons != null && buttons.size() > 0 && buttons.get(0) != null && !buttons.get(0).isEmpty()) {774 if (buttons.size() > 0 && buttons.get(0) != null && !buttons.get(0).isEmpty()) { 770 775 buttonsPanel = new JPanel(new GridLayout(buttons.size(), 1)); 771 776 for (Collection<SideButton> buttonRow : buttons) { 777 if (buttonRow == null) { 778 continue; 779 } 772 780 final JPanel buttonRowPanel = new JPanel(Main.pref.getBoolean("dialog.align.left", false) 773 781 ? new FlowLayout(FlowLayout.LEFT) : new GridLayout(1, buttonRow.size()));
Note:
See TracChangeset
for help on using the changeset viewer.