Ignore:
Timestamp:
2009-07-19T19:04:49+02:00 (15 years ago)
Author:
Gubaer
Message:

removed dependencies to Main.ds, removed Main.ds
removed AddVisitor, NameVisitor, DeleteVisitor - unnecessary double dispatching for these simple cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JosmAction.java

    r1415 r1814  
    99import org.openstreetmap.josm.Main;
    1010import org.openstreetmap.josm.data.osm.DataSet;
     11import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1112import org.openstreetmap.josm.tools.Destroyable;
    1213import org.openstreetmap.josm.tools.ImageProvider;
     
    6162        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc));
    6263        putValue("toolbar", iconName);
    63         if (register)
     64        if (register) {
    6465            Main.toolbar.register(this);
     66        }
    6567    }
    6668
     
    9294    private void setHelpId() {
    9395        String helpId = "Action/"+getClass().getName().substring(getClass().getName().lastIndexOf('.')+1);
    94         if (helpId.endsWith("Action"))
     96        if (helpId.endsWith("Action")) {
    9597            helpId = helpId.substring(0, helpId.length()-6);
     98        }
    9699        putValue("help", helpId);
    97100    }
     101
     102    /**
     103     * Replies the current edit layer
     104     *
     105     * @return the current edit layer. null, if no edit layer exists
     106     */
     107    protected OsmDataLayer getEditLayer() {
     108        return Main.main.getEditLayer();
     109    }
     110
     111    /**
     112     * Replies the current dataset
     113     *
     114     * @return the current dataset. null, if no current dataset exists
     115     */
     116    protected DataSet getCurrentDataSet() {
     117        return Main.main.getCurrentDataSet();
     118    }
    98119}
Note: See TracChangeset for help on using the changeset viewer.