private void updateModel(CnATreeElement importRootObject, List<CnATreeElement> changedElement) { if (changedElement != null && changedElement.size() > 9) { // if more than 9 elements changed or added do a complete reload CnAElementFactory.getInstance().reloadModelFromDatabase(); } else { if (importRootObject != null) { CnAElementFactory.getModel(importRootObject) .childAdded(importRootObject.getParent(), importRootObject); CnAElementFactory.getModel(importRootObject).databaseChildAdded(importRootObject); if (changedElement != null) { for (CnATreeElement cnATreeElement : changedElement) { CnAElementFactory.getModel(cnATreeElement) .childAdded(cnATreeElement.getParent(), cnATreeElement); CnAElementFactory.getModel(cnATreeElement).databaseChildAdded(cnATreeElement); } } } if (changedElement != null) { for (CnATreeElement cnATreeElement : changedElement) { CnAElementFactory.getModel(cnATreeElement).childChanged(cnATreeElement); CnAElementFactory.getModel(cnATreeElement).databaseChildChanged(cnATreeElement); } } } }
/** * Cause update to risk analysis object in loaded model. * * @return always true */ @Override public boolean performFinish() { // all has been saved by now, so no need to do anything except refresh // the view: // FIXME server: just reload risk analysis instead of complete model. CnAElementFactory.getInstance().reloadModelFromDatabase(); return true; }
public void run(IAction action) { try { Object sel = ((IStructuredSelection) targetPart.getSite().getSelectionProvider().getSelection()) .getFirstElement(); if (sel instanceof CnATreeElement) { boolean inheritIcon = Activator.getDefault() .getPreferenceStore() .getBoolean(PreferenceConstants.INHERIT_SPECIAL_GROUP_ICON); CnATreeElement parent = (CnATreeElement) sel; CnATreeElement newBaustein = CnAElementFactory.getInstance() .saveNew(parent, BausteinUmsetzung.TYPE_ID, null, inheritIcon); EditorFactory.getInstance().openEditor(newBaustein); } } catch (Exception e) { ExceptionUtil.log(e, Messages.AddBausteinActionDelegate_0); } }
@Override public void loaded(ISO27KModel model) { JobScheduler.scheduleInitJob(loadDataJob); CnAElementFactory.getInstance().removeLoadListener(this); }
/** * Cause update to risk analysis object in loaded model. * * @return always true */ @Override public boolean performCancel() { // FIXME server: just reload risk analysis instead of complete model. CnAElementFactory.getInstance().reloadModelFromDatabase(); return true; }