Search in sources :

Example 1 with NewClientWizard

use of name.abuchen.portfolio.ui.wizards.client.NewClientWizard in project portfolio by buchen.

the class NewFileHandler method execute.

@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell, // 
@Optional @Named(IServiceConstants.ACTIVE_PART) MPart activePart, MApplication app, EPartService partService, EModelService modelService) {
    NewClientWizard wizard = new NewClientWizard();
    WizardDialog dialog = new WizardDialog(shell, wizard);
    if (dialog.open() == Window.OK) {
        MPart part = partService.createPart(UIConstants.Part.PORTFOLIO);
        part.setLabel(Messages.LabelUnnamedXml);
        part.getTransientData().put(Client.class.getName(), wizard.getClient());
        if (activePart != null)
            activePart.getParent().getChildren().add(part);
        else
            ((MPartStack) modelService.find(UIConstants.PartStack.MAIN, app)).getChildren().add(part);
        part.setVisible(true);
        part.getParent().setVisible(true);
        partService.showPart(part, PartState.ACTIVATE);
    }
}
Also used : NewClientWizard(name.abuchen.portfolio.ui.wizards.client.NewClientWizard) MPart(org.eclipse.e4.ui.model.application.ui.basic.MPart) MPartStack(org.eclipse.e4.ui.model.application.ui.basic.MPartStack) Client(name.abuchen.portfolio.model.Client) WizardDialog(org.eclipse.jface.wizard.WizardDialog) Execute(org.eclipse.e4.core.di.annotations.Execute)

Aggregations

Client (name.abuchen.portfolio.model.Client)1 NewClientWizard (name.abuchen.portfolio.ui.wizards.client.NewClientWizard)1 Execute (org.eclipse.e4.core.di.annotations.Execute)1 MPart (org.eclipse.e4.ui.model.application.ui.basic.MPart)1 MPartStack (org.eclipse.e4.ui.model.application.ui.basic.MPartStack)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1