Java Code Examples for org.eclipse.jface.wizard.WizardDialog

The following are top voted examples for showing how to use org.eclipse.jface.wizard.WizardDialog. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: cft   File: ServiceToApplicationsBindingAction.java   View source code 7 votes vote down vote up
@Override
public void run() {
	UIJob uiJob = new UIJob(Messages.MANAGE_SERVICES_TO_APPLICATIONS_TITLE) {
		public IStatus runInUIThread(IProgressMonitor monitor) {
			try {
				if (serverBehaviour != null) {
					ServiceToApplicationsBindingWizard wizard = new ServiceToApplicationsBindingWizard(
							servicesHandler, serverBehaviour.getCloudFoundryServer(), editorPage);
					WizardDialog dialog = new WizardDialog(editorPage.getSite().getShell(), wizard);
					dialog.open();
				}
			}
			catch (CoreException e) {
				if (Logger.ERROR) {
					Logger.println(Logger.ERROR_LEVEL, this, "runInUIThread", "Error launching wizard", e); //$NON-NLS-1$ //$NON-NLS-2$
				}
			}

			return Status.OK_STATUS;
		}

	};
	uiJob.setSystem(true);
	uiJob.setPriority(Job.INTERACTIVE);
	uiJob.schedule();
}
 
Example 2
Project: dockerfoundry   File: ServiceToApplicationsBindingAction.java   View source code 7 votes vote down vote up
@Override
public void run() {
	UIJob uiJob = new UIJob(Messages.MANAGE_SERVICES_TO_APPLICATIONS_TITLE) {
		public IStatus runInUIThread(IProgressMonitor monitor) {
			try {
				if (serverBehaviour != null) {
					ServiceToApplicationsBindingWizard wizard = new ServiceToApplicationsBindingWizard(
							servicesHandler, serverBehaviour.getCloudFoundryServer(), editorPage);
					WizardDialog dialog = new WizardDialog(editorPage.getSite().getShell(), wizard);
					dialog.open();
				}
			}
			catch (CoreException e) {
				if (Logger.ERROR) {
					Logger.println(Logger.ERROR_LEVEL, this, "runInUIThread", "Error launching wizard", e); //$NON-NLS-1$ //$NON-NLS-2$
				}
			}

			return Status.OK_STATUS;
		}

	};
	uiJob.setSystem(true);
	uiJob.setPriority(Job.INTERACTIVE);
	uiJob.schedule();
}
 
Example 3
Project: n4js   File: WorkingSetConfigurationDialog.java   View source code 6 votes vote down vote up
private void createWorkingSet() {
	if (manager instanceof MutableWorkingSetManager) {

		final WorkingSetNewWizard wizard = ((MutableWorkingSetManager) manager).createNewWizard();
		// set allWorkingSets according to dialog to use it as a base for validation
		wizard.setAllWorkingSets(allWorkingSets);

		final WizardDialog dialog = new WizardDialog(getShell(), wizard);
		if (dialog.open() == Window.OK) {
			final WorkingSet workingSet = wizard.getWorkingSet().orNull();
			if (workingSet != null) {
				diffBuilder.add(workingSet);
				getShell().getDisplay().asyncExec(new Runnable() {

					@Override
					public void run() {
						allWorkingSets.add(workingSet);
						tableViewer.add(workingSet);
						tableViewer.setChecked(workingSet, true);
					}

				});
			}
		}
	}
}
 
