Search in sources :

Example 1 with AbstractE4Part

use of org.whole.lang.e4.ui.parts.AbstractE4Part in project whole by wholeplatform.

the class RevertHandler method execute.

@Execute
public void execute(EPartService partService, IModelInput modelInput, @Named(IServiceConstants.ACTIVE_SELECTION) IBindingManager bm) {
    if (E4Utils.isLegacyApplication()) {
        IEntityPartViewer viewer = (IEntityPartViewer) bm.wGetValue("viewer");
        viewer.setContents((IModelInput) bm.wGetValue("modelInput"), null);
    } else {
        AbstractE4Part part = (AbstractE4Part) partService.getActivePart().getObject();
        part.getViewer().setContents(modelInput, null);
    }
}
Also used : AbstractE4Part(org.whole.lang.e4.ui.parts.AbstractE4Part) IEntityPartViewer(org.whole.lang.ui.viewers.IEntityPartViewer) Execute(org.eclipse.e4.core.di.annotations.Execute)

Example 2 with AbstractE4Part

use of org.whole.lang.e4.ui.parts.AbstractE4Part in project whole by wholeplatform.

the class SaveHandler method execute.

@Execute
public void execute(IEclipseContext context, EPartService partService) {
    IEclipseContext saveContext = context.createChild();
    AbstractE4Part part = (AbstractE4Part) partService.getActivePart().getObject();
    ContextInjectionFactory.invoke(part, Persist.class, saveContext);
    saveContext.dispose();
}
Also used : AbstractE4Part(org.whole.lang.e4.ui.parts.AbstractE4Part) IEclipseContext(org.eclipse.e4.core.contexts.IEclipseContext) CanExecute(org.eclipse.e4.core.di.annotations.CanExecute) Execute(org.eclipse.e4.core.di.annotations.Execute)

Aggregations

Execute (org.eclipse.e4.core.di.annotations.Execute)2 AbstractE4Part (org.whole.lang.e4.ui.parts.AbstractE4Part)2 IEclipseContext (org.eclipse.e4.core.contexts.IEclipseContext)1 CanExecute (org.eclipse.e4.core.di.annotations.CanExecute)1 IEntityPartViewer (org.whole.lang.ui.viewers.IEntityPartViewer)1