Search in sources :

Example 61 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project cubrid-manager by CUBRID.

the class SetMasterDbInfoWizard method addPages.

/**
	 * Add wizard pages
	 */
public void addPages() {
    selectDatabasePage = new SelectDatabasePage(master);
    selectDatabasePage.setEditable(isEditable);
    addPage(selectDatabasePage);
    selectClassesPage = new SelectTablesPage(master);
    selectClassesPage.setEditable(isEditable);
    addPage(selectClassesPage);
    WizardDialog dialog = (WizardDialog) getContainer();
    dialog.addPageChangedListener(selectClassesPage);
}
Also used : WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 62 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project cubrid-manager by CUBRID.

the class AddHostAndDbWizard method addPages.

/**
	 * Add wizard pages
	 */
public void addPages() {
    WizardDialog dialog = (WizardDialog) getContainer();
    if (addedType == 0 || selectedHostNode == null || selectedHostNode.getServerInfo() == null) {
        setHostInfoPage = new SetHostInfoPage(selectedHostNode, addedHostNodeList, allHostNodeList);
        addPage(setHostInfoPage);
    }
    ServerType serverType = selectedHostNode == null || selectedHostNode.getServerInfo() == null ? null : selectedHostNode.getServerInfo().getServerType();
    if (addedType == 0 || addedType == 1) {
        selectDbPage = new SelectDbPage();
        selectDbPage.setServerType(serverType);
        addPage(selectDbPage);
        dialog.addPageChangedListener(selectDbPage);
    }
    if (addedType == 0 || addedType == 2) {
        selectBrokerPage = new SelectBrokerPage();
        selectBrokerPage.setServerType(serverType);
        addPage(selectBrokerPage);
        dialog.addPageChangedListener(selectBrokerPage);
    }
}
Also used : ServerType(com.cubrid.cubridmanager.core.common.model.ServerType) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 63 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.

the class CreateDiagramAction method doRun.

@Override
protected void doRun() {
    SimpleBusinessCreationWizard wizard = new SimpleBusinessCreationWizard(getActivePage().getWorkbenchWindow().getWorkbench(), getPath());
    WizardDialog wizardDialog = new WizardDialog(new Shell(), wizard);
    wizardDialog.create();
    wizardDialog.open();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 64 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.

the class CreateProcess method doRun.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
protected void doRun() {
    final NewProcessWizard processWizard;
    if (isToolbar()) {
        processWizard = new NewProcessWizard(null);
    } else {
        ISelection selection = getSelection();
        if (selection == null) {
            return;
        }
        Object obj = ((IStructuredSelection) selection).getFirstElement();
        IRepositoryService service = DesignerPlugin.getDefault().getRepositoryService();
        IPath path = service.getRepositoryPath((IRepositoryNode) obj);
        if (RepositoryConstants.isSystemFolder(path.toString())) {
            // Not allowed to create in system folder.
            return;
        }
        processWizard = new NewProcessWizard(path);
    }
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), processWizard);
    if (dlg.open() == Window.OK) {
        if (processWizard.getProcess() == null) {
            return;
        }
        ProcessEditorInput fileEditorInput;
        try {
            // Set readonly to false since created job will always be editable.
            fileEditorInput = new ProcessEditorInput(processWizard.getProcess(), false, true, false);
            IRepositoryNode repositoryNode = RepositorySeekerManager.getInstance().searchRepoViewNode(fileEditorInput.getItem().getProperty().getId(), false);
            fileEditorInput.setRepositoryNode(repositoryNode);
            IWorkbenchPage page = getActivePage();
            page.openEditor(fileEditorInput, MultiPageTalendEditor.ID, true);
        // // use project setting true
        // ProjectSettingManager.defaultUseProjectSetting(fileEditorInput.getLoadedProcess());
        } catch (PartInitException e) {
            // TODO Auto-generated catch block
            ExceptionHandler.process(e);
        } catch (PersistenceException e) {
            MessageBoxExceptionHandler.process(e);
        }
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) IRepositoryNode(org.talend.repository.model.IRepositoryNode) NewProcessWizard(org.talend.designer.core.ui.wizards.NewProcessWizard) ISelection(org.eclipse.jface.viewers.ISelection) PersistenceException(org.talend.commons.exception.PersistenceException) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PartInitException(org.eclipse.ui.PartInitException) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IRepositoryService(org.talend.repository.model.IRepositoryService) ProcessEditorInput(org.talend.designer.core.ui.editor.ProcessEditorInput)

Example 65 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.

the class SaveAsProcessAction method run.

@Override
public void run() {
    SaveAsProcessWizard processWizard = new SaveAsProcessWizard(editorPart);
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), processWizard);
    if (dlg.open() == Window.OK) {
        try {
            // Set readonly to false since created job will always be editable.
            JobEditorInput newJobEditorInput = new ProcessEditorInput(processWizard.getProcess(), true, true, false);
            IWorkbenchPage page = getActivePage();
            IRepositoryNode repositoryNode = RepositoryNodeUtilities.getRepositoryNode(newJobEditorInput.getItem().getProperty().getId(), false);
            newJobEditorInput.setRepositoryNode(repositoryNode);
            // close the old editor
            page.closeEditor(((AbstractTalendEditor) this.editorPart).getParent(), false);
            // open the new editor, because at the same time, there will update the jobSetting/componentSetting view
            page.openEditor(newJobEditorInput, MultiPageTalendEditor.ID, true);
        } catch (Exception e) {
            MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Job could not be saved" + " : " + e.getMessage());
            ExceptionHandler.process(e);
        }
    }
}
Also used : JobEditorInput(org.talend.core.ui.editor.JobEditorInput) IRepositoryNode(org.talend.repository.model.IRepositoryNode) SaveAsProcessWizard(org.talend.designer.core.ui.wizards.SaveAsProcessWizard) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ProcessEditorInput(org.talend.designer.core.ui.editor.ProcessEditorInput)

Aggregations

WizardDialog (org.eclipse.jface.wizard.WizardDialog)115 ISelection (org.eclipse.jface.viewers.ISelection)26 Shell (org.eclipse.swt.widgets.Shell)26 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)25 IWorkbench (org.eclipse.ui.IWorkbench)14 IRepositoryNode (org.talend.repository.model.IRepositoryNode)13 RepositoryNode (org.talend.repository.model.RepositoryNode)13 IPath (org.eclipse.core.runtime.IPath)12 IStatus (org.eclipse.core.runtime.IStatus)10 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)10 IFile (org.eclipse.core.resources.IFile)9 Status (org.eclipse.core.runtime.Status)7 PartInitException (org.eclipse.ui.PartInitException)7 ArrayList (java.util.ArrayList)6 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)6 Composite (org.eclipse.swt.widgets.Composite)6 CoreException (org.eclipse.core.runtime.CoreException)5 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)5 File (java.io.File)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)4