Example 4
Project: convertigo-eclipse   File: ProjectExplorerImportAction.java   View source code 6 votes vote down vote up
@Override
public void run(IAction action) {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
		ImportWizard importWizard = new ImportWizard();
		importWizard.setWindowTitle("Convertigo project import Wizard");
   		WizardDialog wzdlg = new WizardDialog(shell, importWizard);
   		wzdlg.open();
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to import project!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 5
Project: convertigo-eclipse   File: SetupAction.java   View source code 6 votes vote down vote up
public static boolean runSetup() {
	Display display = Display.getDefault();
	WizardDialog wizardDialog = new WizardDialog(display.getActiveShell(), new SetupWizard()) {
		
		@Override
		protected void configureShell(Shell shell) {
			super.configureShell(shell);
			shell.setSize(730, 700);
			setReturnCode(WizardDialog.CANCEL);
		}
		
	};
	
	int ret = wizardDialog.open(); 
	
	return ret == WizardDialog.OK;
}
 
Example 6
Project: convertigo-eclipse   File: HtmlConnectorDesignComposite.java   View source code 6 votes vote down vote up
public void createCriteriasFromSelection(Document dom) throws EngineException {
	String className = "com.twinsoft.convertigo.beans.core.Criteria";
	
	// Retrieve selected criterias xpath
	String criteriaXpath = xpathEvaluator.getSelectionXpath();

	// Retrieve parent ScreenClass
	HtmlScreenClass parentObject = getParentHtmlScreenClass();

	NewObjectWizard newObjectWizard = new NewObjectWizard(parentObject, className, criteriaXpath, dom);
	WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), newObjectWizard);
	wzdlg.setPageSize(850, 650);
	wzdlg.open();
	if (wzdlg.getReturnCode() != Window.CANCEL) {
		Criteria criteria = (Criteria)newObjectWizard.newBean;

		// Reload parent ScreenClass in Tree
		fireObjectChanged(new CompositeEvent(parentObject));

		// Set selection on last created criteria (will expand tree to new criteria)
		if (criteria != null) fireObjectSelected(new CompositeEvent(criteria));

		// Set back selection on parent ScreenClass
		fireObjectSelected(new CompositeEvent(parentObject));
	}
}
 
