Search in sources :

Example 11 with WizardDialog

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

the class OpenCamelExistVersionProcessAction method doRun.

@Override
protected void doRun() {
    ISelection selection = getSelection();
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    IRepositoryNode node = (IRepositoryNode) obj;
    IPath path = RepositoryNodeUtilities.getPath(node);
    String originalName = node.getObject().getLabel();
    RepositoryObject repositoryObj = new RepositoryObject(node.getObject().getProperty());
    repositoryObj.setRepositoryNode(node.getObject().getRepositoryNode());
    OpenCamelExistVersionProcessWizard wizard = new OpenCamelExistVersionProcessWizard(repositoryObj);
    WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
    dialog.setHelpAvailable(false);
    dialog.setPageSize(300, 250);
    //$NON-NLS-1$
    dialog.setTitle(Messages.getString("OpenExistVersionProcess.open.dialog"));
    if (dialog.open() == Dialog.OK) {
        refresh(node);
        // refresh the corresponding editor's name
        IEditorPart part = getCorrespondingEditor(node);
        if (part != null && part instanceof IUIRefresher) {
            ((IUIRefresher) part).refreshName();
        } else {
            processRoutineRenameOperation(originalName, node, path);
        }
    }
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) IPath(org.eclipse.core.runtime.IPath) RepositoryObject(org.talend.core.model.repository.RepositoryObject) ISelection(org.eclipse.jface.viewers.ISelection) RepositoryObject(org.talend.core.model.repository.RepositoryObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IEditorPart(org.eclipse.ui.IEditorPart) OpenCamelExistVersionProcessWizard(org.talend.camel.designer.ui.wizards.OpenCamelExistVersionProcessWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IUIRefresher(org.talend.core.services.IUIRefresher)

Example 12 with WizardDialog

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

the class RunContainerPreferencePage method createPageContents.

/**
     * Create contents of the preference page.
     * 
     * @param parent
     */
@Override
public Control createPageContents(Composite parent) {
    serverFieldEditors = new ArrayList<FieldEditor>();
    optionFieldEditors = new ArrayList<FieldEditor>();
    runtimeEnable = getPreferenceStore().getBoolean(RunContainerPreferenceInitializer.P_ESB_IN_OSGI);
    GridLayout gridLayoutDefault = new GridLayout(1, false);
    Composite body = new Composite(parent, SWT.NONE);
    body.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    body.setLayout(gridLayoutDefault);
    getPreferenceStore().getBoolean(RunContainerPreferenceInitializer.P_ESB_IN_OSGI);
    useOSGiEditor = new BooleanFieldEditor(RunContainerPreferenceInitializer.P_ESB_IN_OSGI, "ESB Studio Runtime - Use Local Talend Runtime (OSGi Container)", body);
    addField(useOSGiEditor);
    Label lblNote = new Label(body, SWT.WRAP);
    lblNote.setText("Note: It will be only taken into account for an ESB Artifact:\n" + "  · A Route (Any Route)\n" + "  · A DataService (SOAP/REST)\n" + "  · A Job contains tRESTClient or tESBConsumer component");
    Group groupServer = new Group(body, SWT.NONE);
    //$NON-NLS-1$
    groupServer.setText(RunContainerMessages.getString("RunContainerPreferencePage.Group1"));
    groupServer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    groupServer.setLayout(new GridLayout(2, false));
    compositeServerBody = new Composite(groupServer, SWT.BORDER);
    compositeServerBody.setLayout(gridLayoutDefault);
    compositeServerBody.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    StringFieldEditor locationEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_LOCATION, RunContainerMessages.getString("RunContainerPreferencePage.Location"), //$NON-NLS-1$
    compositeServerBody);
    addField(locationEditor);
    serverFieldEditors.add(locationEditor);
    StringFieldEditor hostFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_HOST, RunContainerMessages.getString("RunContainerPreferencePage.Host"), compositeServerBody);
    addField(hostFieldEditor);
    // only support local runtime server, if need support remote server ,enable this editor
    hostFieldEditor.setEnabled(false, compositeServerBody);
    StringFieldEditor userFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_USERNAME, RunContainerMessages.getString("RunContainerPreferencePage.Username"), //$NON-NLS-1$
    compositeServerBody);
    addField(userFieldEditor);
    serverFieldEditors.add(userFieldEditor);
    StringFieldEditor passwordFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_PASSWORD, RunContainerMessages.getString("RunContainerPreferencePage.Password"), //$NON-NLS-1$
    compositeServerBody);
    addField(passwordFieldEditor);
    serverFieldEditors.add(passwordFieldEditor);
    StringFieldEditor instanceFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_INSTANCE, RunContainerMessages.getString("RunContainerPreferencePage.Instance"), //$NON-NLS-1$
    compositeServerBody);
    addField(instanceFieldEditor);
    serverFieldEditors.add(instanceFieldEditor);
    IntegerFieldEditor portFieldEditor = new IntegerFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_PORT, RunContainerMessages.getString("RunContainerPreferencePage.Port"), //$NON-NLS-1$
    compositeServerBody);
    addField(portFieldEditor);
    serverFieldEditors.add(portFieldEditor);
    StringFieldEditor jmxPortFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_JMX_PORT, RunContainerMessages.getString("RunContainerPreferencePage.JMXPort"), //$NON-NLS-1$
    compositeServerBody);
    addField(jmxPortFieldEditor);
    serverFieldEditors.add(jmxPortFieldEditor);
    Composite compBtn = new Composite(groupServer, SWT.NONE);
    GridData gridDataBtn = new GridData(SWT.LEFT, SWT.FILL, false, true, 1, 1);
    gridDataBtn.widthHint = 100;
    compBtn.setLayoutData(gridDataBtn);
    GridLayout layoutCompBtn = new GridLayout(1, false);
    layoutCompBtn.marginWidth = 0;
    layoutCompBtn.marginHeight = 0;
    compBtn.setLayout(layoutCompBtn);
    buttonAddServer = new Button(compBtn, SWT.NONE);
    buttonAddServer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    buttonAddServer.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            AddRuntimeWizard dirWizard = new AddRuntimeWizard(locationEditor.getStringValue());
            dirWizard.setNeedsProgressMonitor(true);
            WizardDialog wizardDialog = new WizardDialog(getShell(), dirWizard);
            if (wizardDialog.open() == Window.OK) {
                locationEditor.setStringValue(dirWizard.getTarget());
            }
        }
    });
    //$NON-NLS-1$
    buttonAddServer.setText(RunContainerMessages.getString("RunContainerPreferencePage.ServerButton"));
    // Button btnTestConnection = new Button(compBtn, SWT.NONE);
    // btnTestConnection.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    // btnTestConnection.setText("Server Info...");
    buttonInitalizeServer = new Button(compBtn, SWT.NONE);
    buttonInitalizeServer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    //$NON-NLS-1$
    buttonInitalizeServer.setText(RunContainerMessages.getString("RunContainerPreferencePage.InitalizeButton"));
    buttonInitalizeServer.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (initalizeRuntime(locationEditor.getStringValue(), hostFieldEditor.getStringValue())) {
                try {
                    new InitFinishMessageDialog(getShell(), JMXUtil.getBundlesName()).open();
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            }
        }
    });
    Group groupOption = new Group(body, SWT.NONE);
    groupOption.setLayout(gridLayoutDefault);
    groupOption.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    //$NON-NLS-1$
    groupOption.setText(RunContainerMessages.getString("RunContainerPreferencePage.Group2"));
    compositeOptionBody = new Composite(groupOption, SWT.NONE);
    compositeOptionBody.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    BooleanFieldEditor filterLogEditor = new BooleanFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_SYS_LOG, RunContainerMessages.getString("RunContainerPreferencePage.FilterLogs"), //$NON-NLS-1$
    compositeOptionBody);
    addField(filterLogEditor);
    optionFieldEditors.add(filterLogEditor);
    manager = ProcessManager.getInstance();
    return body;
}
Also used : IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) FieldEditor(org.eclipse.jface.preference.FieldEditor) StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) InitFinishMessageDialog(org.talend.designer.esb.runcontainer.ui.dialog.InitFinishMessageDialog) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) InvocationTargetException(java.lang.reflect.InvocationTargetException) IOException(java.io.IOException) StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) AddRuntimeWizard(org.talend.designer.esb.runcontainer.ui.wizard.AddRuntimeWizard) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 13 with WizardDialog

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

