Search in sources :

Example 56 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project yamcs-studio by yamcs.

the class AddToStackHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    Shell shell = HandlerUtil.getActiveShellChecked(event);
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
    IWorkbenchPart part = window.getActivePage().findView(CommandStackView.ID);
    CommandStackView commandStackView = (CommandStackView) part;
    AddToStackWizard wizard = new AddToStackWizard();
    WizardDialog dialog = new WizardDialog(shell, wizard);
    if (dialog.open() == Window.OK)
        commandStackView.addTelecommand(wizard.getTelecommand());
    return null;
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) Shell(org.eclipse.swt.widgets.Shell) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 57 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project meclipse by flaper87.

the class MeclipseView method makeActions.

private void makeActions() {
    final MeclipseView mView = this;
    connection = new Action() {

        public void run() {
            ConnectionWizard wizard = new ConnectionWizard();
            Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
            WizardDialog dialog = new WizardDialog(shell, wizard);
            dialog.create();
            dialog.open();
            mView.refreshMe();
        }
    };
    connection.setText(getCaption("connection.new"));
    connection.setToolTipText(getCaption("connection.new"));
    connection.setImageDescriptor(Images.getDescriptor(Images.PageCommit));
    doubleClickAction = new Action() {

        public void run() {
            ISelection selection = viewer.getSelection();
            TreeObject obj = (TreeObject) ((IStructuredSelection) selection).getFirstElement();
            obj.doubleClickAction();
        }
    };
}
Also used : Action(org.eclipse.jface.action.Action) Shell(org.eclipse.swt.widgets.Shell) ConnectionWizard(org.mongodb.meclipse.wizards.ConnectionWizard) ISelection(org.eclipse.jface.viewers.ISelection) TreeObject(org.mongodb.meclipse.views.objects.TreeObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 58 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project meclipse by flaper87.

the class MeclipsePlugin method openWizard.

/**
	 * Stolen from
	 * http://torkildr.blogspot.com/2010/07/invoking-eclipse-wizard.html
	 * 
	 * @param id
	 */
public void openWizard(String id) {
    // First see if this is a "new wizard".
    IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(id);
    // If not check if it is an "import wizard".
    if (descriptor == null) {
        descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(id);
    }
    // Or maybe an export wizard
    if (descriptor == null) {
        descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(id);
    }
    try {
        // Then if we have a wizard, open it.
        if (descriptor != null) {
            IWizard wizard = descriptor.createWizard();
            WizardDialog wd = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard);
            wd.setTitle(wizard.getWindowTitle());
            wd.open();
        }
    } catch (CoreException e) {
        e.printStackTrace();
    }
}
Also used : IWizardDescriptor(org.eclipse.ui.wizards.IWizardDescriptor) CoreException(org.eclipse.core.runtime.CoreException) IWizard(org.eclipse.jface.wizard.IWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 59 with WizardDialog

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

the class ExportDataWizard method addPages.

/**
	 * Add wizard page
	 */
public void addPages() {
    exportTypePage = new ExportTypePage();
    addPage(exportTypePage);
    exportSettingPage = new ExportSettingPage();
    addPage(exportSettingPage);
    exportSettingForLoadDBPage = new ExportSettingForLoadDBPage();
    addPage(exportSettingForLoadDBPage);
    confirmPage = new ExportDataConfirmPage();
    addPage(confirmPage);
    setWindowTitle(Messages.exportShellTitle);
    WizardDialog dialog = (WizardDialog) getContainer();
    dialog.addPageChangedListener(exportTypePage);
    dialog.addPageChangedListener(exportSettingPage);
    dialog.addPageChangedListener(exportSettingForLoadDBPage);
    dialog.addPageChangedListener(confirmPage);
    dialog.addPageChangingListener(exportTypePage);
    dialog.addPageChangingListener(exportSettingPage);
    dialog.addPageChangingListener(exportSettingForLoadDBPage);
    dialog.addPageChangingListener(confirmPage);
}
Also used : WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 60 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project azure-tools-for-java by Microsoft.

the class CreateNewDockerHostAction method actionPerformed.

@Override
public void actionPerformed(NodeActionEvent event) {
    try {
        if (!SignInCommandHandler.doSignIn(PluginUtil.getParentShell()))
            return;
        IProject project;
        Shell shell = PluginUtil.getParentShell();
        try {
            project = AzureDockerUIResources.getCurrentSelectedProject();
        } catch (Exception Ignored) {
            project = null;
        }
        if (project == null) {
            project = (IProject) dockerHostModule.getProject();
        }
        AzureManager azureAuthManager = AuthMethodManager.getInstance().getAzureManager();
        // not signed in
        if (azureAuthManager == null) {
            return;
        }
        AzureDockerHostsManager dockerManager = AzureDockerHostsManager.getAzureDockerHostsManager(azureAuthManager);
        if (!dockerManager.isInitialized()) {
            AzureDockerUIResources.updateAzureResourcesWithProgressDialog(shell, project);
            if (AzureDockerUIResources.CANCELED) {
                return;
            }
            dockerManager = AzureDockerHostsManager.getAzureDockerHostsManagerEmpty(null);
        }
        if (dockerManager.getSubscriptionsMap().isEmpty()) {
            PluginUtil.displayErrorDialog(shell, "Create Docker Host", "Must select an Azure subscription first");
            return;
        }
        AzureNewDockerWizard newDockerWizard = new AzureNewDockerWizard(project, dockerManager);
        WizardDialog createNewDockerHostDialog = new AzureWizardDialog(shell, newDockerWizard);
        if (createNewDockerHostDialog.open() == Window.OK) {
            newDockerWizard.createHost();
        }
    } catch (Exception ex1) {
        log.log(Level.SEVERE, "actionPerformed", ex1);
        ex1.printStackTrace();
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) AzureWizardDialog(com.microsoft.azuretools.core.components.AzureWizardDialog) AzureManager(com.microsoft.azuretools.sdkmanage.AzureManager) AzureNewDockerWizard(com.microsoft.azuretools.docker.ui.wizards.createhost.AzureNewDockerWizard) AzureDockerHostsManager(com.microsoft.azure.docker.AzureDockerHostsManager) AzureWizardDialog(com.microsoft.azuretools.core.components.AzureWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IProject(org.eclipse.core.resources.IProject)

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