Example 7
Project: Open_Source_ECOA_Toolset_AS5   File: ServicesWizardCommand.java   View source code 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(ID);
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(ID);
	}
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(ID);
	}
	try {
		if (descriptor != null) {
			IWizard wizard = descriptor.createWizard();
			WizardDialog wd = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
	return null;
}
 
Example 8
Project: Open_Source_ECOA_Toolset_AS5   File: CompDefWizardCommand.java   View source code 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(ID);
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(ID);
	}
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(ID);
	}
	try {
		if (descriptor != null) {
			IWizard wizard = descriptor.createWizard();
			WizardDialog wd = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
	return null;
}
 
Example 9
Project: Open_Source_ECOA_Toolset_AS5   File: InitAssmblWizardCommand.java   View source code 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(ID);
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(ID);
	}
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(ID);
	}
	try {
		if (descriptor != null) {
			IWizard wizard = descriptor.createWizard();
			WizardDialog wd = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
	return null;
}
 
Example 10
Project: Open_Source_ECOA_Toolset_AS5   File: LogicalSysWizardCommand.java   View source code 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(ID);
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(ID);
	}
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(ID);
	}
	try {
		if (descriptor != null) {
			IWizard wizard = descriptor.createWizard();
			WizardDialog wd = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
	return null;
}
 
Example 11
Project: Open_Source_ECOA_Toolset_AS5   File: CompImplWizardCommand.java   View source code 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(ID);
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(ID);
	}
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(ID);
	}
	try {
		if (descriptor != null) {
			IWizard wizard = descriptor.createWizard();
			WizardDialog wd = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
	return null;
}
 
Example 12
Project: Open_Source_ECOA_Toolset_AS5   File: FinalAssmblWizardCommand.java   View source code 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(ID);
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(ID);
	}
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(ID);
	}
	try {
		if (descriptor != null) {
			IWizard wizard = descriptor.createWizard();
			WizardDialog wd = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
	return null;
}
 
Example 13
Project: Open_Source_ECOA_Toolset_AS5   File: DeployWizardCommand.java   View source code 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(ID);
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(ID);
	}
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(ID);
	}
	try {
		if (descriptor != null) {
			IWizard wizard = descriptor.createWizard();
			WizardDialog wd = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
	return null;
}
 
Example 14
Project: Open_Source_ECOA_Toolset_AS5   File: TypesWizardCommand.java   View source code 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(ID);
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(ID);
	}
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(ID);
	}
	try {
		if (descriptor != null) {
			IWizard wizard = descriptor.createWizard();
			WizardDialog wd = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
	return null;
}
 
Example 15
Project: gw4e.project   File: RunAsManualWizard.java   View source code 6 votes vote down vote up
public static void open(String modelPath, ModelData[] additionalModels, String generatorstopcondition,
		String startnode, boolean removeBlockedElements, boolean omitEgdeswithoutDescription) {
	try {
		Display.getDefault().asyncExec(() -> {
			RunAsManualWizard wizard = new RunAsManualWizard(modelPath, additionalModels, generatorstopcondition,
					startnode, removeBlockedElements, omitEgdeswithoutDescription);
			wizard.init(PlatformUI.getWorkbench(), (IStructuredSelection) null);
			Shell activeShell = Display.getDefault().getActiveShell();
			if (activeShell == null)
				return;
			WizardDialog dialog = new WizardDialog(activeShell, wizard);
			dialog.open();
		});
	} catch (Exception e) {
		ResourceManager.logException(e);
	}
}
 
Example 16
Project: gw4e.project   File: ConvertToHandler.java   View source code 6 votes vote down vote up
public Object execute(ExecutionEvent event) throws ExecutionException {

		ISelection sel = HandlerUtil.getCurrentSelection(event);
		if (sel.isEmpty())
			return null;
		if (!(sel instanceof IStructuredSelection))
			return null;
		Object obj = ((IStructuredSelection) sel).getFirstElement();
		if (!(obj instanceof IFile))
			return null;
 
		try {
			ConvertToFileCreationWizard wizard = new ConvertToFileCreationWizard( );
			wizard.init(PlatformUI.getWorkbench(), (IStructuredSelection)sel);
			Shell activeShell = HandlerUtil.getActiveShell(event);
			if (activeShell==null) return null;
			WizardDialog dialog = new WizardDialog(activeShell,wizard);
			dialog.open();
		} catch (Exception e) {
			ResourceManager.logException(e);
		}
 
		return null;
	}
 
Example 17
Project: Hydrograph   File: SubJobUtility.java   View source code 6 votes vote down vote up
/**
 * Open sub graph save dialog.
 * 
 * @return the i file
 */
public IFile openSubJobSaveDialog() {
	IFile iFile = null;
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(Messages.JOB_WIZARD_ID);
	if (descriptor != null) {
		IWizard wizard = null;
		try {
			wizard = descriptor.createWizard();
		} catch (CoreException coreException) {
			logger.error("Error while opening create job wizard", coreException);
		}
		WizardDialog wizardDialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
		wizardDialog.setTitle(wizard.getWindowTitle());
		wizardDialog.open();
		JobCreationPage jobCreationPage = (JobCreationPage) wizardDialog.getSelectedPage();
		iFile = jobCreationPage.getNewFile();
	}
	return iFile;
}
 
Example 18
Project: time4sys   File: NewTime4SysModel.java   View source code 6 votes vote down vote up
public Object execute(ExecutionEvent event) throws ExecutionException {

		final INewWizard wizard = new NewModelWizard();

		// Initialize the selection
		final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
		final ISelectionService service = window.getSelectionService();
		final IStructuredSelection selection = (IStructuredSelection)service
				.getSelection("org.eclipse.sirius.ui.tools.views.model.explorer"); //$NON-NLS-1$
		wizard.init(PlatformUI.getWorkbench(), selection);

		// Open the new model wizard
		final WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
		dialog.open();
		return null;
	}
 
Example 19
Project: java-builders-generator   File: GenerateBuildersHandler.java   View source code 6 votes vote down vote up
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {

	final IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
	final ICompilationUnit icu = JavaUI.getWorkingCopyManager().getWorkingCopy(editorPart.getEditorInput());

	try {
		final IType type = icu.getTypes()[0];
		final List<Field> fields = new ArrayList<>();
		for (final IField field : type.getFields()) {
			final String fieldName = field.getElementName();
			final String fieldType = Signature.getSignatureSimpleName(field.getTypeSignature());
			fields.add(new Field(fieldName, fieldType));
		}

		new WizardDialog(HandlerUtil.getActiveShell(event), new BuilderGeneratorWizard(icu, fields)).open();

	}
	catch (final JavaModelException e) {
		e.printStackTrace();
	}

	return null;
}
 
Example 20
Project: team-explorer-everywhere   File: AddTask.java   View source code 6 votes vote down vote up
@Override
public IStatus run() {
    final AddFilesWizard wizard = new AddFilesWizard(startingBrowseLocalPath, startingBrowseServerPath);

    final WizardDialog dialog = new WizardDialog(getShell(), wizard);

    if (dialog.open() != IDialogConstants.OK_ID) {
        return Status.CANCEL_STATUS;
    }

    final String[] addPaths = wizard.getLocalPaths();
    if (addPaths.length == 0) {
        return Status.OK_STATUS;
    }

    final AddCommand command = new AddCommand(repository, addPaths);

    return getCommandExecutor().execute(command);
}
 
Example 21
Project: team-explorer-everywhere   File: ConnectHelpers.java   View source code 6 votes vote down vote up
public static void connectToServer(final Shell shell) {
    final TFSProductPlugin plugin = TFSCommonUIClientPlugin.getDefault().getProductPlugin();
    final ITeamProjectWizard wizard = plugin.getTeamProjectWizard();
    final WizardDialog dialog = new WizardDialog(shell, wizard);

    if (dialog.open() == IDialogConstants.OK_ID) {
        final TFSServer defaultServer = plugin.getServerManager().getDefaultServer();
        final TFSRepository[] repositories = plugin.getRepositoryManager().getRepositories();

        if (defaultServer != null) {
            defaultServer.refresh(true);
        }

        for (int i = 0; i < repositories.length; i++) {
            repositories[i].getPendingChangeCache().refresh();
        }
    }
}
 
Example 22
Project: team-explorer-everywhere   File: TfsBuildDefinitionDialog.java   View source code 6 votes vote down vote up
@Override
protected SelectionListener getCreateButtonSelectionListener(final Shell shell) {
    return new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            final CreateBuildConfigurationWizard wizard = new CreateBuildConfigurationWizard();

            // update the build definition to contain values as
            // currently defined, that way
            // information inside is available in the creation wizard.
            updateAndVerifyBuildDefinition(true);

            wizard.init(buildDefinition);

            final WizardDialog dialog = new WizardDialog(getShell(), wizard);
            final int rc = dialog.open();

            if (rc == IDialogConstants.OK_ID) {
                checkForBuildFileExistence(true);
                validate();
            }
        }
    };
}
 
