use of org.obeonetwork.tools.classdiagramconfiguration.Configuration in project InformationSystem by ObeoNetwork.
the class GenerateVsmHandler method execute.
/**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorPart activeEditor = HandlerUtil.getActiveEditor(event);
Configuration configuration = getConfiguration(activeEditor);
EditingDomain editingDomain = getEditingDomainFromEditor(activeEditor);
ClassDiagramGenerator generator = new ClassDiagramGenerator(configuration, editingDomain);
Collection<RepresentationDescription> newDescriptions = generator.generate();
if (!newDescriptions.isEmpty() && activeEditor instanceof ISelectionProvider) {
((ISelectionProvider) activeEditor).setSelection(new StructuredSelection(newDescriptions));
}
return null;
}
Aggregations