Changeset 9661 in josm for trunk/src


Ignore:
Timestamp:
2016-01-28T09:29:14+01:00 (9 years ago)
Author:
Don-vip
Message:

fix/cleanup unit tests

File:
1 edited

Legend:

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

    r9659 r9661  
    1414import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    1515import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    16 import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor;
     16import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
    1717import org.openstreetmap.josm.gui.dialogs.relation.MemberTable;
    1818import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel;
    19 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
    2019import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2120import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener;
     
    4746        putValue(SMALL_ICON, ImageProvider.get("dialogs/refresh"));
    4847        putValue(NAME, tr("Refresh"));
    49         getEditor().getRootPane().getActionMap().put("refresh", this);
    50         getEditor().getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), "refresh");
     48        if (editor instanceof JComponent) {
     49            ((JComponent) editor).getRootPane().getActionMap().put("refresh", this);
     50            ((JComponent) editor).getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), "refresh");
     51        }
    5152        Main.main.undoRedo.addCommandQueueListener(this);
    5253        updateEnabledState();
    53     }
    54 
    55     private GenericRelationEditor getEditor() {
    56         return (GenericRelationEditor) editor;
    5754    }
    5855
     
    7067        if (isEditorDirty() && confirmDiscardDirtyData() != 0)
    7168            return;
    72         getEditor().reloadDataFromRelation();
     69        editor.reloadDataFromRelation();
    7370    }
    7471
Note: See TracChangeset for help on using the changeset viewer.