Example 23
Project: team-explorer-everywhere   File: TeamExplorerGitRepositoriesSection.java   View source code 6 votes vote down vote up
@Override
public void run() {
    try {
        if (!GitHelpers.isEGitInstalled(true)) {
            final String errorMessage =
                Messages.getString("TeamExplorerGitWizardNavigationLink.EGitMissingErrorMessageText"); //$NON-NLS-1$
            final String title =
                Messages.getString("TeamExplorerGitWizardNavigationLink.EGitMissingErrorMessageTitle"); //$NON-NLS-1$

            log.error("Cannot import from a Git Repository. EGit plugin is required for this action."); //$NON-NLS-1$
            MessageDialog.openError(treeViewer.getControl().getShell(), title, errorMessage);
            return;
        }

        // open Git import wizard
        final GitImportWizard wizard = new GitImportWizard(serverItems);
        wizard.init(PlatformUI.getWorkbench(), null);
        final WizardDialog dialog = new WizardDialog(treeViewer.getControl().getShell(), wizard);
        dialog.open();
    } catch (final Exception e) {
        log.error("", e); //$NON-NLS-1$
    }
}
 
Example 24
Project: team-explorer-everywhere   File: ProjectManagerUIDataProvider.java   View source code 6 votes vote down vote up
@Override
public TFSTeamProjectCollection promptForConnection(final IProject project) {
    Check.notNull(project, "project"); //$NON-NLS-1$

    final Shell parentShell = ShellUtils.getWorkbenchShell();

    final EclipseConnectErrorWizard connectWizard = new EclipseConnectErrorWizard();

    final String messageFormat =
        Messages.getString("ProjectManagerUiDataProvider.WorkspaceNotLocatedDialogTextFormat"); //$NON-NLS-1$
    final String message = MessageFormat.format(messageFormat, project.getName());
    connectWizard.setErrorMessage(message);

    final WizardDialog connectDialog = new WizardDialog(parentShell, connectWizard);

    if (UIHelpers.openOnUIThread(connectDialog) != IDialogConstants.OK_ID) {
        return null;
    }

    if (connectWizard.hasPageData(TFSTeamProjectCollection.class)) {
        return (TFSTeamProjectCollection) connectWizard.getPageData(TFSTeamProjectCollection.class);
    }

    return null;
}
 
Example 25
Project: team-explorer-everywhere   File: ProjectManagerUIDataProvider.java   View source code 6 votes vote down vote up
/**
 * Given a profile and a failure that occurred when connecting it, will
 * prompt the user to update the details. Uses extension points to find a
 * contributor who can provide profile details (normally the UI Plug-in.)
 *
 * @param profile
 *        The profile that failed
 * @param failure
 *        The failure that occurred
 * @return The profile to connect with, or null if the user canceled.
 * @param cachedWorkspace
 *        The CachedWorkspace with a null or incomplete profile
 * @return A Profile to connect this CachedWorkspace, or null if none could
 *         be obtained or the user canceled.
 */
