| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| * |
| * This copyright notice shows up in the generated Java code |
| */ |
| package org.eclipse.osbp.xtext.strategy.jvmmodel; |
| |
| import java.util.List; |
| import javax.inject.Inject; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable; |
| import org.eclipse.osbp.ecview.core.common.model.core.YLayout; |
| import org.eclipse.osbp.ecview.core.extension.model.extension.YFormLayout; |
| import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy; |
| import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider; |
| import org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy; |
| import org.eclipse.osbp.utils.annotation.CommonUtils; |
| import org.eclipse.osbp.utils.constants.GeneratorConstants; |
| import org.eclipse.osbp.xtext.strategy.LayoutingEnum; |
| import org.eclipse.osbp.xtext.strategy.LayoutingStrategy; |
| import org.eclipse.osbp.xtext.strategy.StrategyPackage; |
| import org.eclipse.osbp.xtext.strategy.constants.StrategyConstants; |
| import org.eclipse.xtend2.lib.StringConcatenation; |
| import org.eclipse.xtext.common.types.JvmAnnotationReference; |
| import org.eclipse.xtext.common.types.JvmConstructor; |
| import org.eclipse.xtext.common.types.JvmDeclaredType; |
| import org.eclipse.xtext.common.types.JvmField; |
| import org.eclipse.xtext.common.types.JvmFormalParameter; |
| import org.eclipse.xtext.common.types.JvmGenericType; |
| import org.eclipse.xtext.common.types.JvmMember; |
| import org.eclipse.xtext.common.types.JvmOperation; |
| import org.eclipse.xtext.common.types.JvmTypeReference; |
| import org.eclipse.xtext.common.types.JvmVisibility; |
| import org.eclipse.xtext.xbase.compiler.output.ITreeAppendable; |
| import org.eclipse.xtext.xbase.jvmmodel.IJvmDeclaredTypeAcceptor; |
| import org.eclipse.xtext.xbase.jvmmodel.JvmAnnotationReferenceBuilder; |
| import org.eclipse.xtext.xbase.jvmmodel.JvmTypeReferenceBuilder; |
| import org.eclipse.xtext.xbase.jvmmodel.JvmTypesBuilder; |
| import org.eclipse.xtext.xbase.lib.Extension; |
| import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; |
| import org.osgi.service.component.annotations.Component; |
| |
| @SuppressWarnings("all") |
| public class StrategyDSLLayoutingStrategyCreator { |
| @Inject |
| @Extension |
| private JvmTypesBuilder _jvmTypesBuilder; |
| |
| @Inject |
| @Extension |
| private StrategyConstants _strategyConstants; |
| |
| @Inject |
| @Extension |
| private CommonUtils _commonUtils; |
| |
| private JvmAnnotationReferenceBuilder _annotationTypesBuilder; |
| |
| private JvmTypeReferenceBuilder _typeReferenceBuilder; |
| |
| public void createLayoutingStrategy(final StrategyPackage pckg, final LayoutingStrategy layoutingStrategy, final IJvmDeclaredTypeAcceptor acceptor, final JvmAnnotationReferenceBuilder annotationTypesBuilder, final JvmTypeReferenceBuilder typeReferenceBuilder) { |
| this.createLayoutingStrategy(pckg, layoutingStrategy, acceptor, annotationTypesBuilder, typeReferenceBuilder, false); |
| } |
| |
| public void createLayoutingStrategy(final StrategyPackage pckg, final LayoutingStrategy layoutingStrategy, final IJvmDeclaredTypeAcceptor acceptor, final JvmAnnotationReferenceBuilder annotationTypesBuilder, final JvmTypeReferenceBuilder typeReferenceBuilder, final boolean osdefault) { |
| this._annotationTypesBuilder = annotationTypesBuilder; |
| this._typeReferenceBuilder = typeReferenceBuilder; |
| StringConcatenation _builder = new StringConcatenation(); |
| String _name = pckg.getName(); |
| _builder.append(_name, ""); |
| _builder.append("."); |
| String _strategyClassName = this.getStrategyClassName(layoutingStrategy, osdefault); |
| _builder.append(_strategyClassName, ""); |
| JvmGenericType clsStrategy = this._jvmTypesBuilder.toClass(layoutingStrategy, _builder.toString()); |
| EList<JvmTypeReference> _superTypes = clsStrategy.getSuperTypes(); |
| JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(AbstractLayoutingStrategy.class); |
| _superTypes.add(_typeRef); |
| final Procedure1<JvmGenericType> _function = new Procedure1<JvmGenericType>() { |
| public void apply(final JvmGenericType it) { |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.setDocumentation(it, GeneratorConstants.GENERATED_CLASSES_DOCUMENTATION); |
| StrategyDSLLayoutingStrategyCreator.this.toConstructor(it, layoutingStrategy); |
| StrategyDSLLayoutingStrategyCreator.this.toFields(it, layoutingStrategy); |
| StrategyDSLLayoutingStrategyCreator.this.toOperations(it, layoutingStrategy); |
| } |
| }; |
| acceptor.<JvmGenericType>accept(clsStrategy, _function); |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| String _name_1 = pckg.getName(); |
| _builder_1.append(_name_1, ""); |
| _builder_1.append("."); |
| String _strategyProviderClassName = this.getStrategyProviderClassName(layoutingStrategy, osdefault); |
| _builder_1.append(_strategyProviderClassName, ""); |
| JvmGenericType clsProvider = this._jvmTypesBuilder.toClass(layoutingStrategy, _builder_1.toString()); |
| EList<JvmTypeReference> _superTypes_1 = clsProvider.getSuperTypes(); |
| JvmTypeReference _typeRef_1 = this._typeReferenceBuilder.typeRef(ILayoutingStrategyProvider.class); |
| _superTypes_1.add(_typeRef_1); |
| final Procedure1<JvmGenericType> _function_1 = new Procedure1<JvmGenericType>() { |
| public void apply(final JvmGenericType it) { |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.setDocumentation(it, GeneratorConstants.GENERATED_CLASSES_DOCUMENTATION); |
| JvmAnnotationReference annotationRef = StrategyDSLLayoutingStrategyCreator.this._annotationTypesBuilder.annotationRef(Component.class); |
| StrategyDSLLayoutingStrategyCreator.this._commonUtils.addAnnAttr(annotationRef, layoutingStrategy, "immediate", Boolean.valueOf(true)); |
| JvmTypeReference _typeRef = StrategyDSLLayoutingStrategyCreator.this._typeReferenceBuilder.typeRef(ILayoutingStrategyProvider.class); |
| StrategyDSLLayoutingStrategyCreator.this._commonUtils.addAnnAttr(annotationRef, layoutingStrategy, "service", _typeRef); |
| String layoutingId = StrategyDSLLayoutingStrategyCreator.this.getStrategyClassName(layoutingStrategy); |
| if (osdefault) { |
| layoutingId = "Default"; |
| } |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("ecview.layouting.id="); |
| _builder.append(layoutingId, ""); |
| String propContent = _builder.toString(); |
| StrategyDSLLayoutingStrategyCreator.this._commonUtils.addAnnAttr(annotationRef, layoutingStrategy, "property", propContent); |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, annotationRef); |
| StrategyDSLLayoutingStrategyCreator.this.toProviderFields(it, layoutingStrategy, osdefault); |
| StrategyDSLLayoutingStrategyCreator.this.toProviderOperations(it, layoutingStrategy, osdefault); |
| } |
| }; |
| acceptor.<JvmGenericType>accept(clsProvider, _function_1); |
| } |
| |
| /** |
| * <p>build the constructors to be used by an e4 application.</p> |
| */ |
| public void toConstructor(final JvmDeclaredType type, final LayoutingStrategy layoutingStrategy) { |
| EList<JvmMember> _members = type.getMembers(); |
| final Procedure1<JvmConstructor> _function = new Procedure1<JvmConstructor>() { |
| public void apply(final JvmConstructor it) { |
| final Procedure1<ITreeAppendable> _function = new Procedure1<ITreeAppendable>() { |
| public void apply(final ITreeAppendable it) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("super(null);"); |
| it.append(_builder); |
| } |
| }; |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.setBody(it, _function); |
| } |
| }; |
| JvmConstructor _constructor = this._jvmTypesBuilder.toConstructor(layoutingStrategy, _function); |
| this._jvmTypesBuilder.<JvmConstructor>operator_add(_members, _constructor); |
| } |
| |
| /** |
| * <p>build the class variables.</p> |
| */ |
| public void toFields(final JvmGenericType type, final LayoutingStrategy layoutingStrategy) { |
| JvmField field = null; |
| boolean _isForm = this.isForm(layoutingStrategy); |
| if (_isForm) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("index"); |
| JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(int.class); |
| JvmField _field = this._jvmTypesBuilder.toField(layoutingStrategy, _builder.toString(), _typeRef); |
| field = _field; |
| field.setVisibility(JvmVisibility.PRIVATE); |
| EList<JvmMember> _members = type.getMembers(); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members, field); |
| JvmTypeReference _typeRef_1 = this._typeReferenceBuilder.typeRef(YFormLayout.class); |
| JvmTypeReference _typeRef_2 = this._typeReferenceBuilder.typeRef(List.class, _typeRef_1); |
| final Procedure1<JvmField> _function = new Procedure1<JvmField>() { |
| public void apply(final JvmField it) { |
| final Procedure1<ITreeAppendable> _function = new Procedure1<ITreeAppendable>() { |
| public void apply(final ITreeAppendable it) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("new ArrayList<>()"); |
| it.append(_builder); |
| } |
| }; |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.setInitializer(it, _function); |
| } |
| }; |
| JvmField _field_1 = this._jvmTypesBuilder.toField(layoutingStrategy, "formLayoutList", _typeRef_2, _function); |
| field = _field_1; |
| field.setVisibility(JvmVisibility.PRIVATE); |
| EList<JvmMember> _members_1 = type.getMembers(); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members_1, field); |
| } |
| } |
| |
| public CharSequence getContentFormLayoutBody(final LayoutingStrategy layoutingStrategy) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("YHorizontalLayout layout = ExtensionModelFactory.eINSTANCE.createYHorizontalLayout();"); |
| _builder.newLine(); |
| String _basicFormLayoutBody = this.getBasicFormLayoutBody(layoutingStrategy); |
| _builder.append(_basicFormLayoutBody, ""); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("for (YFormLayout formLayoutListItem : formLayoutList){"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("layout.addElement(formLayoutListItem);"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("return layout;"); |
| _builder.newLine(); |
| return _builder; |
| } |
| |
| public String getBasicFormLayoutBody(final LayoutingStrategy layoutingStrategy) { |
| String _xblockexpression = null; |
| { |
| int formLayoutIdx = 1; |
| LayoutingEnum _layout = layoutingStrategy.getLayout(); |
| String _literal = _layout.getLiteral(); |
| String _literal_1 = LayoutingEnum.FORM2.getLiteral(); |
| boolean _equals = _literal.equals(_literal_1); |
| if (_equals) { |
| formLayoutIdx = 2; |
| } else { |
| LayoutingEnum _layout_1 = layoutingStrategy.getLayout(); |
| String _literal_2 = _layout_1.getLiteral(); |
| String _literal_3 = LayoutingEnum.FORM3.getLiteral(); |
| boolean _equals_1 = _literal_2.equals(_literal_3); |
| if (_equals_1) { |
| formLayoutIdx = 3; |
| } |
| } |
| StringConcatenation _builder = new StringConcatenation(); |
| String body = _builder.toString(); |
| for (int i = 0; (i < formLayoutIdx); i++) { |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| _builder_1.append(body, ""); |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("formLayoutList.add(ExtensionModelFactory.eINSTANCE.createYFormLayout());"); |
| body = _builder_1.toString(); |
| } |
| _xblockexpression = body; |
| } |
| return _xblockexpression; |
| } |
| |
| public void toOperations(final JvmGenericType type, final LayoutingStrategy layoutingStrategy) { |
| EList<JvmMember> _members = type.getMembers(); |
| JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(YLayout.class); |
| final Procedure1<JvmOperation> _function = new Procedure1<JvmOperation>() { |
| public void apply(final JvmOperation it) { |
| it.setVisibility(JvmVisibility.PROTECTED); |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = StrategyDSLLayoutingStrategyCreator.this._annotationTypesBuilder.annotationRef(Override.class); |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| final Procedure1<ITreeAppendable> _function = new Procedure1<ITreeAppendable>() { |
| public void apply(final ITreeAppendable it) { |
| String _contentLayoutBody = StrategyDSLLayoutingStrategyCreator.this.getContentLayoutBody(layoutingStrategy); |
| it.append(_contentLayoutBody); |
| } |
| }; |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.setBody(it, _function); |
| } |
| }; |
| JvmOperation _method = this._jvmTypesBuilder.toMethod(layoutingStrategy, "createContentLayout", _typeRef, _function); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members, _method); |
| EList<JvmMember> _members_1 = type.getMembers(); |
| JvmTypeReference _typeRef_1 = this._typeReferenceBuilder.typeRef(Void.TYPE); |
| final Procedure1<JvmOperation> _function_1 = new Procedure1<JvmOperation>() { |
| public void apply(final JvmOperation it) { |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmTypeReference _typeRef = StrategyDSLLayoutingStrategyCreator.this._typeReferenceBuilder.typeRef(YLayout.class); |
| JvmFormalParameter _parameter = StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.toParameter(layoutingStrategy, "layout", _typeRef); |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmTypeReference _typeRef_1 = StrategyDSLLayoutingStrategyCreator.this._typeReferenceBuilder.typeRef(YEmbeddable.class); |
| JvmFormalParameter _parameter_1 = StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.toParameter(layoutingStrategy, "element", _typeRef_1); |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| it.setVisibility(JvmVisibility.PROTECTED); |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = StrategyDSLLayoutingStrategyCreator.this._annotationTypesBuilder.annotationRef(Override.class); |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| final Procedure1<ITreeAppendable> _function = new Procedure1<ITreeAppendable>() { |
| public void apply(final ITreeAppendable it) { |
| CharSequence _addElementBody = StrategyDSLLayoutingStrategyCreator.this.addElementBody(layoutingStrategy); |
| it.append(_addElementBody); |
| } |
| }; |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.setBody(it, _function); |
| } |
| }; |
| JvmOperation _method_1 = this._jvmTypesBuilder.toMethod(layoutingStrategy, "addElement", _typeRef_1, _function_1); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members_1, _method_1); |
| } |
| |
| public CharSequence addElementBody(final LayoutingStrategy layoutingStrategy) { |
| CharSequence _xifexpression = null; |
| boolean _isForm = this.isForm(layoutingStrategy); |
| if (_isForm) { |
| CharSequence _xblockexpression = null; |
| { |
| final int modIdx = this.getModIdx(layoutingStrategy); |
| CharSequence _xifexpression_1 = null; |
| if ((modIdx > 0)) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("int idx = index % "); |
| _builder.append(modIdx, ""); |
| _builder.append(";"); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("if (idx == 0) formLayoutList.get(0).addElement(element); else formLayoutList.get(idx).addElement(element);"); |
| _builder.newLine(); |
| _builder.append("index++;"); |
| _xifexpression_1 = _builder; |
| } |
| _xblockexpression = _xifexpression_1; |
| } |
| _xifexpression = _xblockexpression; |
| } else { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("layout.addElement(element);"); |
| _xifexpression = _builder; |
| } |
| return _xifexpression; |
| } |
| |
| public String getContentLayoutBody(final LayoutingStrategy layoutingStrategy) { |
| boolean _isForm = this.isForm(layoutingStrategy); |
| if (_isForm) { |
| StringConcatenation _builder = new StringConcatenation(); |
| CharSequence _contentFormLayoutBody = this.getContentFormLayoutBody(layoutingStrategy); |
| _builder.append(_contentFormLayoutBody, ""); |
| return _builder.toString(); |
| } else { |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| _builder_1.append("return ExtensionModelFactory.eINSTANCE.createY"); |
| LayoutingEnum _layout = layoutingStrategy.getLayout(); |
| String _literal = _layout.getLiteral(); |
| _builder_1.append(_literal, ""); |
| _builder_1.append("Layout();"); |
| return _builder_1.toString(); |
| } |
| } |
| |
| /** |
| * <p>build the class variables.</p> |
| */ |
| public void toProviderFields(final JvmGenericType type, final LayoutingStrategy layoutingStrategy, final boolean osdefault) { |
| JvmField field = null; |
| JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(String.class); |
| final Procedure1<JvmField> _function = new Procedure1<JvmField>() { |
| public void apply(final JvmField it) { |
| final Procedure1<ITreeAppendable> _function = new Procedure1<ITreeAppendable>() { |
| public void apply(final ITreeAppendable it) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("\""); |
| String _strategyClassName = StrategyDSLLayoutingStrategyCreator.this.getStrategyClassName(layoutingStrategy, osdefault); |
| _builder.append(_strategyClassName, ""); |
| _builder.append("\""); |
| it.append(_builder); |
| } |
| }; |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.setInitializer(it, _function); |
| it.setFinal(true); |
| it.setStatic(true); |
| } |
| }; |
| JvmField _field = this._jvmTypesBuilder.toField(layoutingStrategy, "ID", _typeRef, _function); |
| field = _field; |
| EList<JvmMember> _members = type.getMembers(); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members, field); |
| } |
| |
| public void toProviderOperations(final JvmGenericType type, final LayoutingStrategy layoutingStrategy, final boolean osdefault) { |
| EList<JvmMember> _members = type.getMembers(); |
| JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(ILayoutingStrategy.class); |
| final Procedure1<JvmOperation> _function = new Procedure1<JvmOperation>() { |
| public void apply(final JvmOperation it) { |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = StrategyDSLLayoutingStrategyCreator.this._annotationTypesBuilder.annotationRef(Override.class); |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| it.setVisibility(JvmVisibility.PUBLIC); |
| final Procedure1<ITreeAppendable> _function = new Procedure1<ITreeAppendable>() { |
| public void apply(final ITreeAppendable it) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("return new "); |
| String _strategyClassName = StrategyDSLLayoutingStrategyCreator.this.getStrategyClassName(layoutingStrategy, osdefault); |
| _builder.append(_strategyClassName, ""); |
| _builder.append("();"); |
| it.append(_builder); |
| } |
| }; |
| StrategyDSLLayoutingStrategyCreator.this._jvmTypesBuilder.setBody(it, _function); |
| } |
| }; |
| JvmOperation _method = this._jvmTypesBuilder.toMethod(layoutingStrategy, "getStrategy", _typeRef, _function); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members, _method); |
| } |
| |
| public String getStrategyClassName(final LayoutingStrategy layoutingStrategy) { |
| return this.getStrategyClassName(layoutingStrategy, false); |
| } |
| |
| public String getStrategyClassName(final LayoutingStrategy layoutingStrategy, final boolean osdefault) { |
| CharSequence layoutingStrategyClassName = this.getNotDefaultStrategyClassName(layoutingStrategy); |
| if (osdefault) { |
| CharSequence _defaultStrategyClassName = this.getDefaultStrategyClassName(layoutingStrategy); |
| layoutingStrategyClassName = _defaultStrategyClassName; |
| } |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append(layoutingStrategyClassName, ""); |
| return _builder.toString(); |
| } |
| |
| public String getStrategyProviderClassName(final LayoutingStrategy layoutingStrategy) { |
| return this.getStrategyProviderClassName(layoutingStrategy, false); |
| } |
| |
| public String getStrategyProviderClassName(final LayoutingStrategy layoutingStrategy, final boolean osdefault) { |
| CharSequence layoutingStrategyProviderClassName = this.getNotDefaultStrategyProviderClassName(layoutingStrategy); |
| if (osdefault) { |
| CharSequence _defaultStrategyProviderClassName = this.getDefaultStrategyProviderClassName(layoutingStrategy); |
| layoutingStrategyProviderClassName = _defaultStrategyProviderClassName; |
| } |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append(layoutingStrategyProviderClassName, ""); |
| return _builder.toString(); |
| } |
| |
| public int getModIdx(final LayoutingStrategy layoutingStrategy) { |
| LayoutingEnum _layout = layoutingStrategy.getLayout(); |
| String _literal = _layout.getLiteral(); |
| String _literal_1 = LayoutingEnum.FORM2.getLiteral(); |
| boolean _equals = _literal.equals(_literal_1); |
| if (_equals) { |
| return 2; |
| } else { |
| LayoutingEnum _layout_1 = layoutingStrategy.getLayout(); |
| String _literal_2 = _layout_1.getLiteral(); |
| String _literal_3 = LayoutingEnum.FORM3.getLiteral(); |
| boolean _equals_1 = _literal_2.equals(_literal_3); |
| if (_equals_1) { |
| return 3; |
| } |
| } |
| return 0; |
| } |
| |
| public boolean isForm(final LayoutingStrategy layoutingStrategy) { |
| boolean _or = false; |
| LayoutingEnum _layout = layoutingStrategy.getLayout(); |
| String _literal = _layout.getLiteral(); |
| String _literal_1 = LayoutingEnum.FORM2.getLiteral(); |
| boolean _equals = _literal.equals(_literal_1); |
| if (_equals) { |
| _or = true; |
| } else { |
| LayoutingEnum _layout_1 = layoutingStrategy.getLayout(); |
| String _literal_2 = _layout_1.getLiteral(); |
| String _literal_3 = LayoutingEnum.FORM3.getLiteral(); |
| boolean _equals_1 = _literal_2.equals(_literal_3); |
| _or = _equals_1; |
| } |
| return _or; |
| } |
| |
| public CharSequence getNotDefaultStrategyClassName(final LayoutingStrategy layoutingStrategy) { |
| StringConcatenation _builder = new StringConcatenation(); |
| String _name = layoutingStrategy.getName(); |
| _builder.append(_name, ""); |
| _builder.append(this._strategyConstants.LAYOUTING_STRATEGY_PREFIX, ""); |
| return _builder; |
| } |
| |
| public CharSequence getDefaultStrategyClassName(final LayoutingStrategy layoutingStrategy) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("Default"); |
| _builder.append(this._strategyConstants.LAYOUTING_STRATEGY_PREFIX, ""); |
| return _builder; |
| } |
| |
| public CharSequence getNotDefaultStrategyProviderClassName(final LayoutingStrategy layoutingStrategy) { |
| StringConcatenation _builder = new StringConcatenation(); |
| String _name = layoutingStrategy.getName(); |
| _builder.append(_name, ""); |
| _builder.append(this._strategyConstants.LAYOUTING_STRATEGY_PROVIDER_PREFIX, ""); |
| return _builder; |
| } |
| |
| public CharSequence getDefaultStrategyProviderClassName(final LayoutingStrategy layoutingStrategy) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("Default"); |
| _builder.append(this._strategyConstants.LAYOUTING_STRATEGY_PROVIDER_PREFIX, ""); |
| return _builder; |
| } |
| } |