File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed
org.gitools.ui.app/src/main/java/org/gitools/ui/app/actions Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 1111 </properties >
1212 <border type =" none" />
1313 <children >
14- <component id =" 8fe54" class =" javax.swing.JComboBox " binding =" bookmarkComboBox" >
14+ <component id =" 8fe54" class =" org.gitools.ui.app.actions.BookmarksDropdown$WideComboBox " binding =" bookmarkComboBox" >
1515 <constraints >
1616 <grid row =" 0" column =" 0" row-span =" 1" col-span =" 1" vsize-policy =" 0" hsize-policy =" 2" anchor =" 8" fill =" 1" indent =" 0" use-parent-layout =" false" />
1717 <forms top =" 0" left =" 5" bottom =" 0" right =" 5" />
Original file line number Diff line number Diff line change 4444import java .awt .event .MouseEvent ;
4545import java .beans .PropertyChangeEvent ;
4646import java .beans .PropertyChangeListener ;
47+ import java .util .Vector ;
4748
4849
4950//FIXME: always two listeners.
5051
5152public class BookmarksDropdown extends HeatmapAction implements IPanelAction , PropertyChangeListener {
5253
53- private JComboBox <Bookmark > bookmarkComboBox ;
54+ private WideComboBox <Bookmark > bookmarkComboBox ;
5455 private JPanel bookmarksSelectPanel ;
5556 private Bookmarks bookmarks ;
5657 private static Bookmark NO_OPTION = new Bookmark ();
@@ -234,5 +235,40 @@ public void mousePressed(MouseEvent e) {
234235 }
235236 }
236237
238+ public static class WideComboBox <E > extends JComboBox <E > {
239+
240+ public WideComboBox () {
241+ }
242+
243+ public WideComboBox (final E items []) {
244+ super (items );
245+ }
246+
247+ public WideComboBox (Vector items ) {
248+ super (items );
249+ }
250+
251+ public WideComboBox (ComboBoxModel aModel ) {
252+ super (aModel );
253+ }
254+
255+ private boolean layingOut = false ;
256+
257+ public void doLayout () {
258+ try {
259+ layingOut = true ;
260+ super .doLayout ();
261+ } finally {
262+ layingOut = false ;
263+ }
264+ }
265+
266+ public Dimension getSize () {
267+ Dimension dim = super .getSize ();
268+ if (!layingOut )
269+ dim .width = Math .max (dim .width , getPreferredSize ().width );
270+ return dim ;
271+ }
272+ }
237273}
238274
You can’t perform that action at this time.
0 commit comments