Package org.openstreetmap.josm.gui
Interface IExtendedDialog
-
- All Known Subinterfaces:
TagEditHelper.IEditTagDialog
- All Known Implementing Classes:
AbstractListEditor,AbstractTableListEditor,AddImageryDialog,AddImageryLayerAction.SelectWmsLayersDialog,AddTagsDialog,AdjustTimezoneAndOffsetDialog,AdvancedCorrelationSettingsDialog,ConflictResolutionDialog,CustomProjectionChoice.ParameterInfoDialog,DeleteAction.ConfirmDeleteDialog,DownloadObjectDialog,ExtendedDialog,GenericRelationEditor,HistoryInfoAction.HistoryObjectIDDialog,ImageryAdjustAction.ConfirmOverwriteBookmarkDialog,ImageryAdjustAction.ImageryOffsetDialog,InspectPrimitiveDialog,JumpToAction.JumpToPositionDialog,LatLonDialog,ListEditor,ListListEditor,LogShowDialog,MapListEditor,MenuItemSearchDialog,MergeGpxLayerDialog,NoteInputDialog,NoteSortDialog,OpenLocationAction.WhichTasksToPerformDialog,OsmIdSelectionDialog,OverpassQueryWizardDialog,PropertiesMembershipChoiceDialog,RelationEditor,SearchDialog,SelectAction.ConfirmMoveDialog,SessionSaveAction.SessionSaveAsDialog,SourceEditor.EditSourceEntryDialog,SplitWayAction.SegmentToKeepSelectionDialog,StringEditor,SynchronizeTimeFromPhotoDialog,TagEditHelper.AbstractTagsDialog,TagEditHelper.AddTagsDialog,TagEditHelper.EditTagDialog,TaggingPreset.PresetDialog,TaggingPresetSearchDialog,TaggingPresetSearchPrimitiveDialog,UserQueryList.EditItemDialog,ValidatorListManagementDialog,WMTSTileSource.SelectLayerDialog
public interface IExtendedDialog
Extracted interface ofExtendedDialogclass.- Since:
- 11945
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExtendedDialogconfigureContextsensitiveHelp(java.lang.String helpTopic, boolean showHelpButton)Configures how this dialog support for context sensitive help.intgetValue()Retrieve the user choice after the dialog has been closed.ExtendedDialogsetButtonIcons(java.lang.String... buttonIcons)Convenience method to provide image names instead of images.ExtendedDialogsetButtonIcons(javax.swing.Icon... buttonIcons)Allows decorating the buttons with icons.ExtendedDialogsetCancelButton(java.lang.Integer... cancelButtonIdx)Used in combination with toggle: If the user presses 'cancel' the toggle settings are ignored and not saved to the prefExtendedDialogsetContent(java.awt.Component content)Sets the content that will be displayed in the message dialog.ExtendedDialogsetContent(java.awt.Component content, boolean placeContentInScrollPane)Sets the content that will be displayed in the message dialog.ExtendedDialogsetContent(java.lang.String message)Sets the message that will be displayed.ExtendedDialogsetDefaultButton(int defaultButtonIdx)Sets the button that will react to ENTER.voidsetFocusOnDefaultButton(boolean focus)Makes default button request initial focus or not.ExtendedDialogsetIcon(int messageType)Convenience method to allow values that would be accepted byJOptionPaneas messageType.ExtendedDialogsetIcon(javax.swing.Icon icon)Decorate the dialog with an icon that is shown on the left part of the window area.ExtendedDialogsetRememberWindowGeometry(java.lang.String pref, WindowGeometry wg)Call this if you want the dialog to remember the geometry (size and position) set by the user.ExtendedDialogsetToolTipTexts(java.lang.String... toolTipTexts)Allows decorating the buttons with tooltips.voidsetupDialog()This is called byshowDialog().ExtendedDialogshowDialog()Show the dialog to the user.booleantoggleCheckState()This function returns true if the dialog has been set to "do not show again"ExtendedDialogtoggleEnable(java.lang.String togglePref)Calling this will offer the user a "Do not show again" checkbox for the dialog.
-
-
-
Method Detail
-
setButtonIcons
ExtendedDialog setButtonIcons(javax.swing.Icon... buttonIcons)
Allows decorating the buttons with icons.- Parameters:
buttonIcons- The button icons- Returns:
this
-
setButtonIcons
ExtendedDialog setButtonIcons(java.lang.String... buttonIcons)
Convenience method to provide image names instead of images.- Parameters:
buttonIcons- The button icon names- Returns:
this
-
setToolTipTexts
ExtendedDialog setToolTipTexts(java.lang.String... toolTipTexts)
Allows decorating the buttons with tooltips. Expects a String array with translated tooltip texts.- Parameters:
toolTipTexts- the tool tip texts. Ignored, if null.- Returns:
this
-
setContent
ExtendedDialog setContent(java.awt.Component content)
Sets the content that will be displayed in the message dialog. Note that depending on your other settings more UI elements may appear. The content is played on top of the other elements though.- Parameters:
content- Any element that can be displayed in the message dialog- Returns:
this
-
setContent
ExtendedDialog setContent(java.awt.Component content, boolean placeContentInScrollPane)
Sets the content that will be displayed in the message dialog. Note that depending on your other settings more UI elements may appear. The content is played on top of the other elements though.- Parameters:
content- Any element that can be displayed in the message dialogplaceContentInScrollPane- if true, places the content in a JScrollPane- Returns:
this
-
setContent
ExtendedDialog setContent(java.lang.String message)
Sets the message that will be displayed. The String will be automatically wrapped if it is too long. Note that depending on your other settings more UI elements may appear. The content is played on top of the other elements though.- Parameters:
message- The text that should be shown to the user- Returns:
this
-
setIcon
ExtendedDialog setIcon(javax.swing.Icon icon)
Decorate the dialog with an icon that is shown on the left part of the window area. (Similar to how it is done inJOptionPane)- Parameters:
icon- The icon to display- Returns:
this
-
setIcon
ExtendedDialog setIcon(int messageType)
Convenience method to allow values that would be accepted byJOptionPaneas messageType.- Parameters:
messageType- TheJOptionPanemessageType- Returns:
this
-
showDialog
ExtendedDialog showDialog()
Show the dialog to the user. Call this after you have set all options for the dialog. You can retrieve the result usinggetValue().- Returns:
this
-
getValue
int getValue()
Retrieve the user choice after the dialog has been closed.- Returns:
- The selected button. The count starts with 1.
- A return value of
ExtendedDialog.DialogClosedOtherwisemeans the dialog has been closed otherwise.
-
setupDialog
void setupDialog()
This is called byshowDialog(). Only invoke from outside if you need to modify the contentPane
-
setRememberWindowGeometry
ExtendedDialog setRememberWindowGeometry(java.lang.String pref, WindowGeometry wg)
Call this if you want the dialog to remember the geometry (size and position) set by the user. Set the pref tonullor to an empty string to disable again. By default, it's disabled. Note: If you want to set the width of this dialog directly use the usual setSize, setPreferredSize, setMaxSize, setMinSize- Parameters:
pref- The preference to save the dimension towg- The default window geometry that should be used if no existing preference is found (only takes effect ifprefis not null or empty- Returns:
this
-
toggleEnable
ExtendedDialog toggleEnable(java.lang.String togglePref)
Calling this will offer the user a "Do not show again" checkbox for the dialog. Default is to not offer the choice; the dialog will be shown every time. Currently, this is not supported for non-modal dialogs.- Parameters:
togglePref- The preference to save the checkbox state to- Returns:
this
-
setDefaultButton
ExtendedDialog setDefaultButton(int defaultButtonIdx)
Sets the button that will react to ENTER.- Parameters:
defaultButtonIdx- The button index (starts to 1)- Returns:
this
-
setCancelButton
ExtendedDialog setCancelButton(java.lang.Integer... cancelButtonIdx)
Used in combination with toggle: If the user presses 'cancel' the toggle settings are ignored and not saved to the pref- Parameters:
cancelButtonIdx- index of the button that stands for cancel, accepts multiple values- Returns:
this
-
setFocusOnDefaultButton
void setFocusOnDefaultButton(boolean focus)
Makes default button request initial focus or not.- Parameters:
focus-trueto make default button request initial focus- Since:
- 7407
-
toggleCheckState
boolean toggleCheckState()
This function returns true if the dialog has been set to "do not show again"- Returns:
- true if dialog should not be shown again
-
configureContextsensitiveHelp
ExtendedDialog configureContextsensitiveHelp(java.lang.String helpTopic, boolean showHelpButton)
Configures how this dialog support for context sensitive help.- if helpTopic is null, the dialog doesn't provide context sensitive help
- if helpTopic != null, the dialog redirect user to the help page for this helpTopic when the user clicks F1 in the dialog
- if showHelpButton is true, the dialog displays "Help" button (rightmost button in the button row)
- Parameters:
helpTopic- the help topicshowHelpButton- true, if the dialog displays a help button- Returns:
this
-
-