Search in sources :

Example 6 with QueryService

use of org.osate.ge.services.QueryService in project osate2 by osate.

the class ErrorTypeExtensionHandler method getGraphicalConfiguration.

@Override
public Optional<GraphicalConfiguration> getGraphicalConfiguration(final GetGraphicalConfigurationContext ctx) {
    final BusinessObjectContext boc = ctx.getBusinessObjectContext();
    final QueryService queryService = ctx.getQueryService();
    final BusinessObjectContext destination = getDestination(boc, queryService);
    if (destination == null) {
        return Optional.of(GraphicalConfigurationBuilder.create().graphic(LABEL_GRAPHIC).build());
    } else {
        return Optional.of(GraphicalConfigurationBuilder.create().graphic(CONNECTION_GRAPHIC).style(STYLE).source(boc.getParent()).destination(destination).build());
    }
}
Also used : QueryService(org.osate.ge.services.QueryService) BusinessObjectContext(org.osate.ge.BusinessObjectContext)

Example 7 with QueryService

use of org.osate.ge.services.QueryService in project osate2 by osate.

the class TransitionBranchHandler method getGraphicalConfiguration.

@Override
public Optional<GraphicalConfiguration> getGraphicalConfiguration(final GetGraphicalConfigurationContext ctx) {
    final BusinessObjectContext boc = ctx.getBusinessObjectContext();
    final QueryService queryService = ctx.getQueryService();
    return Optional.of(GraphicalConfigurationBuilder.create().graphic(ErrorModelGeUtil.TRANSITION_CONNECTION_GRAPHIC).source(getSource(boc, queryService)).destination(getDestination(boc, queryService)).build());
}
Also used : QueryService(org.osate.ge.services.QueryService) BusinessObjectContext(org.osate.ge.BusinessObjectContext)

Example 8 with QueryService

use of org.osate.ge.services.QueryService in project osate2 by osate.

the class ErrorBehaviorTransitionHandler method getGraphicalConfiguration.

@Override
public Optional<GraphicalConfiguration> getGraphicalConfiguration(final GetGraphicalConfigurationContext ctx) {
    final BusinessObjectContext boc = ctx.getBusinessObjectContext();
    final ErrorBehaviorTransition transition = boc.getBusinessObject(ErrorBehaviorTransition.class).get();
    final QueryService queryService = ctx.getQueryService();
    if (transition.getDestinationBranches().isEmpty()) {
        return Optional.of(GraphicalConfigurationBuilder.create().graphic(ErrorModelGeUtil.TRANSITION_CONNECTION_GRAPHIC).source(getSource(boc, queryService)).destination(getDestination(boc, queryService)).build());
    } else {
        return Optional.of(GraphicalConfigurationBuilder.create().graphic(BRANCH_POINT_GRAPHIC).style(BRANCH_POINT_STYLE).build());
    }
}
Also used : ErrorBehaviorTransition(org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorTransition) QueryService(org.osate.ge.services.QueryService) BusinessObjectContext(org.osate.ge.BusinessObjectContext)

Example 9 with QueryService

use of org.osate.ge.services.QueryService in project osate2 by osate.

the class SubprogramCallOrderHandler method getGraphicalConfiguration.

@Override
public Optional<GraphicalConfiguration> getGraphicalConfiguration(final GetGraphicalConfigurationContext ctx) {
    final BusinessObjectContext boc = ctx.getBusinessObjectContext();
    final QueryService queryService = ctx.getQueryService();
    return Optional.of(GraphicalConfigurationBuilder.create().graphic(getGraphicalRepresentation()).style(STYLE).source(getSource(boc, queryService)).destination(getDestination(boc, queryService)).build());
}
Also used : QueryService(org.osate.ge.services.QueryService) BusinessObjectContext(org.osate.ge.BusinessObjectContext)

Example 10 with QueryService

use of org.osate.ge.services.QueryService in project osate2 by osate.

the class BehaviorTransitionHandler method getGraphicalConfiguration.

@Override
public Optional<GraphicalConfiguration> getGraphicalConfiguration(final GetGraphicalConfigurationContext ctx) {
    final BusinessObjectContext boc = ctx.getBusinessObjectContext();
    final QueryService queryService = ctx.getQueryService();
    return Optional.of(GraphicalConfigurationBuilder.create().graphic(TRANSITION_CONNECTION_GRAPHIC).style(Style.EMPTY).source(getSource(boc, queryService)).destination(getDestination(boc, queryService)).build());
}
Also used : QueryService(org.osate.ge.services.QueryService) BusinessObjectContext(org.osate.ge.BusinessObjectContext)

Aggregations

QueryService (org.osate.ge.services.QueryService)18 BusinessObjectContext (org.osate.ge.BusinessObjectContext)16 Collectors (java.util.stream.Collectors)4 Subcomponent (org.osate.aadl2.Subcomponent)4 QueryResult (org.osate.ge.query.QueryResult)4 List (java.util.List)3 Optional (java.util.Optional)3 ExecutableQuery (org.osate.ge.query.ExecutableQuery)3 Objects (com.google.common.base.Objects)2 Collections (java.util.Collections)2 Stream (java.util.stream.Stream)2 ComboViewer (org.eclipse.jface.viewers.ComboViewer)2 LabelProvider (org.eclipse.jface.viewers.LabelProvider)2 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)2 Composite (org.eclipse.swt.widgets.Composite)2 Control (org.eclipse.swt.widgets.Control)2 IEditorPart (org.eclipse.ui.IEditorPart)2 ComponentClassifier (org.osate.aadl2.ComponentClassifier)2 ComponentImplementation (org.osate.aadl2.ComponentImplementation)2 Element (org.osate.aadl2.Element)2