Package org.openstreetmap.josm.actions
Class OpenBrowserAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.OpenBrowserAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
public class OpenBrowserAction extends AbstractAction
Action to open browser on given URL.- Since:
- 15706
- See Also:
OpenBrowser
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private String
originalName
private List<String>
urls
-
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
-
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
-
Constructor Summary
Constructors Constructor Description OpenBrowserAction(String name, String url)
Constructs a newOpenBrowserAction
.OpenBrowserAction(String name, String url, ImageResource icon)
Constructs a newOpenBrowserAction
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
void
addUrl(String url)
Adds an additional URL to be launched.static boolean
confirmLaunchMultiple(int numBrowsers)
Asks user confirmation before launching a large number of browser windows.private void
updateNameAndDescription()
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
originalName
private final String originalName
-
-
Constructor Detail
-
OpenBrowserAction
public OpenBrowserAction(String name, String url)
Constructs a newOpenBrowserAction
.- Parameters:
name
- the name of this actionurl
- the URL to launch
-
OpenBrowserAction
public OpenBrowserAction(String name, String url, ImageResource icon)
Constructs a newOpenBrowserAction
.- Parameters:
name
- the name of this actionurl
- the URL to launchicon
- the action icon- Since:
- 16839
-
-
Method Detail
-
addUrl
public void addUrl(String url)
Adds an additional URL to be launched.- Parameters:
url
- the URL to launch
-
updateNameAndDescription
private void updateNameAndDescription()
-
actionPerformed
public void actionPerformed(ActionEvent e)
-
confirmLaunchMultiple
public static boolean confirmLaunchMultiple(int numBrowsers)
Asks user confirmation before launching a large number of browser windows.- Parameters:
numBrowsers
- the number of browser windows to open- Returns:
true
if the user confirms,false
otherwise
-
-