Class OsmIdSelectionDialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- org.openstreetmap.josm.gui.ExtendedDialog
-
- org.openstreetmap.josm.gui.dialogs.OsmIdSelectionDialog
-
- All Implemented Interfaces:
java.awt.event.WindowListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
,IExtendedDialog
- Direct Known Subclasses:
DownloadObjectDialog
,HistoryInfoAction.HistoryObjectIDDialog
public class OsmIdSelectionDialog extends ExtendedDialog implements java.awt.event.WindowListener
Dialog prompt to user to let him choose OSM primitives by specifying their type and IDs.- Since:
- 6448, split from DownloadObjectDialog
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected HistoryComboBox
cbId
protected OsmPrimitiveTypesComboBox
cbType
protected javax.swing.GroupLayout
layout
protected javax.swing.JPanel
panel
protected OsmIdTextField
tfId
-
Fields inherited from class org.openstreetmap.josm.gui.ExtendedDialog
buttons, contentInsets, defaultButton, DialogClosedOtherwise
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description OsmIdSelectionDialog(java.awt.Component parent, java.lang.String title, java.lang.String... buttonTexts)
Creates a new OsmIdSelectionDialogOsmIdSelectionDialog(java.awt.Component parent, java.lang.String title, java.lang.String[] buttonTexts, boolean modal)
Creates a new OsmIdSelectionDialogOsmIdSelectionDialog(java.awt.Component parent, java.lang.String title, java.lang.String[] buttonTexts, boolean modal, boolean disposeOnClose)
Creates a new OsmIdSelectionDialog
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<java.awt.Component>
getComponentsBeforeHelp()
Let subclasses add custom components between the id input field and the help textint
getContinueButtonIndex()
Allows subclasses to specify a different continue button index.java.util.List<PrimitiveId>
getOsmIds()
Gets the requested OSM object IDs.protected void
init()
protected void
remindPrimitivesHistory(HistoryComboBox cbHistory)
Remind the current history in the preferencesprotected void
restorePrimitivesHistory(HistoryComboBox cbHistory)
Restore the current history from the preferencesvoid
setupDialog()
This is called byIExtendedDialog.showDialog()
.protected void
tryToPasteFromClipboard(OsmIdTextField tfId, OsmPrimitiveTypesComboBox cbType)
void
windowActivated(java.awt.event.WindowEvent e)
void
windowClosed(java.awt.event.WindowEvent e)
void
windowClosing(java.awt.event.WindowEvent e)
void
windowDeactivated(java.awt.event.WindowEvent e)
void
windowDeiconified(java.awt.event.WindowEvent e)
void
windowIconified(java.awt.event.WindowEvent e)
void
windowOpened(java.awt.event.WindowEvent e)
-
Methods inherited from class org.openstreetmap.josm.gui.ExtendedDialog
buttonAction, configureContextsensitiveHelp, createButtonAction, findMaxDialogSize, getValue, initWindowGeometry, rememberWindowGeometry, setButtonIcons, setButtonIcons, setCancelButton, setContent, setContent, setContent, setDefaultButton, setFocusOnDefaultButton, setIcon, setIcon, setRememberWindowGeometry, setToolTipTexts, setVisible, showDialog, toggleCheckState, toggleEnable, toggleSaveState
-
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
panel
protected final javax.swing.JPanel panel
-
cbType
protected final OsmPrimitiveTypesComboBox cbType
-
tfId
protected final OsmIdTextField tfId
-
cbId
protected final HistoryComboBox cbId
-
layout
protected final transient javax.swing.GroupLayout layout
-
-
Constructor Detail
-
OsmIdSelectionDialog
public OsmIdSelectionDialog(java.awt.Component parent, java.lang.String title, java.lang.String... buttonTexts)
Creates a new OsmIdSelectionDialog- Parameters:
parent
- The parent element that will be used for position and maximum sizetitle
- The text that will be shown in the window titlebarbuttonTexts
- String Array of the text that will appear on the buttons. The first button is the default one.
-
OsmIdSelectionDialog
public OsmIdSelectionDialog(java.awt.Component parent, java.lang.String title, java.lang.String[] buttonTexts, boolean modal)
Creates a new OsmIdSelectionDialog- Parameters:
parent
- The parent element that will be used for position and maximum sizetitle
- The text that will be shown in the window titlebarbuttonTexts
- String Array of the text that will appear on the buttons. The first button is the default one.modal
- Set it totrue
if you want the dialog to be modal
-
OsmIdSelectionDialog
public OsmIdSelectionDialog(java.awt.Component parent, java.lang.String title, java.lang.String[] buttonTexts, boolean modal, boolean disposeOnClose)
Creates a new OsmIdSelectionDialog- Parameters:
parent
- The parent element that will be used for position and maximum sizetitle
- The text that will be shown in the window titlebarbuttonTexts
- String Array of the text that will appear on the buttons. The first button is the default one.modal
- Set it totrue
if you want the dialog to be modaldisposeOnClose
- whether to callWindow.dispose()
when closing the dialog
-
-
Method Detail
-
init
protected void init()
-
getComponentsBeforeHelp
protected java.util.Collection<java.awt.Component> getComponentsBeforeHelp()
Let subclasses add custom components between the id input field and the help text- Returns:
- the collections to add
-
getContinueButtonIndex
public int getContinueButtonIndex()
Allows subclasses to specify a different continue button index. If this button is pressed, the history is updated.- Returns:
- the button index
-
restorePrimitivesHistory
protected void restorePrimitivesHistory(HistoryComboBox cbHistory)
Restore the current history from the preferences- Parameters:
cbHistory
- theHistoryComboBox
to which the history is restored to
-
remindPrimitivesHistory
protected void remindPrimitivesHistory(HistoryComboBox cbHistory)
Remind the current history in the preferences- Parameters:
cbHistory
- theHistoryComboBox
of which to restore the history
-
getOsmIds
public final java.util.List<PrimitiveId> getOsmIds()
Gets the requested OSM object IDs.- Returns:
- The list of requested OSM object IDs
-
setupDialog
public void setupDialog()
Description copied from interface:IExtendedDialog
This is called byIExtendedDialog.showDialog()
. Only invoke from outside if you need to modify the contentPane- Specified by:
setupDialog
in interfaceIExtendedDialog
- Overrides:
setupDialog
in classExtendedDialog
-
tryToPasteFromClipboard
protected void tryToPasteFromClipboard(OsmIdTextField tfId, OsmPrimitiveTypesComboBox cbType)
-
windowClosed
public void windowClosed(java.awt.event.WindowEvent e)
- Specified by:
windowClosed
in interfacejava.awt.event.WindowListener
-
windowOpened
public void windowOpened(java.awt.event.WindowEvent e)
- Specified by:
windowOpened
in interfacejava.awt.event.WindowListener
-
windowClosing
public void windowClosing(java.awt.event.WindowEvent e)
- Specified by:
windowClosing
in interfacejava.awt.event.WindowListener
-
windowIconified
public void windowIconified(java.awt.event.WindowEvent e)
- Specified by:
windowIconified
in interfacejava.awt.event.WindowListener
-
windowDeiconified
public void windowDeiconified(java.awt.event.WindowEvent e)
- Specified by:
windowDeiconified
in interfacejava.awt.event.WindowListener
-
windowActivated
public void windowActivated(java.awt.event.WindowEvent e)
- Specified by:
windowActivated
in interfacejava.awt.event.WindowListener
-
windowDeactivated
public void windowDeactivated(java.awt.event.WindowEvent e)
- Specified by:
windowDeactivated
in interfacejava.awt.event.WindowListener
-
-