Ignore:
Timestamp:
2009-12-19T01:37:20+01:00 (15 years ago)
Author:
bilbo
Message:

Fixed #4197

Multipolygon menu entry is now enabled only if layer is loaded and something is selected

Location:
applications/editors/josm/plugins/multipoly/src/multipoly
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/multipoly/src/multipoly/MultipolyAction.java

    r18962 r19138  
    3333 * New relation with type=multipolygon is created
    3434 *
    35  * If one or more of ways is already in relation with type=multipolygon or the way os not closed,
     35 * If one or more of ways is already in relation with type=multipolygon or the way is not closed,
    3636 * then error is reported and no relation is created
    3737 *
     
    4949  Shortcut.registerShortcut("tools:multipoly", tr("Tool: {0}", tr("Create multipolygon")),
    5050  KeyEvent.VK_M, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
    51   setEnabled(true);
    5251 }
    5352
     
    144143 }
    145144
     145 /** Enable this action only if something is selected */
     146 @Override protected void updateEnabledState() {
     147  if (getCurrentDataSet()==null) {
     148   setEnabled(false);
     149  } else {
     150   updateEnabledState(getCurrentDataSet().getSelected());
     151  }
     152 }
     153
     154 /** Enable this action only if something is selected */
     155 @Override protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
     156  setEnabled(selection != null && !selection.isEmpty());
     157 }
     158
    146159}
  • applications/editors/josm/plugins/multipoly/src/multipoly/MultipolyPlugin.java

    r18079 r19138  
    3535      toolsMenu.add(new JMenuItem(new MultipolyAction()));
    3636    }
    37    
     37
    3838  }
    3939
Note: See TracChangeset for help on using the changeset viewer.