/** Replies the canonical name of the given object. * * @param object the object. * @return the canonical name or <code>null</code> if it cannot be computed. */ protected String canonicalName(EObject object) { if (object instanceof JvmIdentifiableElement) { return ((JvmIdentifiableElement) object).getQualifiedName(); } final EObject jvmElement = this.associations.getPrimaryJvmElement(object); if (jvmElement instanceof JvmIdentifiableElement) { return ((JvmIdentifiableElement) jvmElement).getQualifiedName(); } return null; }
/** Transform the field. * * @param source the feature to transform. * @param container the target container of the transformation result. */ @Override protected void transform(XtendField source, JvmGenericType container) { super.transform(source, container); // Override the visibility final JvmField field = (JvmField) this.sarlAssociations.getPrimaryJvmElement(source); setVisibility(field, source); final GenerationContext context = getContext(container); if (context != null) { final String name = source.getName(); if (!Strings.isNullOrEmpty(name)) { context.incrementSerial(name.hashCode()); } final JvmTypeReference type = source.getType(); if (type != null) { context.incrementSerial(type.getIdentifier().hashCode()); } } }
if (!isIgnored(UNUSED_AGENT_CAPACITY)) { final XtendTypeDeclaration container = uses.getDeclaringType(); final JvmDeclaredType jvmContainer = (JvmDeclaredType) this.associations.getPrimaryJvmElement(container); final Map<String, JvmOperation> importedFeatures = CollectionLiterals.newHashMap(); for (final JvmOperation operation : jvmContainer.getDeclaredOperations()) {
@Override public Object execute(ExecutionEvent event) throws ExecutionException { final IStructuredSelection activeSelection = HandlerUtil.getCurrentStructuredSelection(event); if (activeSelection != null && activeSelection != StructuredSelection.EMPTY) { final ElementDescription selectedElement = this.typeSelector.searchAndSelect(false, activeSelection.toArray()); if (selectedElement != null) { IJavaElement realJavaElement = null; if (selectedElement.element instanceof IJavaElement) { realJavaElement = (IJavaElement) selectedElement.element; } else if (selectedElement.element instanceof XtendTypeDeclaration) { final EObject jvmElement = this.sarlAssociations.getPrimaryJvmElement((XtendTypeDeclaration) selectedElement.element); if (jvmElement instanceof JvmIdentifiableElement) { realJavaElement = this.javaElementFinder.findElementFor((JvmIdentifiableElement) jvmElement); } } if (realJavaElement != null) { OpenTypeHierarchyUtil.open(realJavaElement, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); } } else { final OpenTypeHierarchyAction jdtTool = new OpenTypeHierarchyAction(HandlerUtil.getActiveSite(event)); jdtTool.run(activeSelection); } } return null; }
final EObject element = this.associations.getPrimaryJvmElement(capacity); assert element instanceof JvmType; if (!reference.isSubtypeOf((JvmType) element)) {
(JvmIdentifiableElement) getJvmModelAssociations().getPrimaryJvmElement(executable.getDeclaringType()), name); final InferredPrototype inferredPrototype = getActionPrototypeProvider().createPrototypeFromSarlModel(actionName,