Ignore:
Timestamp:
2018-07-15T12:16:21+02:00 (6 years ago)
Author:
michael2402
Message:

See #16388: Checkstyle: Convert tabs to spaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorAction.java

    r14027 r14029  
    3030 */
    3131public abstract class AbstractRelationEditorAction extends AbstractAction
    32                 implements TableModelListener, ListSelectionListener, PropertyChangeListener {
    33         private static final long serialVersionUID = 1L;
    34         protected final transient IRelationEditorActionAccess editorAccess;
     32        implements TableModelListener, ListSelectionListener, PropertyChangeListener {
     33    private static final long serialVersionUID = 1L;
     34    protected final transient IRelationEditorActionAccess editorAccess;
    3535
    36         /**
    37         * Create a new relation editor action
    38         *
    39         * @param editorAccess
    40         *            The editor this action is for
    41         * @param actionMapKey
    42         *            The key for the member table action map.
    43         * @param updateOn
    44         *            The events that may cause the enabled state of this button to
    45         *            change.
    46         */
    47         protected AbstractRelationEditorAction(IRelationEditorActionAccess editorAccess,
    48                         IRelationEditorUpdateOn... updateOn) {
    49                 Objects.requireNonNull(editorAccess, "editorAccess");
    50                 Objects.requireNonNull(updateOn, "updateOn");
    51                 this.editorAccess = editorAccess;
    52                 for (IRelationEditorUpdateOn u : updateOn) {
    53                         u.register(editorAccess, this);
    54                 }
    55         }
     36    /**
     37    * Create a new relation editor action
     38    *
     39    * @param editorAccess
     40    *            The editor this action is for
     41    * @param actionMapKey
     42    *            The key for the member table action map.
     43    * @param updateOn
     44    *            The events that may cause the enabled state of this button to
     45    *            change.
     46    */
     47    protected AbstractRelationEditorAction(IRelationEditorActionAccess editorAccess,
     48            IRelationEditorUpdateOn... updateOn) {
     49        Objects.requireNonNull(editorAccess, "editorAccess");
     50        Objects.requireNonNull(updateOn, "updateOn");
     51        this.editorAccess = editorAccess;
     52        for (IRelationEditorUpdateOn u : updateOn) {
     53            u.register(editorAccess, this);
     54        }
     55    }
    5656
    57         /**
    58         * Create a new relation editor action
    59         *
    60         * @param editorAccess
    61         *            The editor this action is for
    62         * @param actionMapKey
    63         *            The key for the member table action map.
    64         * @param updateOn
    65         *            The events that may cause the enabled state of this button to
    66         *            change.
    67         */
    68         protected AbstractRelationEditorAction(IRelationEditorActionAccess editorAccess, String actionMapKey,
    69                         IRelationEditorUpdateOn... updateOn) {
    70                 this(editorAccess, updateOn);
    71                 Objects.requireNonNull(actionMapKey, "actionMapKey");
     57    /**
     58    * Create a new relation editor action
     59    *
     60    * @param editorAccess
     61    *            The editor this action is for
     62    * @param actionMapKey
     63    *            The key for the member table action map.
     64    * @param updateOn
     65    *            The events that may cause the enabled state of this button to
     66    *            change.
     67    */
     68    protected AbstractRelationEditorAction(IRelationEditorActionAccess editorAccess, String actionMapKey,
     69            IRelationEditorUpdateOn... updateOn) {
     70        this(editorAccess, updateOn);
     71        Objects.requireNonNull(actionMapKey, "actionMapKey");
    7272
    73                 this.editorAccess.addMemberTableAction(actionMapKey, this);
    74         }
     73        this.editorAccess.addMemberTableAction(actionMapKey, this);
     74    }
    7575
    76         @Override
    77         public void tableChanged(TableModelEvent e) {
    78                 updateEnabledState();
    79         }
     76    @Override
     77    public void tableChanged(TableModelEvent e) {
     78        updateEnabledState();
     79    }
    8080
    81         @Override
    82         public void valueChanged(ListSelectionEvent e) {
    83                 updateEnabledState();
    84         }
     81    @Override
     82    public void valueChanged(ListSelectionEvent e) {
     83        updateEnabledState();
     84    }
    8585
    8686    @Override
     
    8989    }
    9090
    91         protected abstract void updateEnabledState();
     91    protected abstract void updateEnabledState();
    9292
    93         protected final boolean canDownload() {
    94                 if (editorAccess.getEditor().getRelation() == null)
    95                         return false;
    96                 DataSet ds = editorAccess.getEditor().getRelation().getDataSet();
    97                 return !Main.isOffline(OnlineResource.OSM_API) && ds != null && !ds.isLocked()
    98                                 && !DownloadPolicy.BLOCKED.equals(ds.getDownloadPolicy());
    99         }
     93    protected final boolean canDownload() {
     94        if (editorAccess.getEditor().getRelation() == null)
     95            return false;
     96        DataSet ds = editorAccess.getEditor().getRelation().getDataSet();
     97        return !Main.isOffline(OnlineResource.OSM_API) && ds != null && !ds.isLocked()
     98                && !DownloadPolicy.BLOCKED.equals(ds.getDownloadPolicy());
     99    }
    100100
    101         protected MemberTable getMemberTable() {
    102                 return editorAccess.getMemberTable();
    103         }
     101    protected MemberTable getMemberTable() {
     102        return editorAccess.getMemberTable();
     103    }
    104104
    105         protected MemberTableModel getMemberTableModel() {
    106                 return editorAccess.getMemberTableModel();
    107         }
     105    protected MemberTableModel getMemberTableModel() {
     106        return editorAccess.getMemberTableModel();
     107    }
    108108
    109         protected SelectionTable getSelectionTable() {
    110                 return editorAccess.getSelectionTable();
    111         }
     109    protected SelectionTable getSelectionTable() {
     110        return editorAccess.getSelectionTable();
     111    }
    112112
    113         protected SelectionTableModel getSelectionTableModel() {
    114                 return editorAccess.getSelectionTableModel();
    115         }
     113    protected SelectionTableModel getSelectionTableModel() {
     114        return editorAccess.getSelectionTableModel();
     115    }
    116116
    117         protected IRelationEditor getEditor() {
    118                 return editorAccess.getEditor();
    119         }
     117    protected IRelationEditor getEditor() {
     118        return editorAccess.getEditor();
     119    }
    120120
    121         protected TagEditorModel getTagModel() {
    122                 return editorAccess.getTagModel();
    123         }
     121    protected TagEditorModel getTagModel() {
     122        return editorAccess.getTagModel();
     123    }
    124124
    125         protected OsmDataLayer getLayer() {
    126                 return editorAccess.getEditor().getLayer();
    127         }
     125    protected OsmDataLayer getLayer() {
     126        return editorAccess.getEditor().getLayer();
     127    }
    128128
    129         public boolean isExpertOnly() {
    130                 return false;
    131         }
     129    public boolean isExpertOnly() {
     130        return false;
     131    }
    132132}
Note: See TracChangeset for help on using the changeset viewer.