Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » List widget
List widget [message #1865727] Thu, 09 May 2024 19:49 Go to next message
Alex Oli is currently offline Alex OliFriend
Messages: 19
Registered: May 2024
Junior Member
Hello,

I have a Viewpoint Specification project and defined a group within the Properties View. Within this group, I've defined a List Widget (ActivityTypeList) which displays all the enums available via the getTriggerActivityTypes() method in the Services.java class. I also defined a Label Widget (SelectedActivityTypes) that displays the activityType the user selects when creating the EMF model using the getTriggerActivityTypes() method in the Services.java class. My problem is that when I select an activityType from the list and click on the 'Add activity type' action to update the label's activityType feature, this list element (var:selection) comes up as null. Both methods work with strings so there are no type incompatibilities.

Here is the Sirius Specification Editor:
<groups name="StandardEventTrigger" labelExpression="Properties" domainClass="gHA_metamodel::StandardEventTrigger" semanticCandidateExpression="var:self">
        <controls xsi:type="properties:LabelDescription" name="SelectedActivityTypes" labelExpression="Selected" valueExpression="service:getTriggerActivityTypes()"/>
        <controls xsi:type="properties:ListDescription" name="ActivityTypeList" labelExpression="activityType" valueExpression="service:getActivityTypes()" displayExpression="var:value">
          <actions labelExpression="Add activity type">
            <initialOperation>
              <firstModelOperations xsi:type="tool_1:SetValue" featureName="activityType" valueExpression="var:selection"/>
            </initialOperation>
          </actions>
        </controls>
      </groups>



Here is Services.java:
public class Services {

public List<String> getActivityTypes(StandardEventTrigger event) {
        List<String> eventTypes = new ArrayList<>();
        for (WEBHOOK_ACTIVITY_TYPES literal : WEBHOOK_ACTIVITY_TYPES.VALUES) {
        	eventTypes.add(literal.toString());
        }
        return eventTypes;
    }
	
	public List<String> getTriggerActivityTypes(StandardEventTrigger event) {
        List<String> eventTypes = new ArrayList<>();
        for (WEBHOOK_ACTIVITY_TYPES literal : event.getActivityType()) {
        	System.out.println("LITERAL: " + literal);
        	eventTypes.add(literal.toString());
        }
        return eventTypes;
    }
}

Re: List widget [message #1865730 is a reply to message #1865727] Thu, 09 May 2024 19:51 Go to previous message
Alex Oli is currently offline Alex OliFriend
Messages: 19
Registered: May 2024
Junior Member
Forgot to add,
This is the Console log. NOTE: "edited" is the value already set in the EMF


LITERAL: edited

!ENTRY org.eclipse.eef.core 4 0 2024-05-09 19:53:30.838
!MESSAGE An issue has occurred during the evaluation of 'aql:input.executeOperation(self, 'platform:/resource/GHA.design/description/GHA.odesign#//@extensions.0/@categories.0/@groups.4/@controls.2/@actions.0/@initialOperation')'.
executeOperation(org.eclipse.sirius.properties.core.api.SiriusInputDescriptor,org.eclipse.emf.ecore.EObject,java.lang.String) with arguments [org.eclipse.sirius.properties.core.api.SiriusInputDescriptor@1ee283be, gHA_metamodel.impl.StandardEventTriggerImpl@794ffe3 (activityType: [edited, null]) (event: branch_protection_rule), platform:/resource/GHA.design/description/GHA.odesign#//@extensions.0/@categories.0/@groups.4/@controls.2/@actions.0/@initialOperation] failed:
null

!STACK 0
org.eclipse.acceleo.query.runtime.AcceleoQueryEvaluationException: executeOperation(org.eclipse.sirius.properties.core.api.SiriusInputDescriptor,org.eclipse.emf.ecore.EObject,java.lang.String) with arguments [org.eclipse.sirius.properties.core.api.SiriusInputDescriptor@1ee283be, gHA_metamodel.impl.StandardEventTriggerImpl@794ffe3 (activityType: [edited, null]) (event: branch_protection_rule), platform:/resource/GHA.design/description/GHA.odesign#//@extensions.0/@categories.0/@groups.4/@controls.2/@actions.0/@initialOperation] failed:
null
at org.eclipse.acceleo.query.runtime.impl.AbstractService.invoke(AbstractService.java:147)
at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.callService(EvaluationServices.java:129)
at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.call(EvaluationServices.java:172)
at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.callOrApply(EvaluationServices.java:208)
at org.eclipse.acceleo.query.parser.AstEvaluator.caseCall(AstEvaluator.java:189)
at org.eclipse.acceleo.query.ast.util.AstSwitch.doSwitch(AstSwitch.java:119)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.eclipse.acceleo.query.parser.AstEvaluator.eval(AstEvaluator.java:109)
at org.eclipse.acceleo.query.runtime.impl.QueryEvaluationEngine.eval(QueryEvaluationEngine.java:52)
at org.eclipse.sirius.common.acceleo.aql.business.internal.AQLSiriusInterpreter.evaluateExpression(AQLSiriusInterpreter.java:218)
at org.eclipse.sirius.tools.internal.interpreter.SessionInterpreter.evaluateExpression(SessionInterpreter.java:161)
at org.eclipse.sirius.properties.core.api.SiriusInterpreter.evaluateExpression(SiriusInterpreter.java:65)
at org.eclipse.eef.core.api.utils.EvalFactory$Eval.call(EvalFactory.java:205)
at org.eclipse.eef.core.api.utils.EvalFactory$Eval.call(EvalFactory.java:182)
at org.eclipse.eef.core.internal.controllers.EEFListController.lambda$1(EEFListController.java:129)
at org.eclipse.sirius.ui.properties.internal.TransactionalEditingDomainContextAdapter$1.doExecute(TransactionalEditingDomainContextAdapter.java:120)
at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:130)
at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:114)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:145)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:496)
at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:203)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:160)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:214)
at org.eclipse.sirius.ui.properties.internal.TransactionalEditingDomainContextAdapter.performModelChange(TransactionalEditingDomainContextAdapter.java:126)
at org.eclipse.eef.core.internal.controllers.EEFListController.action(EEFListController.java:121)
at org.eclipse.eef.ide.ui.internal.widgets.EEFListLifecycleManager.lambda$2(EEFListLifecycleManager.java:236)
at org.eclipse.eef.common.ui.api.SWTUtils$1.widgetSelected(SWTUtils.java:54)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4273)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4071)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3659)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:648)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:555)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
at org.eclipse.equinox.launcher.Main.main(Main.java:1432)
Caused by: java.lang.ArrayStoreException
Previous Topic:Sirius Web installation
Next Topic:Too many tools and sections in Palette, make slow Node creation and search
Goto Forum:
  


Current Time: Tue Oct 15 23:19:17 GMT 2024

Powered by FUDForum. Page generated in 0.03957 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top