the class PublishOnSpagoAction method doRun.

protected void doRun() {
    PublishOnSpagoExportWizard publishWizard = new PublishOnSpagoExportWizard();
    IWorkbench workbench = getWorkbench();
    //$NON-NLS-1$
    publishWizard.setWindowTitle(EXPORTJOBSCRIPTS + " (SpagoBI)");
    publishWizard.init(workbench, (IStructuredSelection) this.getSelection());
    Shell activeShell = Display.getCurrent().getActiveShell();
    WizardDialog dialog = new WizardDialog(activeShell, publishWizard);
    dialog.open();
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Shell(org.eclipse.swt.widgets.Shell) PublishOnSpagoExportWizard(org.talend.sbi.engines.client.ui.wizards.PublishOnSpagoExportWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 14 with WizardDialog

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

the class CreateESBAction method doRun.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
protected void doRun() {
    RepositoryNode beanNode = getCurrentRepositoryNode();
    if (isToolbar()) {
        if (beanNode != null && beanNode.getContentType() != ESBRepositoryNodeType.SERVICES) {
            beanNode = null;
        }
        if (beanNode == null) {
            beanNode = getRepositoryNodeForDefault(ESBRepositoryNodeType.SERVICES);
        }
    }
    ISelection selection;
    IWorkbenchPage activePage = getActivePage();
    if (activePage == null) {
        selection = getSelection();
    } else {
        selection = getRepositorySelection();
    }
    if (selection.isEmpty()) {
        return;
    }
    ESBWizard beanWizard = new ESBWizard(PlatformUI.getWorkbench(), true, selection);
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), beanWizard);
    dlg.open();
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) ESBWizard(org.talend.repository.services.ui.ESBWizard) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 15 with WizardDialog

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

the class CreateNewJobAction method doRun.

@Override
protected void doRun() {
    RepositoryNode node = getSelectedRepositoryNode();
    if (node == null) {
        return;
    }
    NewProcessWizard processWizard = getNewProcessWizard(node);
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), processWizard);
    if (dlg.open() == Window.OK) {
        createNewProcess(node, processWizard.getProcess());
    }
}
Also used : NewProcessWizard(org.talend.designer.core.ui.wizards.NewProcessWizard) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

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