Changeset 11344 in josm
- Timestamp:
- 2016-11-29T02:39:12+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSettingFactory.java
r10600 r11344 2 2 package org.openstreetmap.josm.gui.preferences; 3 3 4 /** 5 * Factory for {@link PreferenceSetting}. 6 * @since 1742 7 */ 4 8 @FunctionalInterface 5 9 public interface PreferenceSettingFactory { 6 10 11 /** 12 * Creates preference settings. 13 * @return created preference settings 14 */ 7 15 PreferenceSetting createPreferenceSetting(); 8 16 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r11173 r11344 69 69 import org.openstreetmap.josm.tools.Shortcut; 70 70 71 /** 72 * Toolbar preferences. 73 * @since 172 74 */ 71 75 public class ToolbarPreferences implements PreferenceSettingFactory { 72 76 73 77 private static final String EMPTY_TOOLBAR_MARKER = "<!-empty-!>"; 74 78 79 /** 80 * Action definition. 81 */ 75 82 public static class ActionDefinition { 76 83 private final Action action; … … 80 87 private final Map<String, Object> parameters = new ConcurrentHashMap<>(); 81 88 89 /** 90 * Constructs a new {@code ActionDefinition}. 91 * @param action action 92 */ 82 93 public ActionDefinition(Action action) { 83 94 this.action = action; 84 95 } 85 96 97 /** 98 * Returns action parameters. 99 * @return action parameters 100 */ 86 101 public Map<String, Object> getParameters() { 87 102 return parameters; 88 103 } 89 104 105 /** 106 * Returns {@link ParameterizedActionDecorator}, if applicable. 107 * @return {@link ParameterizedActionDecorator}, if applicable 108 */ 90 109 public Action getParametrizedAction() { 91 110 if (getAction() instanceof ParameterizedAction) … … 95 114 } 96 115 116 /** 117 * Returns action. 118 * @return action 119 */ 97 120 public Action getAction() { 98 121 return action; 99 122 } 100 123 124 /** 125 * Returns action name. 126 * @return action name 127 */ 101 128 public String getName() { 102 129 return name; 103 130 } 104 131 132 /** 133 * Returns action display name. 134 * @return action display name 135 */ 105 136 public String getDisplayName() { 106 137 return name.isEmpty() ? (String) action.getValue(Action.NAME) : name; 107 138 } 108 139 140 /** 141 * Returns display tooltip. 142 * @return display tooltip 143 */ 109 144 public String getDisplayTooltip() { 110 145 if (!name.isEmpty()) … … 118 153 } 119 154 155 /** 156 * Returns display icon. 157 * @return display icon 158 */ 120 159 public Icon getDisplayIcon() { 121 160 if (ico != null) … … 127 166 } 128 167 168 /** 169 * Sets action name. 170 * @param name action name 171 */ 129 172 public void setName(String name) { 130 173 this.name = name; 131 174 } 132 175 176 /** 177 * Returns icon name. 178 * @return icon name 179 */ 133 180 public String getIcon() { 134 181 return icon; 135 182 } 136 183 184 /** 185 * Sets icon name. 186 * @param icon icon name 187 */ 137 188 public void setIcon(String icon) { 138 189 this.icon = icon; … … 140 191 } 141 192 193 /** 194 * Determines if this a separator. 195 * @return {@code true} if this a separator 196 */ 142 197 public boolean isSeparator() { 143 198 return action == null; 144 199 } 145 200 201 /** 202 * Returns a new separator. 203 * @return new separator 204 */ 146 205 public static ActionDefinition getSeparator() { 147 206 return new ActionDefinition(null); 148 207 } 149 208 209 /** 210 * Determines if this action has parameters. 211 * @return {@code true} if this action has parameters 212 */ 150 213 public boolean hasParameters() { 151 214 if (!(getAction() instanceof ParameterizedAction)) return false; … … 163 226 private char[] s; 164 227 228 /** 229 * Constructs a new {@code ActionParser}. 230 * @param actions actions map - can be null 231 */ 165 232 public ActionParser(Map<String, Action> actions) { 166 233 this.actions = actions; … … 490 557 } 491 558 559 /** 560 * Toolbar preferences settings. 561 */ 492 562 public class Settings extends DefaultTabPreferenceSetting { 493 563 -
trunk/src/org/openstreetmap/josm/plugins/PluginPreferenceFactory.java
r6084 r11344 5 5 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 6 6 7 /** 8 * Preference settings factory for plugins. 9 * @since 1742 10 */ 7 11 public class PluginPreferenceFactory implements PreferenceSettingFactory { 8 12 9 13 private final PluginProxy plugin; 10 14 15 /** 16 * Constructs a new {@code PluginPreferenceFactory}. 17 * @param plugin plugin proxy 18 */ 11 19 public PluginPreferenceFactory(PluginProxy plugin) { 12 20 this.plugin = plugin;
Note:
See TracChangeset
for help on using the changeset viewer.