@Override
public TFSTeamProjectCollection promptForConnection(
    final URI serverURI,
    final Credentials credentials,
    final String errorMessage) {
    Check.notNull(errorMessage, "errorMessage"); //$NON-NLS-1$

    final Shell parentShell = ShellUtils.getWorkbenchShell();

    final EclipseConnectErrorWizard connectWizard = new EclipseConnectErrorWizard();
    connectWizard.setErrorMessage(errorMessage);

    final WizardDialog connectDialog = new WizardDialog(parentShell, connectWizard);

    if (UIHelpers.openOnUIThread(connectDialog) != IDialogConstants.OK_ID) {
        return null;
    }

    if (connectWizard.hasPageData(TFSTeamProjectCollection.class)) {
        return (TFSTeamProjectCollection) connectWizard.getPageData(TFSTeamProjectCollection.class);
    }

    return null;
}
 
Example 26
Project: team-explorer-everywhere   File: TFSEclipseClientUILicenseChecker.java   View source code 6 votes vote down vote up
@Override
public boolean isLicensed() {
    final Display display = Display.getDefault();

    if (display == null) {
        return super.isLicensed();
    }

    UIHelpers.runOnUIThread(false, new Runnable() {
        @Override
        public void run() {
            if (TFSEclipseClientUILicenseChecker.needsPrompt()) {
                final EULAWizard eulaWizard = new EULAWizard();
                final WizardDialog eulaWizardDialog = new WizardDialog(ShellUtils.getWorkbenchShell(), eulaWizard);

                eulaWizardDialog.open();
            }
        }
    });

    /* Retest EULA and product key */
    return super.isLicensed();
}
 
Example 27
Project: team-explorer-everywhere   File: ImportFolderAction.java   View source code 6 votes vote down vote up
@Override
public void doRun(final IAction action) {
    if (items == null) {
        return;
    }

    final TfsImportWizard importWizard = new TfsImportWizard();

    // Add current selected folders as selection.
    final String[] importFolders = new String[items.length];
    for (int i = 0; i < importFolders.length; i++) {
        importFolders[i] = items[i].getFullPath();
    }
    importWizard.setImportFolders(importFolders);

    importWizard.init(getWorkbenchWindow().getWorkbench(), null);

    final WizardDialog dialog = new WizardDialog(getShell(), importWizard);
    dialog.open();
}
 
Example 28
Project: subclipse   File: BranchTagAction.java   View source code 6 votes vote down vote up
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
    if (action != null && !action.isEnabled()) { 
    	action.setEnabled(true);
    } 
    else {
     IResource[] resources = getSelectedResources();
    	BranchTagWizard wizard = new BranchTagWizard(resources);
    	SizePersistedWizardDialog dialog = new SizePersistedWizardDialog(getShell(), wizard, "BranchTag"); //$NON-NLS-1$
    	wizard.setParentDialog(dialog);
    	if (dialog.open() == WizardDialog.OK) {	
    		SVNUrl[] sourceUrls = wizard.getUrls();
    		SVNUrl destinationUrl = wizard.getToUrl();
    		String message = wizard.getComment();
    		boolean createOnServer = wizard.isCreateOnServer();
         BranchTagOperation branchTagOperation = new BranchTagOperation(getTargetPart(), getSelectedResources(), sourceUrls, destinationUrl, createOnServer, wizard.getRevision(), message);
         branchTagOperation.setMakeParents(wizard.isMakeParents());
         branchTagOperation.setMultipleTransactions(wizard.isSameStructure());
         branchTagOperation.setNewAlias(wizard.getNewAlias());
         branchTagOperation.switchAfterTagBranchOperation(wizard.isSwitchAfterBranchTag());
         branchTagOperation.setSvnExternals(wizard.getSvnExternals());
         branchTagOperation.run();        		
    	}
    }
}
 
