@Override public GenModel getGenModel() { // We can't blindly cache the genModel, since we need to support moving the GenPackage to another container, // but the cast is expensive, so we'd like to do it no more than absolutely necessary. // if (eContainerFeatureID == GenModelPackage.GEN_PACKAGE__GEN_MODEL) { genBaseContainer = null; if (eContainer != genModelContainer) { genModelContainer = (GenModel)eContainer; } return genModelContainer; } genModelContainer = null; if (eContainer != genBaseContainer) { genBaseContainer = (GenBase)eContainer; } return genBaseContainer != null ? genBaseContainer.getGenModel() : null; }
@Override public GenModel getGenModel() { // We can't blindly cache the genModel, since we need to support moving the GenPackage to another container, // but the cast is expensive, so we'd like to do it no more than absolutely necessary. // if (eContainerFeatureID == GenModelPackage.GEN_PACKAGE__GEN_MODEL) { genBaseContainer = null; if (eContainer != genModelContainer) { genModelContainer = (GenModel)eContainer; } return genModelContainer; } genModelContainer = null; if (eContainer != genBaseContainer) { genBaseContainer = (GenBase)eContainer; } return genBaseContainer.getGenModel(); }
private void updateImportManager() { if (generatingObject != null) { ((GenBase)generatingObject).getGenModel().setImportManager(importManager); } }
private void updateImportManager() { if (generatingObject != null) { ((GenBase)generatingObject).getGenModel().setImportManager(importManager); } }
public GenModel getGenModel() { GenBase container = (GenBase)eInternalContainer(); return container == null ? null : container.getGenModel(); }
public GenModel getGenModel() { return ((GenBase)eInternalContainer()).getGenModel(); }
/** * Returns the user-specified portion of the dynamic template path from the GenModel. * @since org.eclipse.emf.codegen.ecore 2.2.2 */ @Override protected List<String> getUserTemplatePath() { String templateLocation = ((GenBase)generatingObject).getGenModel().getTemplateDirectory(); if (templateLocation != null && templateLocation.length() != 0) { if (templateLocation.indexOf(':') == -1) { templateLocation = URI.createPlatformResourceURI(templateLocation, true).toString(); } return Collections.singletonList(templateLocation); } return Collections.emptyList(); }
@Override protected void setLineDelimiter(String lineDelimiter) { super.setLineDelimiter(lineDelimiter); if (generatingObject != null) { ((GenBase)generatingObject).getGenModel().setLineDelimiter(lineDelimiter); } }
@Override protected void setLineDelimiter(String lineDelimiter) { super.setLineDelimiter(lineDelimiter); if (generatingObject != null) { ((GenBase)generatingObject).getGenModel().setLineDelimiter(lineDelimiter); } }
/** * Returns the user-specified portion of the dynamic template path from the GenModel. * @since org.eclipse.emf.codegen.ecore 2.2.2 */ @Override protected List<String> getUserTemplatePath() { String templateLocation = ((GenBase)generatingObject).getGenModel().getTemplateDirectory(); if (templateLocation != null && templateLocation.length() != 0) { if (templateLocation.indexOf(':') == -1) { templateLocation = URI.createPlatformResourceURI(templateLocation, true).toString(); } return Collections.singletonList(templateLocation); } return Collections.emptyList(); }
if (copyrightHolder != null && copyrightHolder.hasCopyright()) { stringBuffer.append(TEXT_4); stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer))); }} stringBuffer.append(TEXT_5);
if (copyrightHolder != null && copyrightHolder.hasCopyright()) { stringBuffer.append(TEXT_4); stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer))); }} stringBuffer.append(TEXT_5);
if (copyrightHolder != null && copyrightHolder.hasCopyright()) { stringBuffer.append(TEXT_1); stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer))); } else { stringBuffer.append(TEXT_2);
if (copyrightHolder != null && copyrightHolder.hasCopyright()) { stringBuffer.append(TEXT_1); stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer))); } else { stringBuffer.append(TEXT_2);
if (copyrightHolder != null && copyrightHolder.hasCopyright()) { stringBuffer.append(TEXT_4); stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer))); }} stringBuffer.append(TEXT_5);
if (copyrightHolder != null && copyrightHolder.hasCopyright()) { stringBuffer.append(TEXT_4); stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer))); }} stringBuffer.append(TEXT_5);
if (copyrightHolder != null && copyrightHolder.hasCopyright()) { stringBuffer.append(TEXT_4); stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer))); }} stringBuffer.append(TEXT_5);
if (copyrightHolder != null && copyrightHolder.hasCopyright()) { stringBuffer.append(TEXT_1); stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer))); } else { stringBuffer.append(TEXT_2);
@Override protected Command doCreateCommand(GenBase selectedObject) { return AddCommand.create(getEditingDomain(), selectedObject, GenModelPackage.Literals.GEN_BASE__GEN_ANNOTATIONS, selectedObject.getGenModel().createGenAnnotation()); } };
/** * Returns the GenBase object's GenAnnotation, creating one if necessary. */ public static GenAnnotation findOrCreateGenAnnotation(GenBase genBase, String source) { GenAnnotation genAnnotation = genBase.getGenAnnotation(source); if (genAnnotation == null) { genAnnotation = genBase.getGenModel().createGenAnnotation(); genAnnotation.setSource(source); genBase.getGenAnnotations().add(genAnnotation); } return genAnnotation; } }