| /** |
| * 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 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| * |
| * This copyright notice shows up in the generated Java code |
| */ |
| package org.eclipse.osbp.xtext.action.jvmmodel; |
| |
| import com.google.common.base.Objects; |
| import java.util.ArrayList; |
| import java.util.Arrays; |
| import java.util.List; |
| import java.util.Map; |
| import javax.inject.Inject; |
| import org.eclipse.e4.core.contexts.Active; |
| import org.eclipse.e4.core.contexts.IEclipseContext; |
| import org.eclipse.e4.core.di.annotations.CanExecute; |
| import org.eclipse.e4.core.di.annotations.Execute; |
| import org.eclipse.e4.core.di.annotations.Optional; |
| import org.eclipse.e4.ui.model.application.MApplication; |
| import org.eclipse.e4.ui.model.application.ui.MUIElement; |
| import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective; |
| import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
| import org.eclipse.e4.ui.model.application.ui.menu.MHandledToolItem; |
| import org.eclipse.e4.ui.model.application.ui.menu.MToolBar; |
| import org.eclipse.e4.ui.workbench.IPresentationEngine; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.common.util.Enumerator; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.osbp.core.api.persistence.IPersistenceService; |
| import org.eclipse.osbp.datainterchange.api.IDataInterchange; |
| import org.eclipse.osbp.dsl.semantic.entity.LEntityAttribute; |
| import org.eclipse.osbp.dsl.semantic.entity.LEntityFeature; |
| import org.eclipse.osbp.dsl.semantic.entity.LEntityReference; |
| import org.eclipse.osbp.ecview.core.common.context.IViewContext; |
| import org.eclipse.osbp.runtime.common.event.IEventDispatcher; |
| import org.eclipse.osbp.ui.api.contextfunction.ICommandsProvider; |
| import org.eclipse.osbp.ui.api.customfields.IBlobService; |
| import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService; |
| import org.eclipse.osbp.ui.api.themes.IThemeResourceService; |
| import org.eclipse.osbp.ui.api.user.IUser; |
| import org.eclipse.osbp.ui.api.useraccess.IUserAccessService; |
| import org.eclipse.osbp.utils.annotation.CommonUtils; |
| import org.eclipse.osbp.vaaclipse.api.VaadinExecutorService; |
| import org.eclipse.osbp.xtext.action.ActionButton; |
| import org.eclipse.osbp.xtext.action.ActionChart; |
| import org.eclipse.osbp.xtext.action.ActionCommand; |
| import org.eclipse.osbp.xtext.action.ActionDatainterchange; |
| import org.eclipse.osbp.xtext.action.ActionDialog; |
| import org.eclipse.osbp.xtext.action.ActionFunction; |
| import org.eclipse.osbp.xtext.action.ActionInclude; |
| import org.eclipse.osbp.xtext.action.ActionOrganization; |
| import org.eclipse.osbp.xtext.action.ActionPackage; |
| import org.eclipse.osbp.xtext.action.ActionReport; |
| import org.eclipse.osbp.xtext.action.ActionSelectWorkload; |
| import org.eclipse.osbp.xtext.action.ActionSpacer; |
| import org.eclipse.osbp.xtext.action.ActionState; |
| import org.eclipse.osbp.xtext.action.ActionTable; |
| import org.eclipse.osbp.xtext.action.ActionTask; |
| import org.eclipse.osbp.xtext.action.ActionToolbar; |
| import org.eclipse.osbp.xtext.action.ActionToolbarItem; |
| import org.eclipse.osbp.xtext.action.ActionType; |
| import org.eclipse.osbp.xtext.action.ActionUI; |
| import org.eclipse.osbp.xtext.action.ActionWorkflow; |
| import org.eclipse.osbp.xtext.action.DialogActionEnum; |
| import org.eclipse.osbp.xtext.action.UIActionEnum; |
| import org.eclipse.osbp.xtext.action.common.IToolbarAction; |
| import org.eclipse.osbp.xtext.datainterchange.AttributeFilter; |
| import org.eclipse.osbp.xtext.datainterchange.DataInterchange; |
| import org.eclipse.osbp.xtext.datainterchange.DataInterchangeFilter; |
| import org.eclipse.osbp.xtext.datainterchange.ReferenceFilter; |
| import org.eclipse.osbp.xtext.datainterchange.ReferenceFilterWithAttr; |
| import org.eclipse.osbp.xtext.datainterchange.ReferenceFilterWithOutAttr; |
| import org.eclipse.osbp.xtext.datainterchange.jvmmodel.DataDSLJvmModelInferrer; |
| import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryPackage; |
| import org.eclipse.osbp.xtext.messagedsl.MessagePackage; |
| 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.naming.IQualifiedNameProvider; |
| import org.eclipse.xtext.naming.QualifiedName; |
| import org.eclipse.xtext.xbase.compiler.output.ITreeAppendable; |
| import org.eclipse.xtext.xbase.jvmmodel.AbstractModelInferrer; |
| import org.eclipse.xtext.xbase.jvmmodel.IJvmDeclaredTypeAcceptor; |
| import org.eclipse.xtext.xbase.jvmmodel.JvmTypesBuilder; |
| import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
| import org.eclipse.xtext.xbase.lib.Extension; |
| import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; |
| import org.eclipse.xtext.xbase.lib.StringExtensions; |
| import org.osgi.service.component.annotations.Component; |
| import org.slf4j.Logger; |
| |
| /** |
| * <p>Infers a JVM model from the source model.</p> |
| * |
| * <p>The JVM model should contain all elements that would appear in the Java code |
| * which is generated from the source model. Other models link against the JVM model rather than the source model.</p> |
| */ |
| @SuppressWarnings("all") |
| public class ActionDSLJvmModelInferrer extends AbstractModelInferrer { |
| @Inject |
| @Extension |
| private JvmTypesBuilder _jvmTypesBuilder; |
| |
| @Inject |
| @Extension |
| private IQualifiedNameProvider _iQualifiedNameProvider; |
| |
| @Inject |
| @Extension |
| private DataDSLJvmModelInferrer data; |
| |
| @Inject |
| @Extension |
| private CommonUtils _commonUtils; |
| |
| private String contextClassName = ""; |
| |
| private String clsName = ""; |
| |
| protected void _infer(final ActionPackage pkg, final IJvmDeclaredTypeAcceptor acceptor, final boolean isPreIndexingPhase) { |
| EList<ActionToolbar> _toolbars = pkg.getToolbars(); |
| for (final ActionToolbar toolbar : _toolbars) { |
| { |
| JvmGenericType toolbarClass = this._jvmTypesBuilder.toClass(toolbar, this.className(toolbar)); |
| final Procedure1<JvmGenericType> _function = (JvmGenericType it) -> { |
| EList<JvmTypeReference> _superTypes = it.getSuperTypes(); |
| JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(IToolbarAction.class); |
| this._jvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes, _typeRef); |
| this.toToolbarConstructor(it, toolbar); |
| this.toToolbarFields(it, toolbar); |
| this.toToolbarOperations(it, toolbar); |
| this._jvmTypesBuilder.setFileHeader(it, this._jvmTypesBuilder.getDocumentation(pkg)); |
| }; |
| acceptor.<JvmGenericType>accept(toolbarClass, _function); |
| } |
| } |
| EList<ActionCommand> _commands = pkg.getCommands(); |
| for (final ActionCommand command : _commands) { |
| { |
| JvmGenericType handlerClass = this._jvmTypesBuilder.toClass(command, this.className(command)); |
| final Procedure1<JvmGenericType> _function = (JvmGenericType it) -> { |
| this.toHandlerFields(it, command); |
| this.toHandlerOperations(it, command); |
| this._jvmTypesBuilder.setFileHeader(it, this._jvmTypesBuilder.getDocumentation(pkg)); |
| }; |
| acceptor.<JvmGenericType>accept(handlerClass, _function); |
| } |
| } |
| boolean _isWithouCommandProvider = pkg.isWithouCommandProvider(); |
| boolean _not = (!_isWithouCommandProvider); |
| if (_not) { |
| this.clsName = pkg.getName().toString().concat(".").concat("CommandsProvider"); |
| final JvmGenericType cls = this._jvmTypesBuilder.toClass(pkg, this.clsName); |
| cls.getSuperTypes().add(this._typeReferenceBuilder.typeRef(ICommandsProvider.class)); |
| final Procedure1<JvmGenericType> _function = (JvmGenericType it) -> { |
| JvmAnnotationReference annotationRef = this._annotationTypesBuilder.annotationRef(Component.class); |
| JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(ICommandsProvider.class); |
| this._commonUtils.addAnnAttr(annotationRef, pkg, "service", |
| ((JvmTypeReference) _typeRef)); |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, annotationRef); |
| this.toCommandsConstructor(it, pkg); |
| this.toCommandsOperations(it, pkg); |
| }; |
| acceptor.<JvmGenericType>accept(cls, _function); |
| } |
| } |
| |
| public void toCommandsOperations(final JvmGenericType type, final ActionPackage pkg) { |
| EList<JvmMember> _members = type.getMembers(); |
| final Procedure1<JvmOperation> _function = (JvmOperation it) -> { |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Override.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(pkg, "application", this._typeReferenceBuilder.typeRef(MApplication.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| final Procedure1<ITreeAppendable> _function_1 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| String _init = this.init(pkg); |
| _builder.append(_init); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_1); |
| }; |
| JvmOperation _method = this._jvmTypesBuilder.toMethod(pkg, "init", this._typeReferenceBuilder.typeRef(Void.TYPE), _function); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members, _method); |
| } |
| |
| public String init(final ActionPackage pkg) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("if(!application.getBindingTables().isEmpty()) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("MBindingTable bindingTable = application.getBindingTables().get(0);"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("MKeyBinding keyBinding;"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("MCommand command;"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("MHandler commandHandler;"); |
| _builder.newLine(); |
| String body = _builder.toString(); |
| EList<ActionCommand> _commands = pkg.getCommands(); |
| for (final ActionCommand command : _commands) { |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| _builder_1.append(body); |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("\t"); |
| _builder_1.append("command = CommandsFactoryImpl.eINSTANCE.createCommand();"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("command.setElementId(\""); |
| QualifiedName _fullyQualifiedName = this._iQualifiedNameProvider.getFullyQualifiedName(pkg); |
| _builder_1.append(_fullyQualifiedName, "\t"); |
| _builder_1.append("."); |
| String _name = command.getName(); |
| _builder_1.append(_name, "\t"); |
| _builder_1.append("\");"); |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("\t"); |
| _builder_1.append("command.setCommandName(\""); |
| String _name_1 = command.getName(); |
| _builder_1.append(_name_1, "\t"); |
| _builder_1.append("\");"); |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("\t"); |
| { |
| boolean _isHasDescription = command.isHasDescription(); |
| if (_isHasDescription) { |
| _builder_1.append("command.setDescription(\""); |
| String _description = command.getDescription(); |
| _builder_1.append(_description, "\t"); |
| _builder_1.append("\");"); |
| } |
| } |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("\t"); |
| _builder_1.append("application.getCommands().add(command);"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("commandHandler = CommandsFactoryImpl.eINSTANCE.createHandler();"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("commandHandler.setElementId(\""); |
| QualifiedName _fullyQualifiedName_1 = this._iQualifiedNameProvider.getFullyQualifiedName(pkg); |
| _builder_1.append(_fullyQualifiedName_1, "\t"); |
| _builder_1.append("."); |
| String _name_2 = command.getName(); |
| _builder_1.append(_name_2, "\t"); |
| _builder_1.append("Handler\");"); |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("\t"); |
| _builder_1.append("commandHandler.setCommand(command);"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("commandHandler.setContributionURI(\"bundleclass://\"+FrameworkUtil.getBundle("); |
| String _className = this.className(command); |
| _builder_1.append(_className, "\t"); |
| _builder_1.append(".class).getSymbolicName()+\"/"); |
| String _className_1 = this.className(command); |
| _builder_1.append(_className_1, "\t"); |
| _builder_1.append("\");"); |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("\t"); |
| _builder_1.append("application.getHandlers().add(commandHandler);"); |
| _builder_1.newLine(); |
| { |
| boolean _isHasKeyBinding = command.isHasKeyBinding(); |
| if (_isHasKeyBinding) { |
| _builder_1.append("\t"); |
| _builder_1.append("keyBinding = CommandsFactoryImpl.eINSTANCE.createKeyBinding();"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("keyBinding.setElementId(\""); |
| QualifiedName _fullyQualifiedName_2 = this._iQualifiedNameProvider.getFullyQualifiedName(pkg); |
| _builder_1.append(_fullyQualifiedName_2, "\t"); |
| _builder_1.append("."); |
| String _name_3 = command.getName(); |
| _builder_1.append(_name_3, "\t"); |
| _builder_1.append("Keybinding\");"); |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("\t"); |
| _builder_1.append("keyBinding.setKeySequence(\""); |
| String _replace = command.getKeyBinding().replace(" ", "+"); |
| _builder_1.append(_replace, "\t"); |
| _builder_1.append("\");"); |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("\t"); |
| _builder_1.append("keyBinding.setCommand(command);"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t\t\t\t"); |
| _builder_1.append("bindingTable.getBindings().add(keyBinding);"); |
| } |
| } |
| _builder_1.newLineIfNotEmpty(); |
| body = _builder_1.toString(); |
| } |
| StringConcatenation _builder_2 = new StringConcatenation(); |
| _builder_2.append(body); |
| _builder_2.newLineIfNotEmpty(); |
| _builder_2.append("}"); |
| _builder_2.newLine(); |
| body = _builder_2.toString(); |
| return body; |
| } |
| |
| public void toCommandsConstructor(final JvmGenericType type, final ActionPackage pkg) { |
| EList<JvmMember> _members = type.getMembers(); |
| final Procedure1<JvmConstructor> _function = (JvmConstructor it) -> { |
| final Procedure1<ITreeAppendable> _function_1 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_1); |
| }; |
| JvmConstructor _constructor = this._jvmTypesBuilder.toConstructor(pkg, _function); |
| this._jvmTypesBuilder.<JvmConstructor>operator_add(_members, _constructor); |
| } |
| |
| /** |
| * <p>build the constructors.</p> |
| */ |
| public void toToolbarConstructor(final JvmGenericType type, final ActionToolbar toolbar) { |
| EList<JvmMember> _members = type.getMembers(); |
| final Procedure1<JvmConstructor> _function = (JvmConstructor it) -> { |
| final Procedure1<ITreeAppendable> _function_1 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("super();"); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_1); |
| }; |
| JvmConstructor _constructor = this._jvmTypesBuilder.toConstructor(toolbar, _function); |
| this._jvmTypesBuilder.<JvmConstructor>operator_add(_members, _constructor); |
| } |
| |
| public String className(final ActionToolbar toolbar) { |
| EObject _eContainer = toolbar.eContainer(); |
| ActionPackage pkg = ((ActionPackage) _eContainer); |
| return pkg.getName().toString().concat(".").concat(StringExtensions.toFirstUpper(toolbar.getName())).concat("Toolbar"); |
| } |
| |
| public String className(final ActionCommand actionCommand) { |
| EObject _eContainer = actionCommand.eContainer(); |
| ActionPackage pkg = ((ActionPackage) _eContainer); |
| return pkg.getName().toString().concat(".").concat(StringExtensions.toFirstUpper(actionCommand.getName())).concat("Action"); |
| } |
| |
| public void toToolbarOperations(final JvmGenericType type, final ActionToolbar toolbar) { |
| EList<JvmMember> _members = type.getMembers(); |
| final Procedure1<JvmOperation> _function = (JvmOperation it) -> { |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(toolbar, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(toolbar, "renderingEngine", this._typeReferenceBuilder.typeRef(IPresentationEngine.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| EList<JvmFormalParameter> _parameters_2 = it.getParameters(); |
| JvmFormalParameter _parameter_2 = this._jvmTypesBuilder.toParameter(toolbar, "themeResourceService", this._typeReferenceBuilder.typeRef(IThemeResourceService.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_2, _parameter_2); |
| EList<JvmFormalParameter> _parameters_3 = it.getParameters(); |
| JvmFormalParameter _parameter_3 = this._jvmTypesBuilder.toParameter(toolbar, "uuid", this._typeReferenceBuilder.typeRef(String.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_3, _parameter_3); |
| it.setVisibility(JvmVisibility.PUBLIC); |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Override.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| final Procedure1<ITreeAppendable> _function_1 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| String _createToolbar = this.createToolbar(toolbar); |
| _builder.append(_createToolbar); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_1); |
| }; |
| JvmOperation _method = this._jvmTypesBuilder.toMethod(toolbar, "createToolbar", this._typeReferenceBuilder.typeRef(Void.TYPE), _function); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members, _method); |
| EList<JvmMember> _members_1 = type.getMembers(); |
| final Procedure1<JvmOperation> _function_1 = (JvmOperation it) -> { |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Override.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| final Procedure1<ITreeAppendable> _function_2 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("return toolbar;"); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_2); |
| }; |
| JvmOperation _method_1 = this._jvmTypesBuilder.toMethod(toolbar, "getToolBar", this._typeReferenceBuilder.typeRef(MToolBar.class), _function_1); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members_1, _method_1); |
| EList<JvmMember> _members_2 = type.getMembers(); |
| final Procedure1<JvmOperation> _function_2 = (JvmOperation it) -> { |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Override.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| final Procedure1<ITreeAppendable> _function_3 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("return stateLabelUUID;"); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_3); |
| }; |
| JvmOperation _method_2 = this._jvmTypesBuilder.toMethod(toolbar, "getStateLabelUUID", this._typeReferenceBuilder.typeRef(String.class), _function_2); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members_2, _method_2); |
| EList<JvmMember> _members_3 = type.getMembers(); |
| final Procedure1<JvmOperation> _function_3 = (JvmOperation it) -> { |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(toolbar, "commandName", this._typeReferenceBuilder.typeRef(String.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(toolbar, "toolItem", this._typeReferenceBuilder.typeRef(MHandledToolItem.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| EList<JvmFormalParameter> _parameters_2 = it.getParameters(); |
| JvmFormalParameter _parameter_2 = this._jvmTypesBuilder.toParameter(toolbar, "application", this._typeReferenceBuilder.typeRef(MApplication.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_2, _parameter_2); |
| it.setVisibility(JvmVisibility.PRIVATE); |
| final Procedure1<ITreeAppendable> _function_4 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("for(MCommand command:application.getCommands()) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("if(command.getCommandName().equals(commandName)) {"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("toolItem.setCommand(command);"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("break;"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_4); |
| }; |
| JvmOperation _method_3 = this._jvmTypesBuilder.toMethod(toolbar, "setCommand", this._typeReferenceBuilder.typeRef(Void.TYPE), _function_3); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members_3, _method_3); |
| } |
| |
| public String createToolbar(final ActionToolbar toolbar) { |
| String body = ""; |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append(body); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("this.uuid = uuid;"); |
| _builder.newLine(); |
| _builder.append("MenuFactoryImpl factory = MenuFactoryImpl.eINSTANCE;"); |
| _builder.newLine(); |
| _builder.append("MHandledToolItem toolItem = null;"); |
| _builder.newLine(); |
| _builder.append("MToolBarSeparator separator = null;"); |
| _builder.newLine(); |
| _builder.newLine(); |
| _builder.append("MApplication application = (MApplication)eclipseContext.get(MApplication.class);"); |
| _builder.newLine(); |
| _builder.append("MPart part = (MPart)eclipseContext.get(MPart.class);"); |
| _builder.newLine(); |
| _builder.append("if(part != null) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("toolbar = part.getToolbar();"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("if (toolbar == null) {"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("toolbar = factory.createToolBar();"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("toolbar.setElementId(uuid);"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("part.getContext().set(\""); |
| _builder.append(IToolbarAction.TOOLBAR_UUID, "\t\t"); |
| _builder.append("\", toolbar.getElementId());"); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("\t\t"); |
| _builder.append("toolbar.setToBeRendered(true);"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("part.setToolbar(toolbar);"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("Panel panel = (Panel) part.getWidget();"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("if (panel != null) {\t\t// it is already visible in terms of vaadin"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("//create toolbar area"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("VerticalLayout rootContainer = (VerticalLayout)panel.getContent();"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("CssLayout toolbarArea = new CssLayout();"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("toolbarArea.setStyleName(EnumCssClass.MPARTTOOLBARAREA.toString());"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("toolbarArea.setSizeUndefined();"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("toolbarArea.setWidth(\"100%\");"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("rootContainer.addComponentAsFirst(toolbarArea);"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("//create toolbar"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("Component toolbarWidget = (Component) renderingEngine.createGui(toolbar);"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("((AbstractLayout)toolbarWidget).setSizeUndefined();"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("toolbarWidget.setStyleName(EnumCssClass.MPARTTOOLBAR.toString());"); |
| _builder.newLine(); |
| _builder.append("\t\t\t"); |
| _builder.append("toolbarArea.addComponent(toolbarWidget);"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("else {"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("toolbar.getChildren().removeIf(c -> c.isToBeRendered());"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("}"); |
| _builder.newLine(); |
| body = _builder.toString(); |
| EList<ActionToolbarItem> _actions = toolbar.getActions(); |
| for (final ActionToolbarItem action : _actions) { |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| _builder_1.append(body); |
| String _createToolItem = this.createToolItem(toolbar, action); |
| _builder_1.append(_createToolItem); |
| body = _builder_1.toString(); |
| } |
| StringConcatenation _builder_2 = new StringConcatenation(); |
| _builder_2.append(body); |
| _builder_2.newLineIfNotEmpty(); |
| _builder_2.append("}"); |
| body = _builder_2.toString(); |
| return body; |
| } |
| |
| public String createToolItem(final ActionToolbar toolbar, final ActionToolbarItem action) { |
| if ((action instanceof ActionButton)) { |
| return this.createToolButton(((ActionButton)action)); |
| } else { |
| if ((action instanceof ActionSpacer)) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("separator = factory.createToolBarSeparator();"); |
| _builder.newLine(); |
| _builder.append("toolbar.getChildren().add(separator);"); |
| _builder.newLine(); |
| return _builder.toString(); |
| } else { |
| if ((action instanceof ActionState)) { |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| _builder_1.append("MToolControl state = factory.createToolControl();"); |
| _builder_1.newLine(); |
| _builder_1.append("state.setContributionURI(E4Helper.getDialogStateHandlerURI());"); |
| _builder_1.newLine(); |
| _builder_1.append("stateLabelUUID = UUID.randomUUID().toString();"); |
| _builder_1.newLine(); |
| _builder_1.append("state.setElementId(stateLabelUUID);"); |
| _builder_1.newLine(); |
| _builder_1.append("state.setToBeRendered(true);"); |
| _builder_1.newLine(); |
| _builder_1.append("state.setVisible(true);"); |
| _builder_1.newLine(); |
| _builder_1.append("toolbar.getChildren().add(state);"); |
| _builder_1.newLine(); |
| return _builder_1.toString(); |
| } else { |
| if ((action instanceof ActionInclude)) { |
| String body = ""; |
| ActionToolbar includeToolbar = ((ActionInclude) action).getInclude(); |
| boolean _notEquals = (!Objects.equal(includeToolbar, toolbar)); |
| if (_notEquals) { |
| EList<ActionToolbarItem> _actions = includeToolbar.getActions(); |
| for (final ActionToolbarItem btn : _actions) { |
| if ((!(btn instanceof ActionState))) { |
| StringConcatenation _builder_2 = new StringConcatenation(); |
| _builder_2.append(body); |
| String _createToolItem = this.createToolItem(toolbar, btn); |
| _builder_2.append(_createToolItem); |
| body = _builder_2.toString(); |
| } |
| } |
| } |
| return body; |
| } |
| } |
| } |
| } |
| return null; |
| } |
| |
| public String createToolButton(final ActionButton action) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("toolItem = factory.createHandledToolItem();"); |
| _builder.newLine(); |
| _builder.append("toolItem.setElementId(UUID.randomUUID().toString());"); |
| _builder.newLine(); |
| _builder.append("toolItem.setType(ItemType.PUSH);"); |
| _builder.newLine(); |
| _builder.append("toolItem.setTooltip(\""); |
| { |
| if (((action.getCommand().getActionType() instanceof ActionDatainterchange) && ((ActionDatainterchange) action.getCommand().getActionType()).getDataRef().isDescription())) { |
| ActionType _actionType = action.getCommand().getActionType(); |
| String _descriptionValue = ((ActionDatainterchange) _actionType).getDataRef().getDescriptionValue(); |
| _builder.append(_descriptionValue); |
| } else { |
| String _name = action.getName(); |
| _builder.append(_name); |
| } |
| } |
| { |
| boolean _isHasKeyBinding = action.getCommand().isHasKeyBinding(); |
| if (_isHasKeyBinding) { |
| _builder.append(".keybinding."); |
| String _keyBinding = action.getCommand().getKeyBinding(); |
| _builder.append(_keyBinding); |
| } |
| } |
| _builder.append("\");"); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("toolItem.setIconURI(themeResourceService.getThemeURI(\""); |
| String _iconURI = action.getCommand().getIconURI(); |
| _builder.append(_iconURI); |
| _builder.append("\", ThemeResourceType.ICON));"); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("toolItem.setEnabled(true);"); |
| _builder.newLine(); |
| _builder.append("toolItem.setToBeRendered(true);"); |
| _builder.newLine(); |
| _builder.append("toolItem.setVisible(true);"); |
| _builder.newLine(); |
| _builder.append("setCommand(\""); |
| String _name_1 = action.getCommand().getName(); |
| _builder.append(_name_1); |
| _builder.append("\", toolItem, application);"); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("toolbar.getChildren().add(toolItem);"); |
| _builder.newLine(); |
| { |
| ActionType _actionType_1 = action.getCommand().getActionType(); |
| if ((_actionType_1 instanceof ActionReport)) { |
| _builder.append("toolItem.getTags().add(\""); |
| ActionType _actionType_2 = action.getCommand().getActionType(); |
| String _literal = ((ActionReport) _actionType_2).getAction().getLiteral(); |
| _builder.append(_literal); |
| _builder.append("\");"); |
| _builder.newLineIfNotEmpty(); |
| } |
| } |
| { |
| ActionType _actionType_3 = action.getCommand().getActionType(); |
| if ((_actionType_3 instanceof ActionTable)) { |
| _builder.append("toolItem.getTags().add(\""); |
| ActionType _actionType_4 = action.getCommand().getActionType(); |
| String _literal_1 = ((ActionTable) _actionType_4).getAction().getLiteral(); |
| _builder.append(_literal_1); |
| _builder.append("\");"); |
| _builder.newLineIfNotEmpty(); |
| } |
| } |
| { |
| ActionType _actionType_5 = action.getCommand().getActionType(); |
| if ((_actionType_5 instanceof ActionChart)) { |
| _builder.append("toolItem.getTags().add(\""); |
| ActionType _actionType_6 = action.getCommand().getActionType(); |
| String _literal_2 = ((ActionChart) _actionType_6).getAction().getLiteral(); |
| _builder.append(_literal_2); |
| _builder.append("\");"); |
| _builder.newLineIfNotEmpty(); |
| } |
| } |
| { |
| ActionType _actionType_7 = action.getCommand().getActionType(); |
| if ((_actionType_7 instanceof ActionOrganization)) { |
| _builder.append("toolItem.getTags().add(\""); |
| ActionType _actionType_8 = action.getCommand().getActionType(); |
| String _literal_3 = ((ActionOrganization) _actionType_8).getAction().getLiteral(); |
| _builder.append(_literal_3); |
| _builder.append("\");"); |
| _builder.newLineIfNotEmpty(); |
| } |
| } |
| return _builder.toString(); |
| } |
| |
| public void toToolbarFields(final JvmGenericType type, final ActionToolbar toolbar) { |
| JvmField field = null; |
| final Procedure1<JvmField> _function = (JvmField it) -> { |
| final Procedure1<ITreeAppendable> _function_1 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("org.slf4j.LoggerFactory.getLogger(\"toolbar\")"); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setInitializer(it, _function_1); |
| }; |
| field = this._jvmTypesBuilder.toField(toolbar, "log", this._typeReferenceBuilder.typeRef(Logger.class), _function); |
| field.setStatic(true); |
| field.setVisibility(JvmVisibility.PRIVATE); |
| EList<JvmMember> _members = type.getMembers(); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members, field); |
| field = this._jvmTypesBuilder.toField(toolbar, "uuid", this._typeReferenceBuilder.typeRef(String.class)); |
| field.setVisibility(JvmVisibility.PRIVATE); |
| EList<JvmMember> _members_1 = type.getMembers(); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members_1, field); |
| field = this._jvmTypesBuilder.toField(toolbar, "toolbar", this._typeReferenceBuilder.typeRef(MToolBar.class)); |
| EList<JvmMember> _members_2 = type.getMembers(); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members_2, field); |
| field = this._jvmTypesBuilder.toField(toolbar, "stateLabelUUID", this._typeReferenceBuilder.typeRef(String.class)); |
| field.setVisibility(JvmVisibility.PRIVATE); |
| EList<JvmMember> _members_3 = type.getMembers(); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members_3, field); |
| } |
| |
| public void toHandlerFields(final JvmGenericType type, final ActionCommand action) { |
| JvmField field = null; |
| final Procedure1<JvmField> _function = (JvmField it) -> { |
| final Procedure1<ITreeAppendable> _function_1 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("org.slf4j.LoggerFactory.getLogger(\"action\")"); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setInitializer(it, _function_1); |
| }; |
| field = this._jvmTypesBuilder.toField(action, "log", this._typeReferenceBuilder.typeRef(Logger.class), _function); |
| field.setStatic(true); |
| field.setVisibility(JvmVisibility.PRIVATE); |
| EList<JvmMember> _members = type.getMembers(); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members, field); |
| JvmField field2 = null; |
| final Procedure1<JvmField> _function_1 = (JvmField it) -> { |
| final Procedure1<ITreeAppendable> _function_2 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("new HashMap()"); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setInitializer(it, _function_2); |
| }; |
| field2 = this._jvmTypesBuilder.toField(action, "isGranted", this._typeReferenceBuilder.typeRef(Map.class, this._typeReferenceBuilder.typeRef(String.class), this._typeReferenceBuilder.typeRef(Boolean.class)), _function_1); |
| field2.setStatic(true); |
| field2.setVisibility(JvmVisibility.PRIVATE); |
| EList<JvmMember> _members_1 = type.getMembers(); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members_1, field2); |
| EList<JvmMember> _members_2 = type.getMembers(); |
| JvmField _field = this._jvmTypesBuilder.toField(action, "activePart", this._typeReferenceBuilder.typeRef(MUIElement.class)); |
| this._jvmTypesBuilder.<JvmField>operator_add(_members_2, _field); |
| EList<JvmMember> _members_3 = type.getMembers(); |
| final Procedure1<JvmOperation> _function_2 = (JvmOperation it) -> { |
| final Procedure1<ITreeAppendable> _function_3 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("return activePart;"); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_3); |
| }; |
| JvmOperation _method = this._jvmTypesBuilder.toMethod(action, "getActivePart", this._typeReferenceBuilder.typeRef(MUIElement.class), _function_2); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members_3, _method); |
| } |
| |
| public CharSequence activatePart() { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("if (part == null || part.equals(activePart)) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("return;"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("if(activePart != null && activePart.getWidget() instanceof Panel) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("((Panel)activePart.getWidget()).removeStyleName(EnumCssClass.HAS_FOCUS.styleName());"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("if(part != null && part.getWidget() instanceof Panel) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("((Panel)part.getWidget()).addStyleName(EnumCssClass.HAS_FOCUS.styleName());"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("activePart = part;"); |
| _builder.newLine(); |
| _builder.append("IE4Dialog dialog = part.getContext().get(IE4Dialog.class);"); |
| _builder.newLine(); |
| _builder.append("if (dialog != null) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("ContextInjectionFactory.invoke(dialog, Focus.class, part.getContext());"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("IE4Table table = part.getContext().get(IE4Table.class);"); |
| _builder.newLine(); |
| _builder.append("if (table != null) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("ContextInjectionFactory.invoke(table, Focus.class, part.getContext());"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("IE4Focusable focusable = part.getContext().get(IE4Focusable.class);"); |
| _builder.newLine(); |
| _builder.append("if (focusable != null) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("ContextInjectionFactory.invoke(focusable, Focus.class, part.getContext());"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| return _builder; |
| } |
| |
| /** |
| * <p>build the methods to be used as toolbar handlers by an e4 application.</p> |
| */ |
| public void toHandlerOperations(final JvmDeclaredType type, final ActionCommand action) { |
| if (((action.getActionType() instanceof ActionUI) && (Objects.equal(((ActionUI) action.getActionType()).getAction(), UIActionEnum.NEXT_PART) || |
| Objects.equal(((ActionUI) action.getActionType()).getAction(), UIActionEnum.PREVIOUS_PART)))) { |
| EList<JvmMember> _members = type.getMembers(); |
| final Procedure1<JvmOperation> _function = (JvmOperation it) -> { |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| JvmFormalParameter para = this._jvmTypesBuilder.toParameter(action, "part", this._typeReferenceBuilder.typeRef(MPart.class)); |
| EList<JvmAnnotationReference> _annotations_1 = para.getAnnotations(); |
| JvmAnnotationReference _annotationRef_1 = this._annotationTypesBuilder.annotationRef(Active.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_1, _annotationRef_1); |
| EList<JvmAnnotationReference> _annotations_2 = para.getAnnotations(); |
| JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Optional.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2); |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, para); |
| final Procedure1<ITreeAppendable> _function_1 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| CharSequence _activatePart = this.activatePart(); |
| _builder.append(_activatePart); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_1); |
| }; |
| JvmOperation _method = this._jvmTypesBuilder.toMethod(action, "activePart", this._typeReferenceBuilder.typeRef(Void.TYPE), _function); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members, _method); |
| } |
| if (((action.getActionType() instanceof ActionUI) && (Objects.equal(((ActionUI) action.getActionType()).getAction(), UIActionEnum.NEXT_PERSPECTIVE) || |
| Objects.equal(((ActionUI) action.getActionType()).getAction(), UIActionEnum.PREVIOUS_PERSPECTIVE)))) { |
| EList<JvmMember> _members_1 = type.getMembers(); |
| final Procedure1<JvmOperation> _function_1 = (JvmOperation it) -> { |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| JvmFormalParameter para = this._jvmTypesBuilder.toParameter(action, "part", this._typeReferenceBuilder.typeRef(MPerspective.class)); |
| EList<JvmAnnotationReference> _annotations_1 = para.getAnnotations(); |
| JvmAnnotationReference _annotationRef_1 = this._annotationTypesBuilder.annotationRef(Active.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_1, _annotationRef_1); |
| EList<JvmAnnotationReference> _annotations_2 = para.getAnnotations(); |
| JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Optional.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2); |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, para); |
| final Procedure1<ITreeAppendable> _function_2 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| CharSequence _activatePart = this.activatePart(); |
| _builder.append(_activatePart); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_2); |
| }; |
| JvmOperation _method_1 = this._jvmTypesBuilder.toMethod(action, "activePerspective", this._typeReferenceBuilder.typeRef(Void.TYPE), _function_1); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members_1, _method_1); |
| } |
| EList<JvmMember> _members_2 = type.getMembers(); |
| final Procedure1<JvmOperation> _function_2 = (JvmOperation it) -> { |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(CanExecute.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| ActionType _actionType = action.getActionType(); |
| boolean _matched = false; |
| if (_actionType instanceof ActionTask) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionSelectWorkload) { |
| _matched=true; |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionDialog) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "userAccessService", this._typeReferenceBuilder.typeRef(IUserAccessService.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| EList<JvmFormalParameter> _parameters_2 = it.getParameters(); |
| JvmFormalParameter _parameter_2 = this._jvmTypesBuilder.toParameter(action, "viewContext", this._typeReferenceBuilder.typeRef(IViewContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_2, _parameter_2); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionReport) { |
| _matched=true; |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionChart) { |
| _matched=true; |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionWorkflow) { |
| _matched=true; |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionTable) { |
| _matched=true; |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionOrganization) { |
| _matched=true; |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionDatainterchange) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "dataInterchange", this._typeReferenceBuilder.typeRef(IDataInterchange.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| ActionType _actionType_1 = action.getActionType(); |
| boolean _isHasfilter = ((ActionDatainterchange) _actionType_1).isHasfilter(); |
| if (_isHasfilter) { |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "viewContext", this._typeReferenceBuilder.typeRef(IViewContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionFunction) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionUI) { |
| _matched=true; |
| ActionType _actionType_1 = action.getActionType(); |
| UIActionEnum _action = ((ActionUI) _actionType_1).getAction(); |
| boolean _equals = Objects.equal(_action, UIActionEnum.DATABASE_INFO); |
| if (_equals) { |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| } |
| } |
| } |
| final Procedure1<ITreeAppendable> _function_3 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| String _canExecute = this.canExecute(action); |
| _builder.append(_canExecute); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_3); |
| }; |
| JvmOperation _method_2 = this._jvmTypesBuilder.toMethod(action, "canExecute", this._typeReferenceBuilder.typeRef(boolean.class), _function_2); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members_2, _method_2); |
| EList<JvmMember> _members_3 = type.getMembers(); |
| final Procedure1<JvmOperation> _function_3 = (JvmOperation it) -> { |
| EList<JvmAnnotationReference> _annotations = it.getAnnotations(); |
| JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Execute.class); |
| this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef); |
| ActionType _actionType = action.getActionType(); |
| boolean _matched = false; |
| if (_actionType instanceof ActionTask) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionSelectWorkload) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionDialog) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionReport) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionChart) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionTable) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionOrganization) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionWorkflow) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionDatainterchange) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "persistenceService", this._typeReferenceBuilder.typeRef(IPersistenceService.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| EList<JvmFormalParameter> _parameters_2 = it.getParameters(); |
| JvmFormalParameter _parameter_2 = this._jvmTypesBuilder.toParameter(action, "dataInterchange", this._typeReferenceBuilder.typeRef(IDataInterchange.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_2, _parameter_2); |
| EList<JvmFormalParameter> _parameters_3 = it.getParameters(); |
| JvmFormalParameter _parameter_3 = this._jvmTypesBuilder.toParameter(action, "executorService", this._typeReferenceBuilder.typeRef(VaadinExecutorService.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_3, _parameter_3); |
| EList<JvmFormalParameter> _parameters_4 = it.getParameters(); |
| JvmFormalParameter _parameter_4 = this._jvmTypesBuilder.toParameter(action, "dslMetadataService", this._typeReferenceBuilder.typeRef(IDSLMetadataService.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_4, _parameter_4); |
| EList<JvmFormalParameter> _parameters_5 = it.getParameters(); |
| JvmFormalParameter _parameter_5 = this._jvmTypesBuilder.toParameter(action, "blobService", this._typeReferenceBuilder.typeRef(IBlobService.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_5, _parameter_5); |
| EList<JvmFormalParameter> _parameters_6 = it.getParameters(); |
| JvmFormalParameter _parameter_6 = this._jvmTypesBuilder.toParameter(action, "user", this._typeReferenceBuilder.typeRef(IUser.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_6, _parameter_6); |
| ActionType _actionType_1 = action.getActionType(); |
| boolean _hasFilter = this.hasFilter(((ActionDatainterchange) _actionType_1)); |
| if (_hasFilter) { |
| EList<JvmFormalParameter> _parameters_7 = it.getParameters(); |
| JvmFormalParameter _parameter_7 = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_7, _parameter_7); |
| } |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionFunction) { |
| _matched=true; |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| ActionType _actionType_1 = action.getActionType(); |
| boolean _isHasExecuteLater = ((ActionFunction) _actionType_1).isHasExecuteLater(); |
| if (_isHasExecuteLater) { |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "executorService", this._typeReferenceBuilder.typeRef(VaadinExecutorService.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } |
| if ((((ActionFunction) action.getActionType()).isHasMessage() || |
| ((ActionFunction) action.getActionType()).isHasStartedMessage())) { |
| EList<JvmFormalParameter> _parameters_2 = it.getParameters(); |
| JvmFormalParameter _parameter_2 = this._jvmTypesBuilder.toParameter(action, "dslMetadataService", this._typeReferenceBuilder.typeRef(IDSLMetadataService.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_2, _parameter_2); |
| EList<JvmFormalParameter> _parameters_3 = it.getParameters(); |
| JvmFormalParameter _parameter_3 = this._jvmTypesBuilder.toParameter(action, "user", this._typeReferenceBuilder.typeRef(IUser.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_3, _parameter_3); |
| } |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionUI) { |
| _matched=true; |
| ActionType _actionType_1 = action.getActionType(); |
| UIActionEnum _action = ((ActionUI) _actionType_1).getAction(); |
| boolean _equals = Objects.equal(_action, UIActionEnum.DATABASE_INFO); |
| if (_equals) { |
| EList<JvmFormalParameter> _parameters = it.getParameters(); |
| JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter); |
| EList<JvmFormalParameter> _parameters_1 = it.getParameters(); |
| JvmFormalParameter _parameter_1 = this._jvmTypesBuilder.toParameter(action, "eventDispatcher", this._typeReferenceBuilder.typeRef(IEventDispatcher.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1); |
| } else { |
| ActionType _actionType_2 = action.getActionType(); |
| UIActionEnum _action_1 = ((ActionUI) _actionType_2).getAction(); |
| boolean _equals_1 = Objects.equal(_action_1, UIActionEnum.MDX_QUERY); |
| if (_equals_1) { |
| EList<JvmFormalParameter> _parameters_2 = it.getParameters(); |
| JvmFormalParameter _parameter_2 = this._jvmTypesBuilder.toParameter(action, "eclipseContext", this._typeReferenceBuilder.typeRef(IEclipseContext.class)); |
| this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_2, _parameter_2); |
| } |
| } |
| } |
| } |
| final Procedure1<ITreeAppendable> _function_4 = (ITreeAppendable it_1) -> { |
| StringConcatenation _builder = new StringConcatenation(); |
| CharSequence _execute = this.execute(action); |
| _builder.append(_execute); |
| it_1.append(_builder); |
| }; |
| this._jvmTypesBuilder.setBody(it, _function_4); |
| }; |
| JvmOperation _method_3 = this._jvmTypesBuilder.toMethod(action, "execute", this._typeReferenceBuilder.typeRef(Void.TYPE), _function_3); |
| this._jvmTypesBuilder.<JvmOperation>operator_add(_members_3, _method_3); |
| } |
| |
| public CharSequence execute(final ActionCommand command) { |
| CharSequence _switchResult = null; |
| ActionType _actionType = command.getActionType(); |
| boolean _matched = false; |
| if (_actionType instanceof ActionDatainterchange) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| DataInterchange _dataRef = ((ActionDatainterchange) _actionType_1).getDataRef(); |
| CharSequence _doInterchange = null; |
| if (((DataInterchange) _dataRef)!=null) { |
| ActionType _actionType_2 = command.getActionType(); |
| DataInterchange _dataRef_1 = ((ActionDatainterchange) _actionType_1).getDataRef(); |
| _doInterchange=this.doInterchange(((DataInterchange) _dataRef_1), command); |
| } |
| _switchResult = _doInterchange; |
| } |
| if (!_matched) { |
| _switchResult = this.doExecute(command); |
| } |
| return _switchResult; |
| } |
| |
| public CharSequence doInterchange(final DataInterchange dataInterchange, final ActionCommand action) { |
| StringConcatenation _builder = new StringConcatenation(); |
| ActionType _actionType = action.getActionType(); |
| final ActionDatainterchange actioninterchange = ((ActionDatainterchange) _actionType); |
| _builder.newLineIfNotEmpty(); |
| String _basicRunConfiguration = this.data.getBasicRunConfiguration(dataInterchange, true, actioninterchange.getAction().getLiteral(), null); |
| _builder.append(_basicRunConfiguration); |
| _builder.newLineIfNotEmpty(); |
| String _defaultVariableName = this.data.getDefaultVariableName(dataInterchange); |
| _builder.append(_defaultVariableName); |
| _builder.append(".setDirection(WorkerThreadRunnable.Direction."); |
| String _upperCase = actioninterchange.getAction().getLiteral().toUpperCase(); |
| _builder.append(_upperCase); |
| _builder.append(");"); |
| _builder.newLineIfNotEmpty(); |
| String _defaultVariableName_1 = this.data.getDefaultVariableName(dataInterchange); |
| _builder.append(_defaultVariableName_1); |
| _builder.append(".setEventDispatcher(eventDispatcher);"); |
| _builder.newLineIfNotEmpty(); |
| String _defaultVariableName_2 = this.data.getDefaultVariableName(dataInterchange); |
| _builder.append(_defaultVariableName_2); |
| _builder.append(".setBlobService(blobService);"); |
| _builder.newLineIfNotEmpty(); |
| _builder.newLine(); |
| CharSequence _xifexpression = null; |
| boolean _hasFilter = this.hasFilter(actioninterchange); |
| if (_hasFilter) { |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| String _determineInterchangeFilter = this.determineInterchangeFilter(this.data.getDefaultVariableName(dataInterchange), actioninterchange); |
| _builder_1.append(_determineInterchangeFilter); |
| _builder_1.newLineIfNotEmpty(); |
| String _defaultVariableName_3 = this.data.getDefaultVariableName(dataInterchange); |
| _builder_1.append(_defaultVariableName_3); |
| _builder_1.append(".setActionFilterExecutionNeeded(true);"); |
| _builder_1.newLineIfNotEmpty(); |
| _xifexpression = _builder_1; |
| } |
| _builder.append(_xifexpression); |
| _builder.newLineIfNotEmpty(); |
| _builder.newLine(); |
| _builder.append("Notification.show(dslMetadataService.translate(user.getLocale().toLanguageTag(), \"datainterchangeStarted\"),Notification.Type.HUMANIZED_MESSAGE);"); |
| _builder.newLine(); |
| _builder.append("executorService.invokeLater(null, new Runnable() {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("@Override"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("public void run() {"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| String _defaultVariableName_4 = this.data.getDefaultVariableName(dataInterchange); |
| _builder.append(_defaultVariableName_4, "\t\t"); |
| _builder.append(".run();"); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("\t"); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("});"); |
| return _builder; |
| } |
| |
| public String determineInterchangeFilter(final String interchangename, final ActionDatainterchange actioninterchange) { |
| String result = ""; |
| List<LEntityFeature> parameterList = this.getFilterAttributesAndReferences(actioninterchange.getDataRef().getActionFilter()); |
| for (int i = 0; (i < parameterList.size()); i++) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("filters.put(\"param"); |
| _builder.append(i); |
| _builder.append("\", new Parameter(\""); |
| String _name = parameterList.get(i).getName(); |
| _builder.append(_name); |
| _builder.append("\", viewContext.getBean(\""); |
| String _name_1 = parameterList.get(i).getName(); |
| _builder.append(_name_1); |
| _builder.append("Param"); |
| _builder.append(i); |
| _builder.append("\")));"); |
| _builder.newLineIfNotEmpty(); |
| result = result.concat(_builder.toString()); |
| } |
| boolean _isEmpty = result.isEmpty(); |
| boolean _not = (!_isEmpty); |
| if (_not) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("IViewContext viewContext = eclipseContext.<IViewContext>get(IViewContext.class);"); |
| _builder.newLine(); |
| _builder.append("HashMap<String, Parameter> filters = new HashMap<String, Parameter>();"); |
| _builder.newLine(); |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| _builder_1.append(interchangename); |
| _builder_1.append(".setFilter(filters);"); |
| String _concat = result.concat(_builder_1.toString()); |
| String _plus = (_builder.toString() + _concat); |
| result = _plus; |
| } |
| return result; |
| } |
| |
| public List<LEntityFeature> getFilterAttributesAndReferences(final DataInterchangeFilter filter) { |
| ArrayList<LEntityFeature> results = CollectionLiterals.<LEntityFeature>newArrayList(); |
| if (((filter != null) && (filter.getAttrFilter() != null))) { |
| results.addAll(this.getAttributes(filter.getAttrFilter())); |
| } |
| if (((filter != null) && (filter.getRefFilter() != null))) { |
| results.addAll(this.getRefAttributes(filter.getRefFilter())); |
| } |
| return results; |
| } |
| |
| public List<LEntityFeature> getAttributes(final AttributeFilter filter) { |
| ArrayList<LEntityFeature> results = CollectionLiterals.<LEntityFeature>newArrayList(); |
| if (((filter != null) && (filter.getRefProperty() != null))) { |
| results.add(filter.getRefProperty()); |
| AttributeFilter _subCondition = filter.getSubCondition(); |
| boolean _tripleNotEquals = (_subCondition != null); |
| if (_tripleNotEquals) { |
| results.addAll(this.getAttributes(filter.getSubCondition())); |
| } |
| } |
| return results; |
| } |
| |
| public List<LEntityFeature> getRefAttributes(final ReferenceFilter filter) { |
| ArrayList<LEntityFeature> results = CollectionLiterals.<LEntityFeature>newArrayList(); |
| if (((filter != null) && (filter.getRef() != null))) { |
| if ((filter instanceof ReferenceFilterWithAttr)) { |
| LEntityAttribute _refProperty = ((ReferenceFilterWithAttr)filter).getRefProperty(); |
| boolean _tripleNotEquals = (_refProperty != null); |
| if (_tripleNotEquals) { |
| results.add(((ReferenceFilterWithAttr)filter).getRefProperty()); |
| } |
| } else { |
| if ((filter instanceof ReferenceFilterWithOutAttr)) { |
| LEntityReference _ref = ((ReferenceFilterWithOutAttr)filter).getRef(); |
| boolean _tripleNotEquals_1 = (_ref != null); |
| if (_tripleNotEquals_1) { |
| results.add(((ReferenceFilterWithOutAttr)filter).getRef()); |
| } |
| } |
| } |
| ReferenceFilter _subCondition = filter.getSubCondition(); |
| boolean _tripleNotEquals_2 = (_subCondition != null); |
| if (_tripleNotEquals_2) { |
| results.addAll(this.getRefAttributes(filter.getSubCondition())); |
| } |
| } |
| return results; |
| } |
| |
| public String doExecute(final ActionCommand command) { |
| String actionEnumStr = null; |
| ActionType _actionType = command.getActionType(); |
| boolean _matched = false; |
| if (_actionType instanceof ActionTask) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| actionEnumStr = this.getEnumString(((ActionTask) _actionType_1).getAction()).toString(); |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionSelectWorkload) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| actionEnumStr = this.getEnumString(((ActionSelectWorkload) _actionType_1).getAction()).toString(); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionDialog) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| actionEnumStr = this.getEnumString(((ActionDialog) _actionType_1).getAction()).toString(); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionReport) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| actionEnumStr = this.getEnumString(((ActionReport) _actionType_1).getAction()).toString(); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionChart) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| actionEnumStr = this.getEnumString(((ActionChart) _actionType_1).getAction()).toString(); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionTable) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| actionEnumStr = this.getEnumString(((ActionTable) _actionType_1).getAction()).toString(); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionOrganization) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| actionEnumStr = this.getEnumString(((ActionOrganization) _actionType_1).getAction()).toString(); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionWorkflow) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| actionEnumStr = this.getEnumString(((ActionWorkflow) _actionType_1).getAction()).toString(); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionFunction) { |
| _matched=true; |
| actionEnumStr = "Execute"; |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionUI) { |
| _matched=true; |
| ActionType _actionType_1 = command.getActionType(); |
| actionEnumStr = this.getEnumString(((ActionUI) _actionType_1).getAction()).toString(); |
| } |
| } |
| ActionType _actionType_1 = command.getActionType(); |
| if ((_actionType_1 instanceof ActionFunction)) { |
| ActionType _actionType_2 = command.getActionType(); |
| ActionFunction func = ((ActionFunction) _actionType_2); |
| boolean _isHasExecuteImmediate = func.isHasExecuteImmediate(); |
| if (_isHasExecuteImmediate) { |
| StringConcatenation _builder = new StringConcatenation(); |
| { |
| boolean _isHasMessage = func.isHasMessage(); |
| if (_isHasMessage) { |
| _builder.append("boolean result = "); |
| } |
| } |
| EObject _eContainer = func.getActionGroup().eContainer(); |
| QualifiedName _fullyQualifiedName = this._iQualifiedNameProvider.getFullyQualifiedName(((FunctionLibraryPackage) _eContainer)); |
| _builder.append(_fullyQualifiedName); |
| _builder.append("."); |
| String _firstUpper = StringExtensions.toFirstUpper(func.getActionGroup().getName().toString()); |
| _builder.append(_firstUpper); |
| _builder.append("."); |
| String _string = func.getExecuteImmediate().getName().toString(); |
| _builder.append(_string); |
| _builder.append("(eclipseContext);"); |
| _builder.newLineIfNotEmpty(); |
| { |
| boolean _isHasMessage_1 = func.isHasMessage(); |
| if (_isHasMessage_1) { |
| _builder.append("if(!result) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("Notification.show("); |
| EObject _eContainer_1 = func.getMessageCategory().eContainer(); |
| QualifiedName _fullyQualifiedName_1 = this._iQualifiedNameProvider.getFullyQualifiedName(((MessagePackage) _eContainer_1)); |
| _builder.append(_fullyQualifiedName_1, "\t"); |
| _builder.append("."); |
| String _name = func.getMessageCategory().getName(); |
| _builder.append(_name, "\t"); |
| _builder.append("Message."); |
| String _firstLower = StringExtensions.toFirstLower(func.getOnFailMessage().getName()); |
| _builder.append(_firstLower, "\t"); |
| _builder.append("().getShowMessage(dslMetadataService, user),Notification.Type.ERROR_MESSAGE);"); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("} "); |
| { |
| boolean _isHasSuccessMessage = func.isHasSuccessMessage(); |
| if (_isHasSuccessMessage) { |
| _builder.append("else {"); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("\t\t"); |
| _builder.append("Notification.show("); |
| EObject _eContainer_2 = func.getMessageCategory().eContainer(); |
| QualifiedName _fullyQualifiedName_2 = this._iQualifiedNameProvider.getFullyQualifiedName(((MessagePackage) _eContainer_2)); |
| _builder.append(_fullyQualifiedName_2, "\t\t"); |
| _builder.append("."); |
| String _name_1 = func.getMessageCategory().getName(); |
| _builder.append(_name_1, "\t\t"); |
| _builder.append("Message."); |
| String _firstLower_1 = StringExtensions.toFirstLower(func.getOnSuccessMessage().getName()); |
| _builder.append(_firstLower_1, "\t\t"); |
| _builder.append("().getShowMessage(dslMetadataService, user), Notification.Type.HUMANIZED_MESSAGE);"); |
| _builder.newLineIfNotEmpty(); |
| _builder.append("}"); |
| } |
| } |
| } |
| } |
| return _builder.toString(); |
| } |
| boolean _isHasExecuteLater = func.isHasExecuteLater(); |
| if (_isHasExecuteLater) { |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| { |
| boolean _isHasStartedMessage = func.isHasStartedMessage(); |
| if (_isHasStartedMessage) { |
| _builder_1.append("Notification.show("); |
| EObject _eContainer_3 = func.getMessageCategory().eContainer(); |
| QualifiedName _fullyQualifiedName_3 = this._iQualifiedNameProvider.getFullyQualifiedName(((MessagePackage) _eContainer_3)); |
| _builder_1.append(_fullyQualifiedName_3); |
| _builder_1.append("."); |
| String _name_2 = func.getMessageCategory().getName(); |
| _builder_1.append(_name_2); |
| _builder_1.append("Message."); |
| String _firstLower_2 = StringExtensions.toFirstLower(func.getOnStartedMessage().getName()); |
| _builder_1.append(_firstLower_2); |
| _builder_1.append("().getShowMessage(dslMetadataService, user),Notification.Type.HUMANIZED_MESSAGE);"); |
| _builder_1.newLineIfNotEmpty(); |
| } |
| } |
| _builder_1.append("executorService.invokeLater(eclipseContext, new Runnable() {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("@Override"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("public void run() {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t"); |
| EObject _eContainer_4 = func.getActionGroup().eContainer(); |
| QualifiedName _fullyQualifiedName_4 = this._iQualifiedNameProvider.getFullyQualifiedName(((FunctionLibraryPackage) _eContainer_4)); |
| _builder_1.append(_fullyQualifiedName_4, "\t\t"); |
| _builder_1.append("."); |
| String _firstUpper_1 = StringExtensions.toFirstUpper(func.getActionGroup().getName().toString()); |
| _builder_1.append(_firstUpper_1, "\t\t"); |
| _builder_1.append("."); |
| String _string_1 = func.getExecuteLater().getName().toString(); |
| _builder_1.append(_string_1, "\t\t"); |
| _builder_1.append("(eclipseContext);"); |
| _builder_1.newLineIfNotEmpty(); |
| _builder_1.append("\t"); |
| _builder_1.append("}"); |
| _builder_1.newLine(); |
| _builder_1.append("});"); |
| return _builder_1.toString(); |
| } |
| } else { |
| if (((command.getActionType() instanceof ActionUI) && |
| Objects.equal(((ActionUI) command.getActionType()).getAction(), UIActionEnum.NEXT_PART))) { |
| StringConcatenation _builder_2 = new StringConcatenation(); |
| _builder_2.append("log.debug(\"execute next part\");"); |
| _builder_2.newLine(); |
| _builder_2.append("MUIElement newActivePart = E4Helper.getPart(true, getActivePart(), true);"); |
| _builder_2.newLine(); |
| _builder_2.append("if(newActivePart != null && newActivePart instanceof MPart) {"); |
| _builder_2.newLine(); |
| _builder_2.append("\t"); |
| _builder_2.append("MPart part = (MPart)newActivePart;"); |
| _builder_2.newLine(); |
| _builder_2.append("\t"); |
| _builder_2.append("part.getContext().activate();"); |
| _builder_2.newLine(); |
| _builder_2.append("}"); |
| return _builder_2.toString(); |
| } else { |
| if (((command.getActionType() instanceof ActionUI) && |
| Objects.equal(((ActionUI) command.getActionType()).getAction(), UIActionEnum.PREVIOUS_PART))) { |
| StringConcatenation _builder_3 = new StringConcatenation(); |
| _builder_3.append("log.debug(\"execute previous part\");"); |
| _builder_3.newLine(); |
| _builder_3.append("MUIElement newActivePart = E4Helper.getPart(false, getActivePart(), true);"); |
| _builder_3.newLine(); |
| _builder_3.append("if(newActivePart != null && newActivePart instanceof MPart) {"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("MPart part = (MPart)newActivePart;"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("part.getContext().activate();"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("IE4Dialog dialog = part.getContext().get(IE4Dialog.class);"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("if (dialog != null) {"); |
| _builder_3.newLine(); |
| _builder_3.append("\t\t"); |
| _builder_3.append("ContextInjectionFactory.invoke(dialog, Focus.class, part.getContext());"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("}"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("IE4Table table = part.getContext().get(IE4Table.class);"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("if (table != null) {"); |
| _builder_3.newLine(); |
| _builder_3.append("\t\t"); |
| _builder_3.append("ContextInjectionFactory.invoke(table, Focus.class, part.getContext());"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("}"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("IE4Focusable focusable = part.getContext().get(IE4Focusable.class);"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("if (focusable != null) {"); |
| _builder_3.newLine(); |
| _builder_3.append("\t\t"); |
| _builder_3.append("ContextInjectionFactory.invoke(focusable, Focus.class, part.getContext());"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("}"); |
| _builder_3.newLine(); |
| _builder_3.append("}"); |
| return _builder_3.toString(); |
| } else { |
| if (((command.getActionType() instanceof ActionUI) && |
| Objects.equal(((ActionUI) command.getActionType()).getAction(), UIActionEnum.PREVIOUS_PERSPECTIVE))) { |
| StringConcatenation _builder_4 = new StringConcatenation(); |
| _builder_4.append("log.debug(\"execute previous perspective\");"); |
| _builder_4.newLine(); |
| _builder_4.append("if (getActivePart() != null) {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("MUIElement newActivePerspective = getActivePart().getParent();"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("if (newActivePerspective != null && newActivePerspective instanceof MPerspectiveStack) {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("MPerspectiveStack stack = (MPerspectiveStack) newActivePerspective;"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("int childrenCount = stack.getChildren().size();"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("int idx = stack.getChildren().indexOf(getActivePart());"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("if (--idx >= 0) {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t\t"); |
| _builder_4.append("newActivePerspective = stack.getChildren().get(idx);"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("} else {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t\t"); |
| _builder_4.append("newActivePerspective = stack.getChildren().get(--childrenCount);"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("}"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("String elementId = newActivePerspective.getElementId();"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("IEclipseContext context = ((MPerspective) newActivePerspective).getContext();"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("if (elementId.equals(IPerspectiveProvider.toPerspectiveElementId(IPerspectiveProvider.WELCOME_SCREEN_ID))) {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t\t"); |
| _builder_4.append("if (context.containsKey(EModelService.class)) {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t\t\t"); |
| _builder_4.append("context.get(EModelService.class).bringToTop(newActivePerspective);"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t\t"); |
| _builder_4.append("}"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("} else {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t\t"); |
| _builder_4.append("HybridVaadinVaaclipseConnector.instance(context).onFocusPerspective(elementId);"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("}"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("}"); |
| _builder_4.newLine(); |
| _builder_4.append("}"); |
| return _builder_4.toString(); |
| } else { |
| if (((command.getActionType() instanceof ActionUI) && |
| Objects.equal(((ActionUI) command.getActionType()).getAction(), UIActionEnum.NEXT_PERSPECTIVE))) { |
| StringConcatenation _builder_5 = new StringConcatenation(); |
| _builder_5.append("log.debug(\"execute next perspective\");"); |
| _builder_5.newLine(); |
| _builder_5.append("if (getActivePart() != null) {"); |
| _builder_5.newLine(); |
| _builder_5.append("\t"); |
| _builder_5.append("MUIElement newActivePerspective = getActivePart().getParent();"); |
| _builder_5.newLine(); |
| _builder_5.append("\t"); |
| _builder_5.append("if (newActivePerspective != null && newActivePerspective instanceof MPerspectiveStack) {"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("MPerspectiveStack stack = (MPerspectiveStack) newActivePerspective;"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("int childrenCount = stack.getChildren().size();"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("int idx = stack.getChildren().indexOf(getActivePart());"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("if(++idx < childrenCount){"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t\t"); |
| _builder_5.append("newActivePerspective = stack.getChildren().get(idx);"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("}else{"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t\t"); |
| _builder_5.append("newActivePerspective = stack.getChildren().get(0);"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("}"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("String elementId = newActivePerspective.getElementId();"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("IEclipseContext context = ((MPerspective) newActivePerspective).getContext();"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("if(elementId.equals(IPerspectiveProvider.toPerspectiveElementId(IPerspectiveProvider.WELCOME_SCREEN_ID))){"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t\t"); |
| _builder_5.append("if (context.containsKey(EModelService.class)) {"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t\t\t"); |
| _builder_5.append("context.get(EModelService.class).bringToTop(newActivePerspective);"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t\t"); |
| _builder_5.append("}"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("}else{ \t\t\t"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t\t"); |
| _builder_5.append("HybridVaadinVaaclipseConnector.instance(context).onFocusPerspective(elementId);"); |
| _builder_5.newLine(); |
| _builder_5.append("\t\t"); |
| _builder_5.append("}"); |
| _builder_5.newLine(); |
| _builder_5.append("\t"); |
| _builder_5.append("}"); |
| _builder_5.newLine(); |
| _builder_5.append("}"); |
| return _builder_5.toString(); |
| } else { |
| if (((command.getActionType() instanceof ActionUI) && |
| Objects.equal(((ActionUI) command.getActionType()).getAction(), UIActionEnum.MDX_QUERY))) { |
| StringConcatenation _builder_6 = new StringConcatenation(); |
| _builder_6.append("UI.getCurrent().addWindow(new MDXDialog(eclipseContext));"); |
| _builder_6.newLine(); |
| return _builder_6.toString(); |
| } else { |
| StringConcatenation _builder_7 = new StringConcatenation(); |
| _builder_7.append("log.debug(\"action execute called for "); |
| String _name_3 = command.getName(); |
| _builder_7.append(_name_3); |
| _builder_7.append("\");"); |
| _builder_7.newLineIfNotEmpty(); |
| _builder_7.append("String uuid = (String)eclipseContext.get(\""); |
| _builder_7.append(IToolbarAction.TOOLBAR_UUID); |
| _builder_7.append("\");"); |
| _builder_7.newLineIfNotEmpty(); |
| _builder_7.append("MPerspective perspective = eclipseContext.get(MPerspective.class);"); |
| _builder_7.newLine(); |
| _builder_7.append("EventDispatcherEvent evnt = new EventDispatcherEvent(perspective, EventDispatcherCommand.ACTION, uuid, \""); |
| QualifiedName _fullyQualifiedName_5 = this._iQualifiedNameProvider.getFullyQualifiedName(command); |
| _builder_7.append(_fullyQualifiedName_5); |
| _builder_7.append("\");"); |
| _builder_7.newLineIfNotEmpty(); |
| _builder_7.append("evnt.addItem(EventDispatcherDataTag.BUTTON_ID, "); |
| _builder_7.append(actionEnumStr); |
| _builder_7.append(");"); |
| _builder_7.newLineIfNotEmpty(); |
| { |
| ActionType _actionType_3 = command.getActionType(); |
| if ((_actionType_3 instanceof ActionTask)) { |
| _builder_7.append("evnt.addItem(EventDispatcherDataTag.TASK_ID, TaskHelper.getTaskId(eclipseContext));"); |
| _builder_7.newLine(); |
| } |
| } |
| _builder_7.append("eventDispatcher.sendEvent(evnt);"); |
| return _builder_7.toString(); |
| } |
| } |
| } |
| } |
| } |
| } |
| return null; |
| } |
| |
| public CharSequence getEnumString(final Enumerator actionEnum) { |
| StringConcatenation _builder = new StringConcatenation(); |
| String _simpleName = actionEnum.getClass().getSimpleName(); |
| _builder.append(_simpleName); |
| _builder.append("."); |
| String _name = actionEnum.getName(); |
| _builder.append(_name); |
| return _builder; |
| } |
| |
| public String canExecute(final ActionCommand action) { |
| ActionType _actionType = action.getActionType(); |
| boolean _matched = false; |
| if (_actionType instanceof ActionTask) { |
| _matched=true; |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("return TaskHelper."); |
| ActionType _actionType_1 = action.getActionType(); |
| String _firstLower = StringExtensions.toFirstLower(((ActionTask) _actionType_1).getAction().getLiteral()); |
| _builder.append(_firstLower); |
| _builder.append("CanExecute(eclipseContext);"); |
| return _builder.toString(); |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionUI) { |
| _matched=true; |
| ActionType _actionType_1 = action.getActionType(); |
| UIActionEnum _action = ((ActionUI) _actionType_1).getAction(); |
| boolean _equals = Objects.equal(_action, UIActionEnum.DATABASE_INFO); |
| if (_equals) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("IE4Dialog dialog = eclipseContext.get(IE4Dialog.class);"); |
| _builder.newLine(); |
| _builder.append("if (dialog == null) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("return false;"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("boolean result = !(boolean) ContextInjectionFactory.invoke(dialog, IsNew.class, eclipseContext);"); |
| _builder.newLine(); |
| _builder.append("return result;"); |
| return _builder.toString(); |
| } else { |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| _builder_1.append("return true;"); |
| _builder_1.newLine(); |
| return _builder_1.toString(); |
| } |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionDialog) { |
| _matched=true; |
| ActionType _actionType_1 = action.getActionType(); |
| DialogActionEnum _action = ((ActionDialog) _actionType_1).getAction(); |
| boolean _equals = Objects.equal(_action, DialogActionEnum.DIALOG_ACTION_SAVE); |
| if (_equals) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("IE4Dialog dialog = eclipseContext.get(IE4Dialog.class);"); |
| _builder.newLine(); |
| _builder.append("if (dialog == null) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("return false;"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("Object dto = viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);"); |
| _builder.newLine(); |
| _builder.append("if (dto == null) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("return false;"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("boolean result1 = (boolean) ContextInjectionFactory.invoke(dialog, IsValid.class, eclipseContext);"); |
| _builder.newLine(); |
| _builder.append("boolean result2 = (boolean) ContextInjectionFactory.invoke(dialog, IsDirty.class, eclipseContext);"); |
| _builder.newLine(); |
| _builder.append("boolean result3 = true;"); |
| _builder.newLine(); |
| _builder.append("if( result1 && result2) {"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("String clazzName = dto.getClass().getName();"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("String grantKey = clazzName + \"###UPDATABLE\";"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("if( isGranted.containsKey(grantKey)) {"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("result3=isGranted.get(grantKey);"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("} else {"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("result3 = userAccessService.isGranted(Group.DTO, Action.UPDATABLE, clazzName);"); |
| _builder.newLine(); |
| _builder.append("\t\t"); |
| _builder.append("isGranted.put(grantKey,result3);"); |
| _builder.newLine(); |
| _builder.append("\t"); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("}"); |
| _builder.newLine(); |
| _builder.append("return result1 && result2 && result3;"); |
| return _builder.toString(); |
| } else { |
| ActionType _actionType_2 = action.getActionType(); |
| DialogActionEnum _action_1 = ((ActionDialog) _actionType_2).getAction(); |
| boolean _equals_1 = Objects.equal(_action_1, DialogActionEnum.DIALOG_ACTION_SAVE_AND_NEW); |
| if (_equals_1) { |
| StringConcatenation _builder_1 = new StringConcatenation(); |
| _builder_1.append("IE4Dialog dialog = eclipseContext.get(IE4Dialog.class);"); |
| _builder_1.newLine(); |
| _builder_1.append("if (dialog == null) {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("return false;"); |
| _builder_1.newLine(); |
| _builder_1.append("}"); |
| _builder_1.newLine(); |
| _builder_1.append("Object dto = viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);"); |
| _builder_1.newLine(); |
| _builder_1.append("if (dto == null) {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("return false;"); |
| _builder_1.newLine(); |
| _builder_1.append("}"); |
| _builder_1.newLine(); |
| _builder_1.append("boolean result1 = (boolean) ContextInjectionFactory.invoke(dialog, IsValid.class, eclipseContext);"); |
| _builder_1.newLine(); |
| _builder_1.append("boolean result2 = (boolean) ContextInjectionFactory.invoke(dialog, IsDirty.class, eclipseContext);"); |
| _builder_1.newLine(); |
| _builder_1.append("boolean result3 = true;"); |
| _builder_1.newLine(); |
| _builder_1.append("boolean result4 = true;"); |
| _builder_1.newLine(); |
| _builder_1.append("if( result1 && result2) {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("String clazzName = dto.getClass().getName();"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("String grantKey = clazzName + \"###UPDATABLE\";"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("if( isGranted.containsKey(grantKey)) {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t"); |
| _builder_1.append("result3=isGranted.get(grantKey);"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("} else {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t"); |
| _builder_1.append("result3 = userAccessService.isGranted(Group.DTO, Action.UPDATABLE, clazzName);"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t"); |
| _builder_1.append("isGranted.put(grantKey,result3);"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("}"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("if( result3 ) {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t"); |
| _builder_1.append("grantKey = clazzName + \"###CREATABLE\";"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t"); |
| _builder_1.append("if( isGranted.containsKey(grantKey)) {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t\t"); |
| _builder_1.append("result4=isGranted.get(grantKey);"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t"); |
| _builder_1.append("} else {"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t\t"); |
| _builder_1.append("result4 = userAccessService.isGranted(Group.DTO, Action.CREATABLE, clazzName);"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t\t"); |
| _builder_1.append("isGranted.put(grantKey,result4);"); |
| _builder_1.newLine(); |
| _builder_1.append("\t\t"); |
| _builder_1.append("}"); |
| _builder_1.newLine(); |
| _builder_1.append("\t"); |
| _builder_1.append("}"); |
| _builder_1.newLine(); |
| _builder_1.append("}"); |
| _builder_1.newLine(); |
| _builder_1.append("return result1 && result2 && result3 && result4;"); |
| return _builder_1.toString(); |
| } else { |
| ActionType _actionType_3 = action.getActionType(); |
| DialogActionEnum _action_2 = ((ActionDialog) _actionType_3).getAction(); |
| boolean _equals_2 = Objects.equal(_action_2, DialogActionEnum.DIALOG_ACTION_SAVE_AS_NEW); |
| if (_equals_2) { |
| StringConcatenation _builder_2 = new StringConcatenation(); |
| _builder_2.append("IE4Dialog dialog = eclipseContext.get(IE4Dialog.class);"); |
| _builder_2.newLine(); |
| _builder_2.append("if (dialog == null) {"); |
| _builder_2.newLine(); |
| _builder_2.append("\t"); |
| _builder_2.append("return false;"); |
| _builder_2.newLine(); |
| _builder_2.append("}"); |
| _builder_2.newLine(); |
| _builder_2.append("Object dto = viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);"); |
| _builder_2.newLine(); |
| _builder_2.append("if (dto == null) {"); |
| _builder_2.newLine(); |
| _builder_2.append("\t"); |
| _builder_2.append("return false;"); |
| _builder_2.newLine(); |
| _builder_2.append("}"); |
| _builder_2.newLine(); |
| _builder_2.append("boolean result1 = (boolean) ContextInjectionFactory.invoke(dialog, IsValid.class, eclipseContext);"); |
| _builder_2.newLine(); |
| _builder_2.append("boolean result2 = (boolean) ContextInjectionFactory.invoke(dialog, IsDirty.class, eclipseContext);"); |
| _builder_2.newLine(); |
| _builder_2.append("boolean result3 = true;"); |
| _builder_2.newLine(); |
| _builder_2.append("if( result1 && result2 ) {"); |
| _builder_2.newLine(); |
| _builder_2.append("\t"); |
| _builder_2.append("String clazzName = dto.getClass().getName();"); |
| _builder_2.newLine(); |
| _builder_2.append("\t"); |
| _builder_2.append("String grantKey = clazzName + \"###CREATABLE\";"); |
| _builder_2.newLine(); |
| _builder_2.append("\t"); |
| _builder_2.append("if( isGranted.containsKey(grantKey)) {"); |
| _builder_2.newLine(); |
| _builder_2.append("\t\t"); |
| _builder_2.append("result3=isGranted.get(grantKey);"); |
| _builder_2.newLine(); |
| _builder_2.append("\t"); |
| _builder_2.append("} else {"); |
| _builder_2.newLine(); |
| _builder_2.append("\t\t"); |
| _builder_2.append("result3 = userAccessService.isGranted(Group.DTO, Action.CREATABLE, clazzName);"); |
| _builder_2.newLine(); |
| _builder_2.append("\t\t"); |
| _builder_2.append("isGranted.put(grantKey,result3);"); |
| _builder_2.newLine(); |
| _builder_2.append("\t"); |
| _builder_2.append("}"); |
| _builder_2.newLine(); |
| _builder_2.append("}"); |
| _builder_2.newLine(); |
| _builder_2.append("return result1 && result2 && result3;"); |
| return _builder_2.toString(); |
| } else { |
| ActionType _actionType_4 = action.getActionType(); |
| DialogActionEnum _action_3 = ((ActionDialog) _actionType_4).getAction(); |
| boolean _equals_3 = Objects.equal(_action_3, DialogActionEnum.DIALOG_ACTION_NEW); |
| if (_equals_3) { |
| StringConcatenation _builder_3 = new StringConcatenation(); |
| _builder_3.append("IE4Dialog dialog = eclipseContext.get(IE4Dialog.class);"); |
| _builder_3.newLine(); |
| _builder_3.append("if (dialog == null) {"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("return false;"); |
| _builder_3.newLine(); |
| _builder_3.append("}"); |
| _builder_3.newLine(); |
| _builder_3.append("Object dto = viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);"); |
| _builder_3.newLine(); |
| _builder_3.append("if (dto == null) {"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("return false;"); |
| _builder_3.newLine(); |
| _builder_3.append("}"); |
| _builder_3.newLine(); |
| _builder_3.append("boolean result = !(boolean) ContextInjectionFactory.invoke(dialog, IsDirty.class, eclipseContext);"); |
| _builder_3.newLine(); |
| _builder_3.append("boolean result2 = true;"); |
| _builder_3.newLine(); |
| _builder_3.append("if( result ) {"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("String clazzName = dto.getClass().getName();"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("String grantKey = clazzName + \"###CREATABLE\";"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("if( isGranted.containsKey(grantKey)) {"); |
| _builder_3.newLine(); |
| _builder_3.append("\t\t"); |
| _builder_3.append("result2=isGranted.get(grantKey);"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("} else {"); |
| _builder_3.newLine(); |
| _builder_3.append("\t\t"); |
| _builder_3.append("result2=userAccessService.isGranted(Group.DTO, Action.CREATABLE, clazzName);"); |
| _builder_3.newLine(); |
| _builder_3.append("\t\t"); |
| _builder_3.append("isGranted.put(grantKey,result2);"); |
| _builder_3.newLine(); |
| _builder_3.append("\t"); |
| _builder_3.append("}"); |
| _builder_3.newLine(); |
| _builder_3.append("}"); |
| _builder_3.newLine(); |
| _builder_3.append("return result && result2;"); |
| return _builder_3.toString(); |
| } else { |
| ActionType _actionType_5 = action.getActionType(); |
| DialogActionEnum _action_4 = ((ActionDialog) _actionType_5).getAction(); |
| boolean _equals_4 = Objects.equal(_action_4, DialogActionEnum.DIALOG_ACTION_DELETE); |
| if (_equals_4) { |
| StringConcatenation _builder_4 = new StringConcatenation(); |
| _builder_4.append("IE4Dialog dialog = eclipseContext.get(IE4Dialog.class);"); |
| _builder_4.newLine(); |
| _builder_4.append("if (dialog == null) {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("return false;"); |
| _builder_4.newLine(); |
| _builder_4.append("}"); |
| _builder_4.newLine(); |
| _builder_4.append("Object dto = viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);"); |
| _builder_4.newLine(); |
| _builder_4.append("if (dto == null) {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("return false;"); |
| _builder_4.newLine(); |
| _builder_4.append("}"); |
| _builder_4.newLine(); |
| _builder_4.append("boolean result1 = !(boolean) ContextInjectionFactory.invoke(dialog, IsNew.class, eclipseContext);"); |
| _builder_4.newLine(); |
| _builder_4.append("boolean result2 = (boolean) ContextInjectionFactory.invoke(dialog, IsPositioned.class, eclipseContext);"); |
| _builder_4.newLine(); |
| _builder_4.append("boolean result3 = true;"); |
| _builder_4.newLine(); |
| _builder_4.append("if( result1 && result2 ) {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("String clazzName = dto.getClass().getName();"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("String grantKey = clazzName + \"###DELETEABLE\";"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("if( isGranted.containsKey(grantKey)) {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("result3=isGranted.get(grantKey);"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("} else {"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("result3=userAccessService.isGranted(Group.DTO, Action.DELETEABLE, clazzName);"); |
| _builder_4.newLine(); |
| _builder_4.append("\t\t"); |
| _builder_4.append("isGranted.put(grantKey,result3);"); |
| _builder_4.newLine(); |
| _builder_4.append("\t"); |
| _builder_4.append("}"); |
| _builder_4.newLine(); |
| _builder_4.append("}"); |
| _builder_4.newLine(); |
| _builder_4.append("return result1 && result2 && result3;"); |
| return _builder_4.toString(); |
| } else { |
| ActionType _actionType_6 = action.getActionType(); |
| DialogActionEnum _action_5 = ((ActionDialog) _actionType_6).getAction(); |
| boolean _equals_5 = Objects.equal(_action_5, DialogActionEnum.DIALOG_ACTION_CANCEL); |
| if (_equals_5) { |
| StringConcatenation _builder_5 = new StringConcatenation(); |
| _builder_5.append("IE4Dialog dialog = eclipseContext.get(IE4Dialog.class);"); |
| _builder_5.newLine(); |
| _builder_5.append("if (dialog == null) {"); |
| _builder_5.newLine(); |
| _builder_5.append("\t"); |
| _builder_5.append("return false;"); |
| _builder_5.newLine(); |
| _builder_5.append("}"); |
| _builder_5.newLine(); |
| _builder_5.append("boolean result = (boolean) ContextInjectionFactory.invoke(dialog, IsDirty.class, eclipseContext);"); |
| _builder_5.newLine(); |
| _builder_5.append("return result;"); |
| return _builder_5.toString(); |
| } else { |
| StringConcatenation _builder_6 = new StringConcatenation(); |
| _builder_6.append("return true;"); |
| return _builder_6.toString(); |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionFunction) { |
| _matched=true; |
| ActionType _actionType_1 = action.getActionType(); |
| EObject _eContainer = ((ActionFunction) _actionType_1).getActionGroup().eContainer(); |
| FunctionLibraryPackage pkg = ((FunctionLibraryPackage) _eContainer); |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("return "); |
| String _string = this._iQualifiedNameProvider.getFullyQualifiedName(pkg).toString(); |
| _builder.append(_string); |
| _builder.append("."); |
| ActionType _actionType_2 = action.getActionType(); |
| String _firstUpper = StringExtensions.toFirstUpper(((ActionFunction) _actionType_2).getActionGroup().getName().toString()); |
| _builder.append(_firstUpper); |
| _builder.append("."); |
| ActionType _actionType_3 = action.getActionType(); |
| String _string_1 = ((ActionFunction) _actionType_3).getCanExecute().getName().toString(); |
| _builder.append(_string_1); |
| _builder.append("(eclipseContext);"); |
| return _builder.toString(); |
| } |
| } |
| if (!_matched) { |
| if (_actionType instanceof ActionDatainterchange) { |
| _matched=true; |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("return "); |
| { |
| ActionType _actionType_1 = action.getActionType(); |
| if ((_actionType_1 instanceof ActionDatainterchange)) { |
| _builder.append("(dataInterchange!=null)"); |
| } else { |
| _builder.append("true"); |
| } |
| } |
| _builder.append(";"); |
| return _builder.toString(); |
| } |
| } |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("return true;"); |
| return _builder.toString(); |
| } |
| |
| public boolean hasFilter(final ActionDatainterchange actioninterchange) { |
| if ((((((actioninterchange != null) && actioninterchange.isHasfilter()) && (actioninterchange.getDataRef() != null)) && (actioninterchange.getDataRef().getActionFilter() != null)) && ((actioninterchange.getDataRef().getActionFilter().getAttrFilter() != null) || (actioninterchange.getDataRef().getActionFilter().getRefFilter() != null)))) { |
| return true; |
| } |
| return false; |
| } |
| |
| public void infer(final EObject pkg, final IJvmDeclaredTypeAcceptor acceptor, final boolean isPreIndexingPhase) { |
| if (pkg instanceof ActionPackage) { |
| _infer((ActionPackage)pkg, acceptor, isPreIndexingPhase); |
| return; |
| } else if (pkg != null) { |
| _infer(pkg, acceptor, isPreIndexingPhase); |
| return; |
| } else { |
| throw new IllegalArgumentException("Unhandled parameter types: " + |
| Arrays.<Object>asList(pkg, acceptor, isPreIndexingPhase).toString()); |
| } |
| } |
| } |