Ignore:
Timestamp:
2015-06-20T23:42:21+02:00 (9 years ago)
Author:
Don-vip
Message:

checkstyle: enable relevant whitespace checks and fix them

File:
1 edited

Legend:

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

    r8507 r8510  
    211211        RemoveActiveSourcesAction removeActiveSourcesAction = new RemoveActiveSourcesAction();
    212212        tblActiveSources.getSelectionModel().addListSelectionListener(removeActiveSourcesAction);
    213         tblActiveSources.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0), "delete");
     213        tblActiveSources.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete");
    214214        tblActiveSources.getActionMap().put("delete", removeActiveSourcesAction);
    215215
     
    327327        add(bottomRightTB, gbc);
    328328
    329         /***
    330          * Icon configuration
    331          **/
    332 
     329        // Icon configuration
    333330        if (handleIcons) {
    334331            buildIcons(gbc);
     
    353350        RemoveIconPathAction removeIconPathAction = new RemoveIconPathAction();
    354351        tblIconPaths.getSelectionModel().addListSelectionListener(removeIconPathAction);
    355         tblIconPaths.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0), "delete");
     352        tblIconPaths.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete");
    356353        tblIconPaths.getActionMap().put("delete", removeIconPathAction);
    357354
     
    494491        public void deleteSelected() {
    495492            Iterator<ExtendedSourceEntry> it = data.iterator();
    496             int i=0;
    497             while(it.hasNext()) {
     493            int i = 0;
     494            while (it.hasNext()) {
    498495                it.next();
    499496                if (selectionModel.isSelectedIndex(i)) {
     
    507504        public List<ExtendedSourceEntry> getSelected() {
    508505            List<ExtendedSourceEntry> ret = new ArrayList<>();
    509             for(int i=0; i<data.size();i++) {
     506            for (int i = 0; i < data.size(); i++) {
    510507                if (selectionModel.isSelectedIndex(i)) {
    511508                    ret.add(data.get(i));
     
    586583        public void removeSelected() {
    587584            Iterator<SourceEntry> it = data.iterator();
    588             int i=0;
    589             while(it.hasNext()) {
     585            int i = 0;
     586            while (it.hasNext()) {
    590587                it.next();
    591588                if (selectionModel.isSelectedIndex(i)) {
     
    599596        public void removeIdxs(Collection<Integer> idxs) {
    600597            List<SourceEntry> newData = new ArrayList<>();
    601             for (int i=0; i<data.size(); ++i) {
     598            for (int i = 0; i < data.size(); ++i) {
    602599                if (!idxs.contains(i)) {
    603600                    newData.add(data.get(i));
     
    617614            for (ExtendedSourceEntry info: sources) {
    618615                int pos = data.indexOf(info);
    619                 if (pos >=0) {
     616                if (pos >= 0) {
    620617                    selectionModel.addSelectionInterval(pos, pos);
    621618                }
     
    725722        try {
    726723            sourceUrl = new URL(url);
    727         } catch(MalformedURLException e) {
     724        } catch (MalformedURLException e) {
    728725            File f = new File(url);
    729726            if (f.isFile()) {
     
    788785                    updateOkButtonState();
    789786                }
     787
    790788                @Override
    791789                public void removeUpdate(DocumentEvent e) {
    792790                    updateOkButtonState();
    793791                }
     792
    794793                @Override
    795794                public void changedUpdate(DocumentEvent e) {
     
    958957    class MoveUpDownAction extends AbstractAction implements ListSelectionListener, TableModelListener {
    959958        private final int increment;
     959
    960960        public MoveUpDownAction(boolean isDown) {
    961961            increment = isDown ? 1 : -1;
     
    10541054        private final String url;
    10551055        private final transient List<SourceProvider> sourceProviders;
     1056
    10561057        public ReloadSourcesAction(String url, List<SourceProvider> sourceProviders) {
    10571058            putValue(NAME, tr("Reload"));
     
    11011102        @Override
    11021103        public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    1103             updatePath(rowIndex, (String)aValue);
     1104            updatePath(rowIndex, (String) aValue);
    11041105        }
    11051106
    11061107        public void setIconPaths(Collection<String> paths) {
    11071108            data.clear();
    1108             if (paths !=null) {
     1109            if (paths != null) {
    11091110                data.addAll(paths);
    11101111            }
     
    11381139        public void removeSelected() {
    11391140            Iterator<String> it = data.iterator();
    1140             int i=0;
    1141             while(it.hasNext()) {
     1141            int i = 0;
     1142            while (it.hasNext()) {
    11421143                it.next();
    11431144                if (selectionModel.isSelectedIndex(i)) {
     
    11811182        public void actionPerformed(ActionEvent e) {
    11821183            iconPathsModel.addPath("");
    1183             tblIconPaths.editCellAt(iconPathsModel.getRowCount() -1,0);
     1184            tblIconPaths.editCellAt(iconPathsModel.getRowCount() -1, 0);
    11841185        }
    11851186    }
     
    15001501        public boolean isCellEditable(EventObject anEvent) {
    15011502            if (anEvent instanceof MouseEvent)
    1502                 return ((MouseEvent)anEvent).getClickCount() >= 2;
     1503                return ((MouseEvent) anEvent).getClickCount() >= 2;
    15031504                return true;
    15041505        }
     
    15321533        @Override
    15331534        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    1534             setInitialValue((String)value);
     1535            setInitialValue((String) value);
    15351536            tfFileName.selectAll();
    15361537            return this;
Note: See TracChangeset for help on using the changeset viewer.