use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class PreviewHTMLReportHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IArchimateModel model = getActiveArchimateModel();
if (model != null) {
HTMLReportExporter exporter = new HTMLReportExporter(model);
exporter.preview();
}
return null;
}
use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class JasperReportsHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IArchimateModel model = getActiveArchimateModel();
if (model != null) {
WizardDialog dialog = new ExtendedWizardDialog(workbenchWindow.getShell(), new ExportJasperReportsWizard(model), // $NON-NLS-1$
"ExportJasperReportsWizard");
dialog.open();
}
return null;
}
use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class CreateMapViewCheatSheetAction method run.
public void run(String[] params, ICheatSheetManager manager) {
IViewPart viewPart = ViewManager.showViewPart(ITreeModelView.ID, true);
if (viewPart == null) {
MessageDialog.openWarning(Display.getCurrent().getActiveShell(), Messages.CreateMapViewCheatSheetAction_0, Messages.CreateMapViewCheatSheetAction_1);
return;
}
IArchimateModel model = viewPart.getAdapter(IArchimateModel.class);
if (model == null) {
MessageDialog.openWarning(Display.getCurrent().getActiveShell(), Messages.CreateMapViewCheatSheetAction_2, Messages.CreateMapViewCheatSheetAction_3);
return;
}
EList<IDiagramModel> diagramModels = model.getDiagramModels();
if (diagramModels.size() < 2) {
MessageDialog.openWarning(Display.getCurrent().getActiveShell(), Messages.CreateMapViewCheatSheetAction_4, Messages.CreateMapViewCheatSheetAction_5);
return;
}
CommandStack stack = (CommandStack) model.getAdapter(CommandStack.class);
if (stack != null) {
stack.execute(new NewMapViewCommand(model));
}
}
use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class FieldDataFactory method getFieldValue.
public static Object getFieldValue(Object dataElement, String fieldName) {
if ("this".equals(fieldName)) {
// $NON-NLS-1$
return dataElement;
}
if ("id".equals(fieldName) && dataElement instanceof IIdentifier) {
// $NON-NLS-1$
return ((IIdentifier) dataElement).getId();
}
if ("name".equals(fieldName) && dataElement instanceof INameable) {
// $NON-NLS-1$
String name = ((INameable) dataElement).getName();
if (name == null || "".equals(name)) {
// $NON-NLS-1$
name = ArchiLabelProvider.INSTANCE.getDefaultName(((EObject) dataElement).eClass());
}
return name;
}
if ("type".equals(fieldName) && dataElement instanceof EObject) {
// $NON-NLS-1$
return ArchiLabelProvider.INSTANCE.getDefaultName(((EObject) dataElement).eClass());
}
if ("documentation".equals(fieldName) && dataElement instanceof IDocumentable) {
// $NON-NLS-1$
String s = ((IDocumentable) dataElement).getDocumentation();
return StringUtils.isSet(s) ? s : null;
}
if ("purpose".equals(fieldName) && dataElement instanceof IArchimateModel) {
// $NON-NLS-1$
String s = ((IArchimateModel) dataElement).getPurpose();
return StringUtils.isSet(s) ? s : null;
}
if ("relation_source".equals(fieldName) && dataElement instanceof IArchimateRelationship) {
// $NON-NLS-1$
IArchimateRelationship relation = (IArchimateRelationship) dataElement;
IArchimateConcept source = relation.getSource();
String s = source.getName();
return StringUtils.isSet(s) ? s : null;
}
if ("relation_target".equals(fieldName) && dataElement instanceof IArchimateRelationship) {
// $NON-NLS-1$
IArchimateRelationship relation = (IArchimateRelationship) dataElement;
IArchimateConcept target = relation.getTarget();
String s = target.getName();
return StringUtils.isSet(s) ? s : null;
}
return null;
}
use of com.archimatetool.model.IArchimateModel in project archi by archimatetool.
the class ValidatorView method selectionChanged.
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if (part == this || part == null) {
return;
}
IArchimateModel model = part.getAdapter(IArchimateModel.class);
if (model != null) {
fModel = model;
}
fActionValidate.setEnabled(fModel != null);
}
Aggregations