import javax.inject.Named;
+import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.services.IServiceConstants;
}
@Execute
- public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) Object selection) {
+ public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) Object selection, ParameterizedCommand command) {
final List<Resource> elements = ISelectionUtils.getPossibleKeys(selection, SelectionHints.KEY_MAIN, Resource.class);
- // we store these to a static variable for pasting.. maybe not the best solution
+ // we store these to a static variable for pasting.. maybe not the best solution
CopyDistrictVertexHandler.elements = elements;
- //CopyDistrictVertexHandler.cut = cut != null && !cut.isEmpty();
+ Object cut = command.getParameterMap().get("org.simantics.district.network.ui.commandparameter.0");
+ CopyDistrictVertexHandler.cut = cut != null;
}
}