source: josm/trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractListEditor.java@ 12678

Last change on this file since 12678 was 12678, checked in by Don-vip, 7 years ago

see #15182 - move WindowGeometry from tools to gui.util

File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.preferences.advanced;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.Component;
7import java.awt.Dimension;
8import java.util.List;
9
10import javax.swing.JPanel;
11
12import org.openstreetmap.josm.gui.ExtendedDialog;
13import org.openstreetmap.josm.gui.util.WindowGeometry;
14
15/**
16 * Abstract superclass of {@link ListEditor} and {@link AbstractTableListEditor}.
17 * @param <T> type of elements
18 * @since 9505
19 */
20public abstract class AbstractListEditor<T> extends ExtendedDialog {
21
22 protected final transient PrefEntry entry;
23
24 /**
25 * Constructs a new {@code AbstractListEditor}.
26 * @param parent The parent element that will be used for position and maximum size
27 * @param title The text that will be shown in the window titlebar
28 * @param entry Preference entry
29 */
30 public AbstractListEditor(Component parent, String title, PrefEntry entry) {
31 super(parent, title, tr("OK"), tr("Cancel"));
32 this.entry = entry;
33 setButtonIcons("ok", "cancel");
34 setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(parent, new Dimension(500, 350)));
35 }
36
37 /**
38 * Returns the list of values.
39 * @return The list of values.
40 */
41 public abstract List<T> getData();
42
43 protected abstract JPanel build();
44}
Note: See TracBrowser for help on using the repository browser.