Example 29
Project: subclipse   File: ResolveTreeConflictWizard.java   View source code 6 votes vote down vote up
public void partClosed(IWorkbenchPartReference partRef) {
	IWorkbenchPart part = partRef.getPart(false);
	if (part instanceof CompareEditor) {
		CompareEditor editor = (CompareEditor)part;
		IEditorInput input = editor.getEditorInput();
		String name = input.getName();
		if (name != null && name.startsWith(compareName)) {
			targetPart.getSite().getPage().removePartListener(this);
			if (MessageDialog.openQuestion(getShell(), Messages.ResolveTreeConflictWizard_editorClosed, Messages.ResolveTreeConflictWizard_promptToReolve + treeConflict.getResource().getName() + "?")) { //$NON-NLS-1$
				ResolveTreeConflictWizard wizard = new ResolveTreeConflictWizard(treeConflict, targetPart);
				WizardDialog dialog = new SizePersistedWizardDialog(Display.getDefault().getActiveShell(), wizard, "ResolveTreeConflict"); //$NON-NLS-1$
				dialog.open();
			}
		}
	}
}
 
Example 30
Project: tlaplus   File: TraceExplorerComposite.java   View source code 6 votes vote down vote up
/**
 * Opens a dialog for formula processing and returns the edited formula  
 * @param formula initial formula, can be <code>null</code>
 * @return result of editing or <code>null</code>, if editing canceled
 */
protected Formula doEditFormula(Formula formula)
{
    // Create the wizard
    FormulaWizard wizard = new FormulaWizard(section.getText(), section.getDescription());
    wizard.setFormula(formula);

    // Create the wizard dialog
    WizardDialog dialog = new WizardDialog(getTableViewer().getTable().getShell(), wizard);
    dialog.setHelpAvailable(true);

    // Open the wizard dialog
    if (Window.OK == dialog.open())
    {
        return wizard.getFormula();
    } else
    {
        return null;
    }
}
 
Example 31
Project: tlaplus   File: ValidateableConstantSectionPart.java   View source code 6 votes vote down vote up
protected Assignment doEditFormula(Assignment formula) // gets called when editing a constant and ...
{
    Assert.isNotNull(formula);

    // Create the wizard
    AssignmentWizard wizard = new AssignmentWizard(getSection().getText(), getSection().getDescription(),
            (Assignment) formula, AssignmentWizard.SHOW_OPTION, AssignmentWizardPage.CONSTANT_WIZARD_ID);
    // Create the wizard dialog
    WizardDialog dialog = new WizardDialog(getTableViewer().getTable().getShell(), wizard);
    wizard.setWizardDialog(dialog);
    dialog.setHelpAvailable(true);

    // Open the wizard dialog
    if (Window.OK == dialog.open())
    {
        return wizard.getFormula();
    } else
    {
        return null;  // We get here if the user cancels.
    }
}
 
Example 32
Project: tlaplus   File: ValidateableTableSectionPart.java   View source code 6 votes vote down vote up
/**
 * Opens a dialog for formula processing and returns the edited formula  
 * @param formula initial formula, can be <code>null</code>
 * @return result of editing or <code>null</code>, if editing canceled
 */
protected Formula doEditFormula(Formula formula)
{
    // Create the wizard
    FormulaWizard wizard = new FormulaWizard(getSection().getText(), getSection().getDescription());
    wizard.setFormula(formula);

    // Create the wizard dialog
    WizardDialog dialog = new WizardDialog(getTableViewer().getTable().getShell(), wizard);
    dialog.setHelpAvailable(true);

    // Open the wizard dialog
    if (Window.OK == dialog.open())
    {
        return wizard.getFormula();
    } else
    {
        return null;
    }
}
 
Example 33
Project: hadoop-EAR   File: NewLocationAction.java   View source code 6 votes vote down vote up
@Override
public void run() {
  WizardDialog dialog = new WizardDialog(null, new Wizard() {
    private HadoopLocationWizard page = new HadoopLocationWizard();

    @Override
    public void addPages() {
      super.addPages();
      setWindowTitle("New Hadoop location...");
      addPage(page);
    }

    @Override
    public boolean performFinish() {
      page.performFinish();
      return true;
    }

  });

  dialog.create();
  dialog.setBlockOnOpen(true);
  dialog.open();

  super.run();
}
 
Example 34
Project: cft   File: CloneServerCommand.java   View source code 6 votes vote down vote up
public void doRun(final CloudFoundryServer cloudServer) {
	final Shell shell = activePart != null && activePart.getSite() != null ? activePart.getSite().getShell()
			: CFUiUtil.getShell();

	if (shell != null) {
		UIJob job = new UIJob(getJobName()) {

			public IStatus runInUIThread(IProgressMonitor monitor) {
				OrgsAndSpacesWizard wizard = new OrgsAndSpacesWizard(cloudServer);
				WizardDialog dialog = new WizardDialog(shell, wizard);
				dialog.open();

				return Status.OK_STATUS;
			}
		};
		job.setSystem(true);
		job.schedule();
	}
	else {
		CloudFoundryPlugin.logError("Unable to find an active shell to open the orgs and spaces wizard."); //$NON-NLS-1$
	}

}
 
