/** @generated NOT */ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) { boolean patch; boolean linkAllowed; boolean delegationAllowed; // port component container patch = (req.getContainer().eContainer().eContainer() instanceof PatchImpl); EObject sourceContainer = req.getSource().eContainer().eContainer(); EObject targetContainer = req.getTarget().eContainer().eContainer(); linkAllowed = (sourceContainer == targetContainer) && ((Port) req.getTarget()).getDirection() == Direction.IN && ((Port) req.getTarget()).getIncomingConnection() == null && (!(((Port) req.getSource()).getDataType() == DataType.SOUND && ((Port) req.getTarget()).getDataType() == DataType.CONTROL)); if (sourceContainer instanceof PatchImpl) { delegationAllowed = sourceContainer.eContents().contains(targetContainer); } else if (targetContainer instanceof PatchImpl) { delegationAllowed = targetContainer.eContents().contains(sourceContainer); } else { delegationAllowed = (sourceContainer.eContents().contains(targetContainer) || targetContainer.eContents().contains(sourceContainer)); } delegationAllowed = delegationAllowed && ((Port) req.getTarget()).getDirection() == ((Port) req.getSource()).getDirection() && ((Port) req.getTarget()).getIncomingConnection() == null && (!(((Port) req.getSource()).getDataType() == DataType.SOUND && ((Port) req.getTarget()).getDataType() == DataType.CONTROL)); if (req.getTarget().eContainer() instanceof AtomicSoundComponent) { delegationAllowed = delegationAllowed && ((Port) req.getTarget()).getDirection() == Direction.IN; } if (SoundgatesElementTypes.Link_4001 == req.getElementType() && patch && linkAllowed) { return getGEFWrapper(new LinkCreateCommand(req, req.getSource(), req.getTarget())); } if (SoundgatesElementTypes.Link_4002 == req.getElementType() && !patch && linkAllowed) { return getGEFWrapper(new Link2CreateCommand(req, req.getSource(), req.getTarget())); } if (SoundgatesElementTypes.Delegation_4003 == req.getElementType() && delegationAllowed) { return getGEFWrapper(new DelegationCreateCommand(req, req.getSource(), req.getTarget())); } return null; }
/** * Gets the nearest AST child at the given position. It browses the children of the given * candidate and returns the nearest children if it exists. * * @param candidate is the current candidate to browse * @param posBegin is the beginning index * @param posEnd is the ending index * @return the nearest AST node in the children of the current candidate */ private ASTNode getChildrenCandidate(EObject candidate, int posBegin, int posEnd) { ASTNode child = null; Iterator<EObject> itContents = candidate.eContents().iterator(); while (itContents.hasNext()) { EObject eContent = itContents.next(); ASTNode astNode = null; if (eContent instanceof ASTNode) { astNode = (ASTNode) eContent; } else if (eContent instanceof CollectionItem) { astNode = ((CollectionItem) eContent).getItem(); } if (astNode != null) { int startPosition = astNode.getStartPosition(); int endPosition = astNode.getEndPosition(); if (startPosition > -1 && endPosition > -1 && startPosition <= posBegin && endPosition >= posEnd) { ASTNode childCandidate = getChildrenCandidate(astNode, posBegin, posEnd); if (childCandidate != null) { child = childCandidate; } else { child = astNode; } break; } } } return child; }
private void fillEReference(EObject eObject, JsonNode root, Resource resource) { final EClass eClass = eObject.eClass(); for (Iterator<Entry<String, JsonNode>> it = root.getFields(); it.hasNext(); ) { Entry<String, JsonNode> field = it.next(); String key = field.getKey(); JsonNode value = field.getValue(); EReference reference = getEReference(eClass, key); if (reference != null && !reference.isContainment() && !reference.isDerived() && !reference.isTransient()) { if (value.isArray()) { for (Iterator<JsonNode> itEl = value.getElements(); itEl.hasNext(); ) { JsonNode current = itEl.next(); createProxyReference(eObject, root, current, reference, resource); } } else { createProxyReference(eObject, root, value, reference, resource); } } } for (EObject content : eObject.eContents()) { if (processed.containsKey(content)) fillEReference(content, processed.get(content), resource); } }
@Check public void checkBlocIDUnique(final Bloc bloc) { EObject _eContainer = bloc.eContainer(); EList<EObject> _eContents = _eContainer.eContents(); for (final EObject o : _eContents) { if ((o instanceof Bloc)) { final Bloc b = ((Bloc) o); boolean _notEquals = (!Objects.equal(b, bloc)); if (_notEquals) { int _name = b.getName(); int _name_1 = bloc.getName(); boolean _equals = (_name == _name_1); if (_equals) { this.error("Bloc ID already exists.", Literals.BLOC__NAME, MacroValidator.INVALID_NAME); } } } else { boolean _equals_1 = ((o instanceof onLoadBloc) == false); if (_equals_1) { this.error( "An element of the Macro isn\'t a Bloc nor an OnLoadBloc. All elements of Macros should be Blocs.", Literals.DOMAIN__ELEMENTS, MacroValidator.INVALID_ELEMENT); } } } }
/* * (non-Javadoc) * * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getSemanticCommand(org.eclipse.emf.edit.domain.EditingDomain, * org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.infra.core.clipboard.PapyrusClipboard) */ @Override public org.eclipse.emf.common.command.Command getSemanticCommand( EditingDomain domain, EObject targetOwner, PapyrusClipboard<Object> papyrusClipboard) { CompoundCommand compoundCommand = new CompoundCommand("Rename root paste elements"); // $NON-NLS-1$ List<EObject> filterDescendants = EcoreUtil.filterDescendants(papyrusClipboard.getTarget()); for (Iterator<EObject> iterator = filterDescendants.iterator(); iterator.hasNext(); ) { EObject target = iterator.next(); if (target instanceof NamedElement) { NamedElement namedElement = (NamedElement) target; if (namedElement.getName() != null) { String defaultCopyNameWithIncrement = NamedElementUtil.getDefaultCopyNameWithIncrement( namedElement, targetOwner.eContents()); RenameElementCommand renameElementCommand = new RenameElementCommand( (TransactionalEditingDomain) domain, namedElement, defaultCopyNameWithIncrement); compoundCommand.append(renameElementCommand); } } } // An empty can't be executed if (compoundCommand.getCommandList().isEmpty()) { return null; } return compoundCommand; }
public String syntheticName(final KeyAST b) { final EObject binding = b.eContainer(); EStructuralFeature _eContainingFeature = b.eContainingFeature(); String _name = _eContainingFeature.getName(); String _plus = ("_" + _name); EObject _eContainer = binding.eContainer(); EList<EObject> _eContents = _eContainer.eContents(); int _indexOf = _eContents.indexOf(binding); return (_plus + Integer.valueOf(_indexOf)); }
/** * Returns a new collection holding references to all {@link EObject}s of the given elements. That * is, the tree of elements is flattened into one collection. The elements, however, are not * modified. * * @param elements A collection of {@link EObject}s. * @return A new, flat list of all elements. */ public static List<? extends EObject> flattenEObjects(Collection<? extends EObject> elements) { final ArrayList<EObject> result = new ArrayList<EObject>(); final Queue<EObject> queue = new LinkedList<EObject>(); queue.addAll(elements); while (!queue.isEmpty()) { final EObject obj = queue.poll(); result.add(obj); queue.addAll(obj.eContents()); } return result; }
@SuppressWarnings("unchecked") public static <T extends EObject> List<T> getContentsOfType(EObject ele, Class<T> type) { List<T> result = new ArrayList<T>(); if (ele == null) return result; for (EObject object : ele.eContents()) { if (type.isAssignableFrom(object.getClass())) { result.add((T) object); } } return result; }
protected List<ImportNormalizer> internalGetImportedNamespaceResolvers( final EObject context, boolean ignoreCase) { List<ImportNormalizer> importedNamespaceResolvers = Lists.newArrayList(); SimpleAttributeResolver<EObject, String> importResolver = SimpleAttributeResolver.newResolver(String.class, "importedNamespace"); EList<EObject> eContents = context.eContents(); for (EObject child : eContents) { String value = importResolver.getValue(child); ImportNormalizer resolver = createImportedNamespaceResolver(value, ignoreCase); if (resolver != null) importedNamespaceResolvers.add(resolver); } return importedNamespaceResolvers; }
/** * Extend the given addition group for the given element within the given scope based on GMF * peculiarities * * @param group_p a non-null, modifiable collection * @param element_p a non-null element * @param scope_p a non-null scope */ protected void extendGMFAdditionGroup( Set<EObject> group_p, EObject element_p, IFeaturedModelScope scope_p) { // Node -> Node content if (element_p instanceof Node) { Node elementNode = (Node) element_p; EObject representedElement = elementNode.getElement(); for (EObject child : element_p.eContents()) { boolean addChild = true; if (child instanceof View) { View childView = (View) child; EObject childRepresentedElement = childView.getElement(); addChild = childRepresentedElement == null || childRepresentedElement == representedElement; } if (addChild) group_p.add(child); } } // Edge -> Edge content if (element_p instanceof Edge) group_p.addAll(element_p.eContents()); // Semantic element -> Views if (isGraphicalFromSemantic()) extendGMFAdditionGroupSemanticTarget(group_p, element_p, scope_p); }
/** Tests the CTRL-D keystroke which initiates a delete from model action. See Bugzilla 115108. */ public void testDeleteFromModel() throws Exception { getTestFixture().openDiagram(); LEDEditPart editPartToDelete = (LEDEditPart) getLogicTestFixture() .createShapeUsingTool(LogicSemanticType.LED, new Point(0, 0), getDiagramEditPart()); List primaryEditParts = getDiagramEditPart().getPrimaryEditParts(); assertTrue(primaryEditParts.contains(editPartToDelete)); EObject semanticElement = (EObject) editPartToDelete.getAdapter(EObject.class); EObject semanticContainer = semanticElement.eContainer(); // Select the edit part to be deleted. EditPartViewer rootViewer = getDiagramEditPart().getRoot().getViewer(); rootViewer.deselectAll(); rootViewer.select(editPartToDelete); // Set the preference to not confirm the element deletion. ((IPreferenceStore) getDiagramEditPart().getDiagramPreferencesHint().getPreferenceStore()) .setValue(IPreferenceConstants.PREF_PROMPT_ON_DEL_FROM_MODEL, false); // Create the CTRL-D event Event e = new Event(); e.character = (char) 0x4; e.keyCode = 100; e.stateMask = SWT.CTRL; e.widget = editPartToDelete.getViewer().getControl(); // Simulate the CTRL-D keystroke SelectionTool tool = new SelectionTool(); tool.setEditDomain((EditDomain) getDiagramWorkbenchPart().getDiagramEditDomain()); tool.activate(); tool.keyDown(new KeyEvent(e), rootViewer); // Verify that the edit part and the semantic element have been deleted. primaryEditParts = getDiagramEditPart().getPrimaryEditParts(); assertFalse( "Primary edit part not deleted.", primaryEditParts.contains(editPartToDelete)); // $NON-NLS-1$ assertFalse( "Semantic element not deleted.", semanticContainer.eContents().contains(semanticElement)); // $NON-NLS-1$ }
private Collection<Object> newEquimentDescriptorsForTargetNodeType( EditingDomain domain, NodeType nodeType, Equipment targetEq) { // find the object from the ref and return all possible // creation references. // TODO, possibly optimize, by filtering non Equipments. Collection<Object> newChildDescriptors = Lists.newArrayList(); TreeIterator<EObject> it = nodeType.eAllContents(); while (it.hasNext()) { EObject next = it.next(); if (next.eClass() == LibraryPackage.Literals.EQUIPMENT) { // Match on equipmentcode. Equipment eq = (Equipment) next; if (eq.getEquipmentCode().equals(targetEq.getEquipmentCode())) { // get children and build descriptors. EList<EObject> directContent = next.eContents(); for (EObject targetChild : directContent) { if (targetChild instanceof Equipment) { Equipment eqCopy = (Equipment) EcoreUtil.copy(targetChild); // Set the name as a sequence. String newSequenceNumber = EditUtils.INSTANCE.nextSequenceNumber( domain, targetEq, LibraryPackage.Literals.EQUIPMENT__EQUIPMENTS, LibraryPackage.Literals.COMPONENT__NAME); eqCopy.setName(newSequenceNumber); Lifecycle newLC = GenericsFactory.eINSTANCE.createLifecycle(); newLC.setProposed(NonModelUtils.toXMLDate(NonModelUtils.todayAndNow())); eqCopy.setLifecycle(newLC); newChildDescriptors.add( createChildParameter(LibraryPackage.Literals.EQUIPMENT__EQUIPMENTS, eqCopy)); } } } } } return newChildDescriptors; }
private java.util.List<org.eclipse.emf.ecore.EObject> getAllContents( org.eclipse.emf.ecore.EObject[] contentArray) { java.util.List<org.eclipse.emf.ecore.EObject> result = new java.util.ArrayList<org.eclipse.emf.ecore.EObject>(); for (org.eclipse.emf.ecore.EObject eObject : contentArray) { if (eObject == null) { continue; } result.add(eObject); java.util.List<org.eclipse.emf.ecore.EObject> contents = eObject.eContents(); if (contents == null) { continue; } result.addAll(getAllContents(contents.toArray(new org.eclipse.emf.ecore.EObject[0]))); } return result; }
protected void walk(EObject object) { for (EObject child : object.eContents()) { Collection<Adapter> adapters = child.eAdapters(); if (adapters != null) { boolean once = false; for (Object adapter : adapters) { if (adapter != null) { if (!once) { System.out.println("*** " + child); once = true; } System.out.println(" * " + adapter); } } } walk(child); } }
@Override public EObject getEObject(String uriFragment) { EList<EObject> contents = getContents(); String name = URI.decode(uriFragment); for (int i = 0; i < contents.size(); i++) { EObject root = contents.get(i); EList<EObject> children = root.eContents(); for (int j = 0; j < children.size(); j++) { EObject child = children.get(j); if (child instanceof NameSupport && name.equals(((NameSupport) child).getName())) return child; } } return super.getEObject(uriFragment); }
/** * Return all elements in a flat list which have the type given in <code>types</code>. The entire * model tree is searched, i.e. it is a deep search. * * @param elements A set of elements. * @param types The types which should be returned. * @param includeSubtypes If <code>true</code>, then also subtypes of the given types are included * in the result. * @return A list of all elements which are of a type that is given in <code>types</code>. */ public static List<EObject> collectTypedElements( final List<? extends EObject> elements, final Set<EClass> types, boolean includeSubtypes) { final List<EObject> result = new ArrayList<EObject>(); final Queue<EObject> queue = new LinkedList<EObject>(); queue.addAll(elements); while (!queue.isEmpty()) { final EObject element = queue.poll(); if (includeSubtypes) { for (EClass eClass : types) { if (eClass.isSuperTypeOf(element.eClass())) { result.add(element); break; } } } else { if (types.contains(element.eClass())) result.add(element); } queue.addAll(element.eContents()); } return result; }
public String syntheticToInstanceName(final BindingAST binding) { EObject _eContainer = binding.eContainer(); EList<EObject> _eContents = _eContainer.eContents(); int _indexOf = _eContents.indexOf(binding); return ("_toInstance" + Integer.valueOf(_indexOf)); }
public void _infer(EObject e, IAcceptor<JvmDeclaredType> acceptor, boolean prelinkingPhase) { for (EObject child : e.eContents()) { infer(child, acceptor, prelinkingPhase); } }
/** * States if the given object is related to the context {@link Classifier}. * * @param toFilter the candidate to check for relation * @param context the classifier context object. * @return <code>true</code> if the given object is related to the context {@link Classifier}, * <code>false</code> otherwise. */ public boolean isRelated(EObject toFilter, EObject context) { boolean res = false; if (toFilter.equals(context)) { res = true; } else if (context instanceof Classifier) { if (toFilter instanceof Generalization) { res = ((Classifier) context).getGeneralizations().contains(toFilter) || ((Generalization) toFilter).getGeneral() == context; } else if (toFilter instanceof InterfaceRealization && context instanceof Class) { res = ((Class) context).getInterfaceRealizations().contains(toFilter) || ((InterfaceRealization) toFilter).getContract() == context; } else if (toFilter instanceof Association) { res = ((Classifier) context).getAssociations().contains(toFilter); } else if (toFilter instanceof Artifact && context instanceof ExecutionEnvironment) { for (final Deployment deployment : ((ExecutionEnvironment) context).getDeployments()) { if (deployment.getSuppliers().contains(toFilter)) { res = true; } } } else if (toFilter instanceof ExecutionEnvironment && context instanceof Artifact) { for (final Deployment deployment : ((ExecutionEnvironment) toFilter).getDeployments()) { if (deployment.getSuppliers().contains(context)) { res = true; } } } else if (toFilter instanceof PackageableElement && context instanceof Artifact) { res = ((Artifact) context).getManifestations().contains(toFilter); for (final Manifestation manifestation : ((Artifact) context).getManifestations()) { if (manifestation.getTargets().contains(toFilter)) { res = true; } } } else if (toFilter instanceof Artifact && context instanceof PackageableElement) { res = ((Artifact) toFilter).getManifestations().contains(context); for (final Manifestation manifestation : ((Artifact) toFilter).getManifestations()) { if (manifestation.getTargets().contains(context)) { res = true; } } } else if (toFilter instanceof Feature) { res = isRelated(toFilter.eContainer(), context); } else if (toFilter instanceof Classifier) { if (context == toFilter) { return false; } res = context == toFilter; if (context instanceof EncapsulatedClassifier && toFilter instanceof EncapsulatedClassifier) { if (!res) { if (((EncapsulatedClassifier) context).getOwnedElements().contains(toFilter)) { res = true; } else { for (final Port portContext : ((EncapsulatedClassifier) context).getOwnedPorts()) { if (portIsRelated(toFilter, portContext)) { res = true; break; } } } } } if (context instanceof EncapsulatedClassifier && toFilter instanceof Property) { if (!res) { if (((EncapsulatedClassifier) context).getOwnedAttributes().contains(toFilter)) { res = true; } } } // is it a generalization end if (!res) { for (final Generalization generalization : ((Classifier) context).getGeneralizations()) { if (generalization.getGeneral() == toFilter) { res = true; break; } } } // is it a generalization opposite end if (!res) { for (final Generalization generalization : ((Classifier) toFilter).getGeneralizations()) { if (generalization.getGeneral() == context) { res = true; break; } } } if (toFilter instanceof NamedElement && context instanceof NamedElement) { // is it a dependency end if (!res) { for (final Dependency dependency : ((NamedElement) context).getClientDependencies()) { if (dependency.getClients().contains(toFilter) || dependency.getSuppliers().contains(toFilter)) { res = true; break; } } } } if (context instanceof NamedElement && toFilter instanceof NamedElement) { // is it a dependency end if (!res) { for (final Dependency dependency : ((NamedElement) toFilter).getClientDependencies()) { if (dependency.getClients().contains(context) || dependency.getSuppliers().contains(context)) { res = true; break; } } } } if (toFilter instanceof Interface && context instanceof Class) { // is it a realization end if (!res) { for (final InterfaceRealization realization : ((Class) context).getInterfaceRealizations()) { if (realization.getContract() == toFilter) { res = true; break; } } } } if (context instanceof Interface && toFilter instanceof Class) { // is it a realization end if (!res) { for (final InterfaceRealization realization : ((Class) toFilter).getInterfaceRealizations()) { if (realization.getContract() == context) { res = true; break; } } } } // is it an association end if (!res) { final List<Association> toFilterAsso = ((Classifier) toFilter).getAssociations(); final List<Association> contextAsso = ((Classifier) context).getAssociations(); for (final Association association : toFilterAsso) { if (contextAsso.contains(association)) { res = true; break; } } } } else if (toFilter instanceof Package) { for (final EObject content : toFilter.eContents()) { if (isRelated(content, context)) { res = true; break; } } } } else if (context instanceof Package) { if (toFilter instanceof Package) { res = ((Package) context).getNestedPackages().contains(toFilter) || ((Package) context).getImportedPackages().contains(toFilter); for (final PackageImport packageImport : ((Package) context).getPackageImports()) { if (packageImport.getImportedPackage().equals(toFilter)) { res = true; } } } else { res = ((Package) context).getOwnedElements().contains(toFilter); } } else if (context instanceof Port) { res = portIsRelated(toFilter, (Port) context); } return res; }
private static void performStartup(final IWorkbench workbench, IProgressMonitor monitor) { monitor.beginTask("", 105); Trigger trigger = Trigger.STARTUP; boolean restarting = false; Set<URI> neededRestartTasks = new HashSet<URI>(); try { File restartingFile = getRestartingFile(); if (restartingFile.exists()) { monitor.setTaskName("Loading restart tasks " + restartingFile); Resource resource = SetupCoreUtil.createResourceSet() .getResource(URI.createFileURI(restartingFile.toString()), true); Annotation annotation = (Annotation) EcoreUtil.getObjectByType(resource.getContents(), BasePackage.Literals.ANNOTATION); resource.getContents().remove(annotation); if (ANNOTATION_SOURCE_INITIAL.equals(annotation.getSource())) { if ("true".equals(annotation.getDetails().get(ANNOTATION_DETAILS_KEY_OFFLINE))) { System.setProperty(SetupProperties.PROP_SETUP_OFFLINE_STARTUP, "true"); } if ("true".equals(annotation.getDetails().get(ANNOTATION_DETAILS_KEY_MIRRORS))) { System.setProperty(SetupProperties.PROP_SETUP_MIRRORS_STARTUP, "true"); } } else { for (EObject eObject : annotation.getReferences()) { neededRestartTasks.add(EcoreUtil.getURI(eObject)); } trigger = Trigger.get(annotation.getSource()); restarting = true; } IOUtil.deleteBestEffort(restartingFile); } } catch (Exception ex) { // Ignore } monitor.worked(1); // Disabled for bug 459486: // if (!QUESTIONNAIRE_SKIP) // { // Questionnaire.perform(UIUtil.getShell(), false); // } // This performer is only used to detect a need to update or to open the setup wizard. SetupTaskPerformer performer = null; final ResourceSet resourceSet = SetupCoreUtil.createResourceSet(); SynchronizationController synchronizationController = null; try { synchronizationController = SynchronizerManager.INSTANCE.startSynchronization(false); } catch (Exception ex) { INSTANCE.log(ex); } monitor.setTaskName("Creating a setup task performer"); try { // Ensure that the demand created resources for the installation, workspace, and user are // loaded and created. // Load the resource set quickly without doing ETag checking. resourceSet .getLoadOptions() .put(ECFURIHandlerImpl.OPTION_CACHE_HANDLING, CacheHandling.CACHE_WITHOUT_ETAG_CHECKING); mirror(resourceSet, monitor, 25); // Check the installation and workspace resources for cross references. // This unloads the cross referenced resources and returns the container objects of the root // object(s) of those resources. Set<EObject> eContainers = new HashSet<EObject>(); eContainers.addAll(checkCrossReferences(resourceSet, SetupContext.INSTALLATION_SETUP_URI)); eContainers.addAll(checkCrossReferences(resourceSet, SetupContext.WORKSPACE_SETUP_URI)); if (!eContainers.isEmpty()) { // Reload any resources that have been unloaded, this time with ETag checking. resourceSet .getLoadOptions() .put(ECFURIHandlerImpl.OPTION_CACHE_HANDLING, CacheHandling.CACHE_WITH_ETAG_CHECKING); mirror(resourceSet, monitor, 75); // Resolve the containment proxies of the containers. for (EObject eContainer : eContainers) { for (@SuppressWarnings("unused") EObject eObject : eContainer.eContents()) { // Resolve all containment proxies. } } } else { monitor.worked(75); } try { if (synchronizationController != null) { Synchronization synchronization = synchronizationController.await(); if (synchronization != null) { SynchronizerManager.INSTANCE.performSynchronization(synchronization, true, true); } } } catch (Exception ex) { INSTANCE.log(ex); } // Create the performer with a fully populated resource set. performer = SetupTaskPerformer.createForIDE(resourceSet, SetupPrompter.CANCEL, trigger); } catch (OperationCanceledException ex) { // $FALL-THROUGH$ } catch (Throwable ex) { INSTANCE.log(ex); return; } finally { SetupContext.setSelf(SetupContext.createSelf(resourceSet)); } monitor.worked(1); if (performer != null) { monitor.setTaskName("Initializing the setup task performer"); try { // At this point we know that no prompt was needed. EList<SetupTask> neededTasks = performer.initNeededSetupTasks(new SubProgressMonitor(monitor, 2)); if (restarting) { for (Iterator<SetupTask> it = neededTasks.iterator(); it.hasNext(); ) { SetupTask setupTask = it.next(); if (setupTask.getPriority() == SetupTask.PRIORITY_INSTALLATION || !neededRestartTasks.contains(EcoreUtil.getURI(setupTask))) { it.remove(); } } } if (neededTasks.isEmpty()) { // No tasks are needed, either. Nothing to do. return; } performer.setSkipConfirmation(true); } catch (Throwable ex) { INSTANCE.log(ex); return; } } else { monitor.worked(2); } monitor.worked(1); monitor.setTaskName("Launching the setup wizard"); final SetupTaskPerformer finalPerfomer = performer; UIUtil.asyncExec( new Runnable() { public void run() { if (finalPerfomer != null) { resourceSet.getResources().add(finalPerfomer.getUser().eResource()); } IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); if (workbenchWindow == null) { workbenchWindow = workbench.getWorkbenchWindows()[0]; } SetupWizard updater = finalPerfomer != null ? new SetupWizard.Updater(finalPerfomer) : new SetupWizard.Updater( SetupContext.createInstallationWorkspaceAndUser(resourceSet)); updater.openDialog(workbenchWindow.getShell()); } }); monitor.worked(1); }
private void createChildObjects(EObject eObject) { for (EObject eChildObject : eObject.eContents()) { createObject(eChildObject); } }