Ignore:
Timestamp:
2016-11-29T02:39:12+01:00 (7 years ago)
Author:
Don-vip
Message:

javadoc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r11173 r11344  
    6969import org.openstreetmap.josm.tools.Shortcut;
    7070
     71/**
     72 * Toolbar preferences.
     73 * @since 172
     74 */
    7175public class ToolbarPreferences implements PreferenceSettingFactory {
    7276
    7377    private static final String EMPTY_TOOLBAR_MARKER = "<!-empty-!>";
    7478
     79    /**
     80     * Action definition.
     81     */
    7582    public static class ActionDefinition {
    7683        private final Action action;
     
    8087        private final Map<String, Object> parameters = new ConcurrentHashMap<>();
    8188
     89        /**
     90         * Constructs a new {@code ActionDefinition}.
     91         * @param action action
     92         */
    8293        public ActionDefinition(Action action) {
    8394            this.action = action;
    8495        }
    8596
     97        /**
     98         * Returns action parameters.
     99         * @return action parameters
     100         */
    86101        public Map<String, Object> getParameters() {
    87102            return parameters;
    88103        }
    89104
     105        /**
     106         * Returns {@link ParameterizedActionDecorator}, if applicable.
     107         * @return {@link ParameterizedActionDecorator}, if applicable
     108         */
    90109        public Action getParametrizedAction() {
    91110            if (getAction() instanceof ParameterizedAction)
     
    95114        }
    96115
     116        /**
     117         * Returns action.
     118         * @return action
     119         */
    97120        public Action getAction() {
    98121            return action;
    99122        }
    100123
     124        /**
     125         * Returns action name.
     126         * @return action name
     127         */
    101128        public String getName() {
    102129            return name;
    103130        }
    104131
     132        /**
     133         * Returns action display name.
     134         * @return action display name
     135         */
    105136        public String getDisplayName() {
    106137            return name.isEmpty() ? (String) action.getValue(Action.NAME) : name;
    107138        }
    108139
     140        /**
     141         * Returns display tooltip.
     142         * @return display tooltip
     143         */
    109144        public String getDisplayTooltip() {
    110145            if (!name.isEmpty())
     
    118153        }
    119154
     155        /**
     156         * Returns display icon.
     157         * @return display icon
     158         */
    120159        public Icon getDisplayIcon() {
    121160            if (ico != null)
     
    127166        }
    128167
     168        /**
     169         * Sets action name.
     170         * @param name action name
     171         */
    129172        public void setName(String name) {
    130173            this.name = name;
    131174        }
    132175
     176        /**
     177         * Returns icon name.
     178         * @return icon name
     179         */
    133180        public String getIcon() {
    134181            return icon;
    135182        }
    136183
     184        /**
     185         * Sets icon name.
     186         * @param icon icon name
     187         */
    137188        public void setIcon(String icon) {
    138189            this.icon = icon;
     
    140191        }
    141192
     193        /**
     194         * Determines if this a separator.
     195         * @return {@code true} if this a separator
     196         */
    142197        public boolean isSeparator() {
    143198            return action == null;
    144199        }
    145200
     201        /**
     202         * Returns a new separator.
     203         * @return new separator
     204         */
    146205        public static ActionDefinition getSeparator() {
    147206            return new ActionDefinition(null);
    148207        }
    149208
     209        /**
     210         * Determines if this action has parameters.
     211         * @return {@code true} if this action has parameters
     212         */
    150213        public boolean hasParameters() {
    151214            if (!(getAction() instanceof ParameterizedAction)) return false;
     
    163226        private char[] s;
    164227
     228        /**
     229         * Constructs a new {@code ActionParser}.
     230         * @param actions actions map - can be null
     231         */
    165232        public ActionParser(Map<String, Action> actions) {
    166233            this.actions = actions;
     
    490557    }
    491558
     559    /**
     560     * Toolbar preferences settings.
     561     */
    492562    public class Settings extends DefaultTabPreferenceSetting {
    493563
Note: See TracChangeset for help on using the changeset viewer.