Search in sources :

Example 1 with SuspensionFeedbackEditPolicy

use of org.whole.lang.ui.editpolicies.SuspensionFeedbackEditPolicy in project whole by wholeplatform.

the class E4DebugGraphicalPart method updateUI.

protected void updateUI() {
    updateActions();
    IEventBroker eventBroker = context.get(IEventBroker.class);
    ExecutionState execution = executions.peek();
    if (execution != null) {
        final IEntity sourceEntity = execution.getSourceEntity();
        IEntity contents = EntityUtils.getCompoundRoot(sourceEntity);
        getViewer().setContents(contents);
        getViewer().setInteractive(contents, false, true, false);
        context.get(UISynchronize.class).asyncExec(new Runnable() {

            @Override
            public void run() {
                IEntity adaptee = sourceEntity.wGetAdaptee(false);
                IEntityPart sourceEntityPart = getViewer().getEditPartRegistry().get(adaptee);
                sourceEntityPart.installEditPolicy(SuspensionFeedbackEditPolicy.SUSPENSION_FEEDBACK_ROLE, new SuspensionFeedbackEditPolicy(getSuspensionKind(), execution.getThrowable()));
                getViewer().reveal(sourceEntity);
            }
        });
        eventBroker.post(IE4UIConstants.TOPIC_UPDATE_VARIABLES, execution.getVariablesModel());
    } else {
        getViewer().setEntityContents(createDefaultContents());
        eventBroker.post(IE4UIConstants.TOPIC_UPDATE_VARIABLES, null);
    }
}
Also used : ExecutionState(org.whole.lang.e4.ui.jobs.ExecutionState) IEntity(org.whole.lang.model.IEntity) SuspensionFeedbackEditPolicy(org.whole.lang.ui.editpolicies.SuspensionFeedbackEditPolicy) IEventBroker(org.eclipse.e4.core.services.events.IEventBroker) UISynchronize(org.eclipse.e4.ui.di.UISynchronize) IEntityPart(org.whole.lang.ui.editparts.IEntityPart)

Aggregations

IEventBroker (org.eclipse.e4.core.services.events.IEventBroker)1 UISynchronize (org.eclipse.e4.ui.di.UISynchronize)1 ExecutionState (org.whole.lang.e4.ui.jobs.ExecutionState)1 IEntity (org.whole.lang.model.IEntity)1 IEntityPart (org.whole.lang.ui.editparts.IEntityPart)1 SuspensionFeedbackEditPolicy (org.whole.lang.ui.editpolicies.SuspensionFeedbackEditPolicy)1