/**
* @see org.locationtech.udig.project.command.MapCommand#run()
*/
@SuppressWarnings("unchecked")
public void run( IProgressMonitor monitor ) throws Exception {
ILayer editLayer = getMap().getEditManager().getEditLayer();
if (editLayer == null) {
editLayer = findEditLayer();
}
if (editLayer == null) {
MessageDialog.openError(Display.getDefault().getActiveShell(),
Messages.CreateFeatureCommand_error_title,
Messages.CreateFeatureCommand_error_message);
return;
}
FeatureStore<SimpleFeatureType, SimpleFeature> store = editLayer.getResource(
FeatureStore.class, null);
transform();
if (store.getTransaction() == Transaction.AUTO_COMMIT) {
throw new Exception("Error transaction has not been started"); //$NON-NLS-1$
}