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 of
ExtendedDialog class.- Since:
- 11945
-
Method Summary
Modifier and TypeMethodDescriptionconfigureContextsensitiveHelp(String helpTopic, boolean showHelpButton) Configures how this dialog support for context sensitive help.intgetValue()Retrieve the user choice after the dialog has been closed.setButtonIcons(String... buttonIcons) Convenience method to provide image names instead of images.setButtonIcons(Icon... buttonIcons) Allows decorating the buttons with icons.setCancelButton(Integer... cancelButtonIdx) Used in combination with toggle: If the user presses 'cancel' the toggle settings are ignored and not saved to the prefsetContent(Component content) Sets the content that will be displayed in the message dialog.setContent(Component content, boolean placeContentInScrollPane) Sets the content that will be displayed in the message dialog.setContent(String message) Sets the message that will be displayed.setDefaultButton(int defaultButtonIdx) Sets the button that will react to ENTER.voidsetFocusOnDefaultButton(boolean focus) Makes default button request initial focus or not.setIcon(int messageType) Convenience method to allow values that would be accepted byJOptionPaneas messageType.Decorate the dialog with an icon that is shown on the left part of the window area.setRememberWindowGeometry(String pref, WindowGeometry wg) Call this if you want the dialog to remember the geometry (size and position) set by the user.setToolTipTexts(String... toolTipTexts) Allows decorating the buttons with tooltips.voidThis is called byshowDialog().Show the dialog to the user.booleanThis function returns true if the dialog has been set to "do not show again"toggleEnable(String togglePref) Calling this will offer the user a "Do not show again" checkbox for the dialog.
-
Method Details
-
setButtonIcons
Allows decorating the buttons with icons.- Parameters:
buttonIcons- The button icons- Returns:
this
-
setButtonIcons
Convenience method to provide image names instead of images.- Parameters:
buttonIcons- The button icon names- Returns:
this
-
setToolTipTexts
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
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
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
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
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
Convenience method to allow values that would be accepted byJOptionPaneas messageType.- Parameters:
messageType- TheJOptionPanemessageType- Returns:
this
-
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
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
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
Sets the button that will react to ENTER.- Parameters:
defaultButtonIdx- The button index (starts to 1)- Returns:
this
-
setCancelButton
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
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
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
-