- Timestamp:
- 2011-12-28T18:59:27+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r4139 r4733 53 53 * The new super for all actions. 54 54 * 55 * Use this super constructor to setup your action. It takes 5 parameters:55 * Use this super constructor to setup your action. 56 56 * 57 57 * @param name the action's text as displayed on the menu (if it is added to a menu) … … 64 64 * the user CANNOT configure a shortcut for your action. 65 65 * @param register register this action for the toolbar preferences? 66 */ 67 public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register) { 68 this(name, iconName, tooltip, shortcut, register, true); 69 } 70 71 /** 72 * Even newer super for all actions. Use if you don't want to install layer changed and selection changed adapters 73 * @param name 74 * @param iconName 75 * @param tooltip 76 * @param shortcut 77 * @param register 78 * @param installAdapters 79 */ 80 public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register, boolean installAdapters) { 66 * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null 67 * @param installAdapters false, if you don't want to install layer changed and selection changed adapters 68 */ 69 public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register, String toolbarId, boolean installAdapters) { 81 70 super(name, iconName == null ? null : ImageProvider.get(iconName)); 82 71 setHelpId(); … … 87 76 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc)); 88 77 if (getValue("toolbar") == null) { 89 putValue("toolbar", iconName);78 putValue("toolbar", toolbarId == null ? iconName : toolbarId); 90 79 } 91 80 if (register) { … … 95 84 installAdapters(); 96 85 } 86 } 87 88 public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register, boolean installAdapters) { 89 this(name, iconName, tooltip, shortcut, register, null, installAdapters); 90 } 91 92 public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register) { 93 this(name, iconName, tooltip, shortcut, register, null, true); 97 94 } 98 95 -
trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
r4695 r4733 26 26 public class SessionLoadAction extends JosmAction { 27 27 public SessionLoadAction() { 28 super(tr("Load Session"), "open", tr("Load a session from file."), null, false);28 super(tr("Load Session"), "open", tr("Load a session from file."), null, true, "load-session", true); 29 29 putValue("help", ht("/Action/SessionLoad")); 30 30 } -
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r4685 r4733 42 42 import org.openstreetmap.josm.tools.WindowGeometry; 43 43 44 public class SessionSaveAsAction extends DiskAccessAction {44 public class SessionSaveAsAction extends JosmAction { 45 45 46 46 private List<Layer> layers; … … 55 55 */ 56 56 public SessionSaveAsAction() { 57 super(tr("Save Session As..."), "save_as", tr("Save the current session to a new file."), null );57 super(tr("Save Session As..."), "save_as", tr("Save the current session to a new file."), null, true, "save_as-session", true); 58 58 putValue("help", ht("/Action/SessionSaveAs")); 59 59 } -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r4685 r4733 120 120 public final JosmAction save = new SaveAction(); 121 121 public final JosmAction saveAs = new SaveAsAction(); 122 public final JosmAction sessionLoad = new SessionLoadAction();123 public final JosmAction sessionSaveAs = new SessionSaveAsAction();122 public JosmAction sessionLoad; 123 public JosmAction sessionSaveAs; 124 124 public final JosmAction gpxExport = new GpxExportAction(); 125 125 public final DownloadAction download = new DownloadAction(); … … 367 367 sessionMenu.setToolTipText(tr("Save and load the current session (list of layers, etc.)")); 368 368 sessionMenu.setIcon(ImageProvider.get("session")); 369 sessionSaveAs = new SessionSaveAsAction(); 370 sessionLoad = new SessionLoadAction(); 369 371 add(sessionMenu, sessionSaveAs); 370 372 add(sessionMenu, sessionLoad);
Note:
See TracChangeset
for help on using the changeset viewer.