Search in sources :

Example 1 with NewProcessWizard

use of org.talend.mdm.repository.ui.wizards.process.NewProcessWizard in project tmdm-studio-se by Talend.

the class NewProcessAction method doRun.

@Override
protected void doRun() {
    parentItem = null;
    selectObj = getSelectedObject().get(0);
    int type = getType();
    if (selectObj instanceof IRepositoryViewObject) {
        Item pItem = ((IRepositoryViewObject) selectObj).getProperty().getItem();
        if (pItem instanceof ContainerItem) {
            parentItem = (ContainerItem) pItem;
        }
    }
    IWorkbenchPartSite site = commonViewer.getCommonNavigator().getSite();
    // wizard
    NewProcessWizard newProcessWizard = new NewProcessWizard(site, type);
    WizardDialog wizardDialog = new WizardDialog(getShell(), newProcessWizard);
    wizardDialog.setPageSize(500, 260);
    if (wizardDialog.open() == IDialogConstants.OK_ID) {
        WSTransformerV2E newProcess = newProcessWizard.getNewProcess();
        final Item item = createServerObject(newProcess);
        commonViewer.refresh(selectObj);
        commonViewer.expandToLevel(selectObj, 1);
        openEditor(item);
        if (newProcessWizard.isCreateJob()) {
            generateJobTemplate(newProcessWizard.getType(), newProcessWizard.getProcessName(), newProcessWizard.getReturnMessages(), newProcessWizard.isEnableRedirect(), newProcessWizard.getRedirectUrl(), newProcessWizard.getJobTemplates());
            refreshJobEditorTitle(item);
        }
    }
}
Also used : IWorkbenchPartSite(org.eclipse.ui.IWorkbenchPartSite) WSTransformerV2Item(org.talend.mdm.repository.model.mdmproperties.WSTransformerV2Item) ProcessItem(org.talend.core.model.properties.ProcessItem) Item(org.talend.core.model.properties.Item) ContainerItem(org.talend.mdm.repository.model.mdmproperties.ContainerItem) ContainerItem(org.talend.mdm.repository.model.mdmproperties.ContainerItem) WSTransformerV2E(org.talend.mdm.repository.model.mdmserverobject.WSTransformerV2E) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) NewProcessWizard(org.talend.mdm.repository.ui.wizards.process.NewProcessWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 IWorkbenchPartSite (org.eclipse.ui.IWorkbenchPartSite)1 Item (org.talend.core.model.properties.Item)1 ProcessItem (org.talend.core.model.properties.ProcessItem)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 ContainerItem (org.talend.mdm.repository.model.mdmproperties.ContainerItem)1 WSTransformerV2Item (org.talend.mdm.repository.model.mdmproperties.WSTransformerV2Item)1 WSTransformerV2E (org.talend.mdm.repository.model.mdmserverobject.WSTransformerV2E)1 NewProcessWizard (org.talend.mdm.repository.ui.wizards.process.NewProcessWizard)1