Search in sources :

Example 6 with IImportAsModelDialogFactory

use of org.whole.lang.ui.dialogs.IImportAsModelDialogFactory in project whole by wholeplatform.

the class ChangeValueDialogFactory method createDialog.

public Dialog createDialog(Shell shell, String title, String message, Assignments assignments, IBindingManager bindings) {
    Assign assign = (Assign) assignments.wGet(0);
    Expression expression = assign.getExpression();
    IEntity entity = BehaviorUtils.evaluate(expression, 0, bindings);
    assign.wSet(expression, entity);
    IEclipseContext params = EclipseContextFactory.create();
    params.set("dialogTitle", title);
    params.set("dialogMessage", message);
    params.set("dialogEntity", entity);
    IEclipseContext context = (IEclipseContext) bindings.wGetValue("eclipse#eclipseContext");
    IImportAsModelDialogFactory factory = ContextInjectionFactory.make(DisabledImportAsModelDialogFactory.class, context);
    params.set(IImportAsModelDialogFactory.class, factory);
    return ContextInjectionFactory.make(ChangeValueDialog.class, context, params);
}
Also used : Expression(org.whole.lang.workflows.model.Expression) IEntity(org.whole.lang.model.IEntity) IEclipseContext(org.eclipse.e4.core.contexts.IEclipseContext) IImportAsModelDialogFactory(org.whole.lang.ui.dialogs.IImportAsModelDialogFactory) Assign(org.whole.lang.workflows.model.Assign)

Example 7 with IImportAsModelDialogFactory

use of org.whole.lang.ui.dialogs.IImportAsModelDialogFactory in project whole by wholeplatform.

the class ImportAsModelDialogFactoryAddon method initialize.

@PostConstruct
protected void initialize() throws CoreException {
    IImportAsModelDialogFactory factory = ContextInjectionFactory.make(DisabledImportAsModelDialogFactory.class, context);
    context.set(IImportAsModelDialogFactory.class, factory);
}
Also used : IImportAsModelDialogFactory(org.whole.lang.ui.dialogs.IImportAsModelDialogFactory) PostConstruct(javax.annotation.PostConstruct)

Aggregations

IImportAsModelDialogFactory (org.whole.lang.ui.dialogs.IImportAsModelDialogFactory)7 IEclipseContext (org.eclipse.e4.core.contexts.IEclipseContext)4 MPart (org.eclipse.e4.ui.model.application.ui.basic.MPart)2 RedoAction (org.whole.lang.e4.ui.actions.RedoAction)2 UndoAction (org.whole.lang.e4.ui.actions.UndoAction)2 IEntityPartViewer (org.whole.lang.ui.viewers.IEntityPartViewer)2 PostConstruct (javax.annotation.PostConstruct)1 IResourceChangeListener (org.eclipse.core.resources.IResourceChangeListener)1 IWorkspace (org.eclipse.core.resources.IWorkspace)1 ContextMenuProvider (org.eclipse.gef.ContextMenuProvider)1 CommandStackEvent (org.eclipse.gef.commands.CommandStackEvent)1 CommandStackEventListener (org.eclipse.gef.commands.CommandStackEventListener)1 IContributionItem (org.eclipse.jface.action.IContributionItem)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 FocusEvent (org.eclipse.swt.events.FocusEvent)1 FocusListener (org.eclipse.swt.events.FocusListener)1 GridData (org.eclipse.swt.layout.GridData)1 IFileEditorInput (org.eclipse.ui.IFileEditorInput)1