use of eu.esdihumboldt.hale.ui.style.dialog.FeatureStyleDialog in project hale by halestudio.
the class TypeStyleHandler method execute.
/**
* @see IHandler#execute(ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// collect types and associated data sets
SetMultimap<DataSet, TypeDefinition> types = collectTypesFromSelection(event);
Pair<TypeDefinition, DataSet> typeInfo = null;
// select a type
if (types.size() == 1) {
Entry<DataSet, TypeDefinition> entry = types.entries().iterator().next();
typeInfo = new Pair<TypeDefinition, DataSet>(entry.getValue(), entry.getKey());
} else if (!types.isEmpty()) {
// choose through dialog
DataSetTypeSelectionDialog dialog = new DataSetTypeSelectionDialog(Display.getCurrent().getActiveShell(), "Multiple types: select which to change the style for", null, types);
if (dialog.open() == DataSetTypeSelectionDialog.OK) {
typeInfo = dialog.getObject();
}
}
if (typeInfo != null) {
try {
FeatureStyleDialog dialog = new FeatureStyleDialog(typeInfo.getFirst(), typeInfo.getSecond());
dialog.setBlockOnOpen(false);
dialog.open();
} catch (Exception e) {
throw new ExecutionException("Could not open style dialog", e);
}
}
return null;
}
use of eu.esdihumboldt.hale.ui.style.dialog.FeatureStyleDialog in project hale by halestudio.
the class FeatureTypeStyleAction method run.
/**
* @see Action#run()
*/
@Override
public void run() {
try {
FeatureStyleDialog dialog = new FeatureStyleDialog(type, dataSet);
dialog.setBlockOnOpen(false);
dialog.open();
} catch (Exception e) {
// $NON-NLS-1$
log.error("Error opening style editor dialog", e);
}
}
Aggregations