- Timestamp:
- 2015-10-04T12:28:59+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java
r8510 r8819 95 95 @Override 96 96 public void actionPerformed(ActionEvent e) { 97 Layer sourceLayer = Main.main.getEditLayer(); 98 if (sourceLayer == null) 99 return; 100 merge(sourceLayer); 97 merge(getSourceLayer()); 101 98 } 102 99 … … 106 103 @Override 107 104 public void run() { 108 if (getEditLayer() == null) { 105 final Layer sourceLayer = getSourceLayer(); 106 if (sourceLayer == null) { 109 107 setEnabled(false); 110 return; 108 } else { 109 final List<Layer> possibleMergeTargets = LayerListDialog.getInstance().getModel().getPossibleMergeTargets(sourceLayer); 110 setEnabled(!possibleMergeTargets.isEmpty()); 111 111 } 112 setEnabled(!LayerListDialog.getInstance().getModel().getPossibleMergeTargets(getEditLayer()).isEmpty());113 112 } 114 113 }); 114 } 115 116 protected Layer getSourceLayer() { 117 return Main.map != null ? Main.main.getActiveLayer() : null; 115 118 } 116 119
Note:
See TracChangeset
for help on using the changeset viewer.