Example 35
Project: cft   File: CloudFoundryUiCallback.java   View source code 6 votes vote down vote up
@Override
public void getCredentials(final CloudFoundryServer server) {
	Display.getDefault().syncExec(new Runnable() {

		public void run() {
			CloudFoundryCredentialsWizard wizard = new CloudFoundryCredentialsWizard(server);
			WizardDialog dialog = new WizardDialog(
					PlatformUI.getWorkbench().getModalDialogShellProvider().getShell(), wizard);
			dialog.open();
		}
	});

	if (server.getUsername() == null || server.getUsername().length() == 0 || server.getPassword() == null
			|| server.getPassword().length() == 0 || server.getUrl() == null || server.getUrl().length() == 0) {
		throw new OperationCanceledException();
	}
}
 
Example 36
Project: cft   File: CloudFoundryUiCallback.java   View source code 6 votes vote down vote up
@Override
public void deleteServices(final List<String> services, final CloudFoundryServer cloudServer) {
	if (services == null || services.isEmpty()) {
		return;
	}

	Display.getDefault().syncExec(new Runnable() {

		public void run() {
			DeleteServicesWizard wizard = new DeleteServicesWizard(cloudServer, services);
			WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
			dialog.open();
		}

	});
}
 
Example 37
Project: synergyview   File: ExportAnnotationForCollectionHandler.java   View source code 6 votes vote down vote up
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (!(selection instanceof IStructuredSelection)) {
    return null;
}
IStructuredSelection structSel = (IStructuredSelection) selection;
Object element = structSel.iterator().next();

if (element instanceof CollectionNode) {
    CollectionNode collectionNode = (CollectionNode) element;
    WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveWorkbenchWindow(event).getShell(), new ExportCollectionAnnotationWizard(collectionNode));
    dialog.open();
    return null;
} else {
    return null;
}
   }
 
Example 38
Project: cft   File: CloudFoundryAccountSection.java   View source code 6 votes vote down vote up
protected void createCloneServerArea(Composite parent, FormToolkit toolkit) {
	final Button changeSpaceButton = toolkit.createButton(parent,
			Messages.CloudFoundryAccountSection_BUTTON_CLONE_SERVER, SWT.PUSH);

	changeSpaceButton.setEnabled(true);

	changeSpaceButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
	changeSpaceButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {

			OrgsAndSpacesWizard wizard = new OrgsAndSpacesWizard(cfServer);

			WizardDialog dialog = new WizardDialog(getShell(), wizard);
			dialog.open();

		}
	});
}
 
Example 39
Project: PDFReporter-Studio   File: ExpressionListFieldEditor.java   View source code 6 votes vote down vote up
@Override
protected String getNewInputObject() {
	if(!ExpressionEditorSupportUtil.isExpressionEditorDialogOpen()) {
		JRExpressionEditor wizard = new JRExpressionEditor();
		WizardDialog dialog = 
				ExpressionEditorSupportUtil.getExpressionEditorWizardDialog(getShell(),wizard);
		if (dialog.open() == Dialog.OK) {
			JRDesignExpression newExp = wizard.getValue();
			if(newExp!=null &&
					!Misc.nvl(newExp.getText()).equals("")){
				return newExp.getText();
			}
		}
	}
	return null;
}
 
Example 40
Project: bts   File: ApplicationStartupControllerImpl.java   View source code 6 votes vote down vote up
protected boolean openInstallationWizard() {
	InstallationWizard installWizard = new InstallationWizard(context,
			ApplicationStartupControllerImpl.this, sync, userController);
	WizardDialog dialog = new WizardDialog(new Shell(SWT.NO_TRIM
			| SWT.ON_TOP), installWizard);
	if (dialog.open() == dialog.OK) {
		logger.info("InstallationWizard returned OK");
		localDBUrl = installWizard.getLocalDBUrl();
		context.set(BTSPluginIDs.PREF_LOCAL_DB_URL, localDBUrl);
	} else {
		logger.info("InstallationWizard canceled");
		return false;
	}
	if (installWizard.isLocalProject()) {
		initialProjectCreation();
		return true;
	}

	return true;
}