Changeset 10957 in josm for trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
- Timestamp:
- 2016-09-04T16:32:05+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r10791 r10957 146 146 } 147 147 148 /** 149 * Same as above but lets you define if the dialog should be disposed on close. 150 * @param parent The parent element that will be used for position and maximum size 151 * @param title The text that will be shown in the window titlebar 152 * @param buttonTexts String Array of the text that will appear on the buttons. The first button is the default one. 153 * @param modal Set it to {@code true} if you want the dialog to be modal 154 * @param disposeOnClose whether to call {@link #dispose} when closing the dialog 155 */ 148 156 public ExtendedDialog(Component parent, String title, String[] buttonTexts, boolean modal, boolean disposeOnClose) { 149 157 super(searchRealParent(parent), title, modal ? ModalityType.DOCUMENT_MODAL : ModalityType.MODELESS); … … 329 337 330 338 for (int i = 0; i < bTexts.length; i++) { 331 final int finalI = i; 332 Action action = new AbstractAction(bTexts[i]) { 333 @Override 334 public void actionPerformed(ActionEvent evt) { 335 buttonAction(finalI, evt); 336 } 337 }; 338 339 button = new JButton(action); 339 button = new JButton(createButtonAction(i)); 340 340 if (i == defaultButtonIdx-1) { 341 341 defaultButton = button; … … 430 430 setSize(d); 431 431 setLocationRelativeTo(parent); 432 } 433 434 protected Action createButtonAction(final int i) { 435 return new AbstractAction(bTexts[i]) { 436 @Override 437 public void actionPerformed(ActionEvent evt) { 438 buttonAction(i, evt); 439 } 440 }; 432 441 } 433 442
Note:
See TracChangeset
for help on using the changeset viewer.