/** Replies the resource to which the SarlEnumeration is attached. */ @Pure public Resource eResource() { return getSarlEnumeration().eResource(); }
/** Add a modifier. * @param modifier the modifier to add. */ public void addModifier(String modifier) { if (!Strings.isEmpty(modifier)) { this.sarlEnumeration.getModifiers().add(modifier); } }
/** Initialize the Ecore element when inner type declaration. */ public void eInit(XtendTypeDeclaration container, String name, IJvmTypeProvider context) { if (this.sarlEnumeration == null) { this.container = container; this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration(); container.getMembers().add(this.sarlEnumeration); if (!Strings.isEmpty(name)) { this.sarlEnumeration.setName(name); } } }
/** Initialize the Ecore element when inside a script. */ public void eInit(SarlScript script, String name, IJvmTypeProvider context) { setTypeResolutionContext(context); if (this.sarlEnumeration == null) { this.container = script; this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration(); script.getXtendTypes().add(this.sarlEnumeration); this.sarlEnumeration.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration()); if (!Strings.isEmpty(name)) { this.sarlEnumeration.setName(name); } } }
if (!Strings.isEmpty(enumeration.getName())) { it.append("class ").append(enumeration.getName()); //$NON-NLS-1$ it.append("(Enum"); //$NON-NLS-1$ it.append(newType("enum.Enum")); //$NON-NLS-1$ generateDocString(getTypeBuilder().getDocumentation(enumeration), it); int i = 0; for (final XtendMember item : enumeration.getMembers()) { if (context.getCancelIndicator().isCanceled()) { return false;
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlEnumeration().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlEnumeration(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlEnumeration().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Replies the resource to which the SarlEnumeration is attached. */ @Pure public Resource eResource() { return getSarlEnumeration().eResource(); }