Java Code Examples for org.eclipse.jface.wizard.WizardDialog.open()

The following are Jave code examples for showing how to use open() of the org.eclipse.jface.wizard.WizardDialog class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Hydrograph   File: SubJobUtility.java   View Source Code Vote up 6 votes
/**
 * 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 2
Project: gw4e.project   File: ConvertToHandler.java   View Source Code Vote up 6 votes
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 3
Project: Open_Source_ECOA_Toolset_AS5   File: FinalAssmblWizardCommand.java   View Source Code Vote up 6 votes
@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 4
Project: Open_Source_ECOA_Toolset_AS5   File: ServicesWizardCommand.java   View Source Code Vote up 6 votes
@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 5
Project: Open_Source_ECOA_Toolset_AS5   File: LogicalSysWizardCommand.java   View Source Code Vote up 6 votes
@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 6
Project: convertigo-eclipse   File: SetupAction.java   View Source Code Vote up 6 votes
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 7
Project: convertigo-eclipse   File: HtmlConnectorDesignComposite.java   View Source Code Vote up 6 votes
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 8
Project: team-explorer-everywhere   File: AddTask.java   View Source Code Vote up 6 votes
@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 9
Project: team-explorer-everywhere   File: ConnectHelpers.java   View Source Code Vote up 6 votes
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 10
Project: team-explorer-everywhere   File: TfsBuildDefinitionDialog.java   View Source Code Vote up 6 votes
@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 11
Project: tlaplus   File: ValidateableConstantSectionPart.java   View Source Code Vote up 6 votes
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 12
Project: team-explorer-everywhere   File: ImportFolderAction.java   View Source Code Vote up 6 votes
@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 13
Project: PDFReporter-Studio   File: EditSpiderChartCommand.java   View Source Code Vote up 6 votes
@Override
public void execute() {
	if (newChart == null) {
		JRDesignComponentElement clone = (JRDesignComponentElement) oldChart
				.clone();
		SpiderChartComponent scc = (SpiderChartComponent) clone
				.getComponent();
		// TODO SHOULD TAKE THIS ONE FROM EDITOR

		ChartWizard wizard = new ChartWizard(new MSpiderChart(null, clone,
				-1), (JRDesignElementDataset) scc.getDataset());
		wizard.init(jConfig);
		wizard.setExpressionContext(ModelUtils.getElementExpressionContext(oldChart,originalNode));
		WizardDialog dialog = new WizardDialog(Display.getDefault()
				.getActiveShell(), wizard);
		dialog.create();
		if (dialog.open() == Dialog.OK) {
			this.newChart = (JRDesignComponentElement) wizard.getChart()
					.getValue();
		} else
			return;
	}
	switchCharts(oldChart, newChart);
}
 
Example 14
Project: bts   File: TESTER.java   View Source Code Vote up 6 votes
@Execute
public void execute(@Preference(nodePath = "org.bbaw.bts.app") IEclipsePreferences prefs, IEclipseContext context,
		ApplicationStartupController startupController)
{
	//		PartHolderDialog dialog = ContextInjectionFactory.make(PartHolderDialog.class, context);
	//		//		context.set(UserManagementDialog.class, dialog);
	//
	//		if (dialog.open() == dialog.OK)
	//		{
	//		}

	Wizard w = new InstallationWizard(context, startupController, null, null);
	WizardDialog dialog = new WizardDialog(new Shell(), w);
	if (dialog.open() == dialog.OK)
	{
		System.out.println("new project created.");

	}
}
 
Example 15
Project: PDFReporter-Studio   File: EditTextFieldExpressionCommand.java   View Source Code Vote up 6 votes
public int showDialog() {
	if(!ExpressionEditorSupportUtil.isExpressionEditorDialogOpen()) {
		JRExpressionEditor wizard = new JRExpressionEditor();
		wizard.setValue(JRCloneUtils.nullSafeClone(originalExpression));
		ExpressionContext ec = ModelUtils.getElementExpressionContext((JRDesignTextField) textField.getValue(), textField);
		wizard.setExpressionContext(ec);

		WizardDialog dialog = ExpressionEditorSupportUtil.getExpressionEditorWizardDialog(UIUtils.getShell(), wizard);
		if (dialog.open() == Dialog.OK) {
			isExpressionChanged = true;
			newExpression=wizard.getValue();
			return Window.OK;
		}
	}
	isExpressionChanged=false;
	return Window.CANCEL;
}
 
Example 16
Project: neoscada   File: WriteAttributesOperationAction.java   View Source Code Vote up 5 votes
@Override
public void run ( final IAction action )
{
    if ( this.selection == null )
    {
        return;
    }

    final IWorkbenchWizard wiz = new WriteAttributesOperationWizard ();
    wiz.init ( this.site.getWorkbenchWindow ().getWorkbench (), this.selection );

    // Embed the wizard into a dialog
    final WizardDialog dialog = new WizardDialog ( this.site.getShell (), wiz );
    dialog.open ();
}
 
Example 17
Project: bdf2   File: POJO2DataTypeHandler.java   View Source Code Vote up 5 votes
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
	ISelection selection = HandlerUtil.getCurrentSelection(event);
	POJO2DataTypeWizard wizard = new POJO2DataTypeWizard();
	wizard.init(window.getWorkbench(), 
			selection instanceof IStructuredSelection
			? (IStructuredSelection) selection : StructuredSelection.EMPTY);
	WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
	dialog.open();
	return null;
}
 
Example 18
Project: convertigo-eclipse   File: DatabaseObjectCreateAction.java   View Source Code Vote up 5 votes
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		TreeObject parentTreeObject = null;
   		DatabaseObject databaseObject = null;
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			parentTreeObject = explorerView.getFirstSelectedTreeObject();
   			
   			if (parentTreeObject instanceof ObjectsFolderTreeObject) {
   				parentTreeObject = ((ObjectsFolderTreeObject) parentTreeObject).getParent();
   				databaseObject  = (DatabaseObject) parentTreeObject.getObject();
   			}
   			else {
   				databaseObject = (DatabaseObject) parentTreeObject.getObject();
   			}
   			
   			NewObjectWizard newObjectWizard = new NewObjectWizard(databaseObject, databaseObjectClassName);
       		WizardDialog wzdlg = new WizardDialog(shell, newObjectWizard);
       		wzdlg.setPageSize(850, 650);
       		wzdlg.open();
       		int result = wzdlg.getReturnCode();
       		if ((result != Window.CANCEL) && (newObjectWizard.newBean != null)) {
       			postCreate(parentTreeObject, newObjectWizard.newBean);
       		}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to create a new database object '"+ databaseObjectClassName +"'!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 19
Project: convertigo-eclipse   File: MobileComponentCreateAction.java   View Source Code Vote up 5 votes
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		TreeObject parentTreeObject = null;
   		DatabaseObject databaseObject = null;
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			parentTreeObject = explorerView.getFirstSelectedTreeObject();
   			
   			if (parentTreeObject instanceof ObjectsFolderTreeObject) {
   				parentTreeObject = ((ObjectsFolderTreeObject) parentTreeObject).getParent();
   				databaseObject  = (DatabaseObject) parentTreeObject.getObject();
   			}
   			else {
   				databaseObject = (DatabaseObject) parentTreeObject.getObject();
   			}
   			
   			ComponentObjectWizard newObjectWizard = new ComponentObjectWizard(databaseObject, databaseObjectClassName);
       		WizardDialog wzdlg = new WizardDialog(shell, newObjectWizard);
       		wzdlg.setPageSize(850, 650);
       		wzdlg.open();
       		int result = wzdlg.getReturnCode();
       		if ((result != Window.CANCEL) && (newObjectWizard.newBean != null)) {
       			postCreate(parentTreeObject, newObjectWizard.newBean);
       		}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to create a new database object '"+ databaseObjectClassName +"'!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 20
Project: subclipse   File: NewRepositoryAction.java   View Source Code Vote up 5 votes
/**
 * @see IActionDelegate#run(IAction)
 */
public void run(IAction action) {
    if (!WorkspacePathValidator.validateWorkspacePath()) return;
	NewLocationWizard wizard = new NewLocationWizard();
	WizardDialog dialog = new ClosableWizardDialog(shell, wizard);
	dialog.open();
}
 
Example 21
Project: egradle   File: ReimportGradleProjectHandler.java   View Source Code Vote up 5 votes
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	Shell activeShell = HandlerUtil.getActiveShell(event);

	EGradleRootProjectImportWizard wizard = new EGradleRootProjectImportWizard();
	wizard.setImportMode(RootProjectConfigMode.REIMPORT_PROJECTS);
	wizard.setWindowTitle("Reimport project(s)");
	
	WizardDialog dialog = new WizardDialog(activeShell, wizard);

	
	dialog.open();
	return null;
}
 
Example 22
Project: egradle   File: NewGradleProjectHandler.java   View Source Code Vote up 5 votes
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	Shell activeShell = HandlerUtil.getActiveShell(event);

	IWizard wizard = new EGradleNewProjectWizard();

	WizardDialog dialog = new WizardDialog(activeShell, wizard);

	dialog.open();
	return null;
}
 
Example 23
Project: lider-ahenk-installer   File: LiderInstallationHandler.java   View Source Code Vote up 5 votes
@Execute
public void execute(Shell shell) {

	// Check installer version
	CheckVersionDialog versionDialog = new CheckVersionDialog(Display.getCurrent().getActiveShell());
	versionDialog.open();

	if (versionDialog.isContinueInstallation()) {
		WizardDialog wizardDialog = GUIHelper.createDialog(Display.getCurrent().getActiveShell(),
				new LiderSetupWizard(), new Point(1175, 600));
		wizardDialog.open();
	}
}
 
Example 24
Project: team-explorer-everywhere   File: TeamExplorerGitWizardNavigationLink.java   View Source Code Vote up 5 votes
@Override
public void onClick(
    final Shell shell,
    final TeamExplorerContext context,
    final TeamExplorerNavigator navigator,
    final TeamExplorerNavigationItemConfig parentNavigationItem) {
    try {
        if (!GitHelpers.isEGitInstalled(false)) {
            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 requered for this action."); //$NON-NLS-1$
            MessageDialog.openError(shell, title, errorMessage);

            return;
        }
        // open git import wizard
        final GitImportWizard wizard = new GitImportWizard(null);
        wizard.init(PlatformUI.getWorkbench(), null);
        final WizardDialog dialog = new WizardDialog(shell, wizard);
        dialog.open();
    } catch (final Exception e) {
        log.error("", e); //$NON-NLS-1$
    }
}
 
Example 25
Project: subclipse   File: MergeAction.java   View Source Code Vote up 5 votes
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
       if (action != null && !action.isEnabled()) { 
       	action.setEnabled(true);
       }  else {		
		IResource[] resources = getSelectedResources();
		MergeWizard wizard = new MergeWizard(resources, getTargetPart());
		WizardDialog dialog = new CustomWizardDialog(shell, wizard);
		dialog.open();	
       }
}
 
Example 26
Project: hybris-commerce-eclipse-plugin   File: AttachSourcesHandler.java   View Source Code Vote up 5 votes
@Override
public Object execute( ExecutionEvent event ) throws ExecutionException
{
	Shell activeShell = HandlerUtil.getActiveShell(event);
	IWizard wizard = new AttachSourcesWizard();
	
	WizardDialog dialog = new WizardDialog(activeShell, wizard);
	dialog.open();
	
	return null;
}
 
Example 27
Project: subclipse   File: RelocateAction.java   View Source Code Vote up 5 votes
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
	Iterator iter = selection.iterator();
	while (iter.hasNext()) {
		Object object = iter.next();
		if (object instanceof SVNRepositoryLocation) {
			SVNRepositoryLocation repository = (SVNRepositoryLocation)object;
			RelocateWizard wizard = new RelocateWizard(repository);
			WizardDialog dialog = new ClosableWizardDialog(shell, wizard);
			dialog.open();
			break;
		}
	}
}
 
Example 28
Project: subclipse   File: MergeFileAssociationPreferencePage.java   View Source Code Vote up 5 votes
private void addFileType() {
	NewMergeFileAssociationWizard wizard = new NewMergeFileAssociationWizard(mergeFileAssociations);
	WizardDialog dialog = new ClosableWizardDialog(Display.getCurrent().getActiveShell(), wizard);
	if (dialog.open() == WizardDialog.CANCEL) return;
	associationsUpdated = true;
	ArrayList associationsList = new ArrayList();
	for (int i = 0; i < mergeFileAssociations.length; i++) associationsList.add(mergeFileAssociations[i]);
	associationsList.add(wizard.getMergeFileAssociation());
	mergeFileAssociations = new MergeFileAssociation[associationsList.size()];
	associationsList.toArray(mergeFileAssociations);
	Arrays.sort(mergeFileAssociations);
	viewer.refresh();
}
 
Example 29
Project: subclipse   File: EditPropertyConflictsAction.java   View Source Code Vote up 5 votes
protected void execute(final IAction action) throws InvocationTargetException, InterruptedException {
 	error = null;
 	BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
public void run() {
   	IResource resource = getSelectedResources()[0];
       svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
       ISVNClientAdapter client = null;
   	try {
   		conflictSummary = PropertyConflict.getConflictSummary(svnResource);
		propertyConflicts = PropertyConflict.getPropertyConflicts(svnResource);
		client = svnResource.getRepository().getSVNClient();
		remoteProperties = client.getProperties(svnResource.getUrl(), svnResource.getRevision(), svnResource.getRevision());
	} catch (Exception e) {
		error = e;
	}
   	finally {
   		svnResource.getRepository().returnSVNClient(client);
   	}
}   		
 	});
 	if (error != null) {
 		handle(error);
 		return;
 	}
 	EditPropertyConflictsWizard wizard = new EditPropertyConflictsWizard(svnResource, conflictSummary, propertyConflicts, remoteProperties, getTargetPart());
 	WizardDialog dialog = new SizePersistedWizardDialog(Display.getDefault().getActiveShell(), wizard, "EditPropertyConflicts"); //$NON-NLS-1$    
 	dialog.open();
 }
 
Example 30
Project: subclipse   File: ResolveTreeConflictAction.java   View Source Code Vote up 5 votes
public void run() {
	IStructuredSelection selection = (IStructuredSelection)selectionProvider.getSelection();
	SVNTreeConflict treeConflict = (SVNTreeConflict)selection.getFirstElement();
	ResolveTreeConflictWizard wizard = new ResolveTreeConflictWizard(treeConflict, targetPart);
	WizardDialog dialog = new SizePersistedWizardDialog(Display.getDefault().getActiveShell(), wizard, "ResolveTreeConflict"); //$NON-NLS-1$
	dialog.open();
}
 
Example 31
Project: subclipse   File: GenerateDiffFileAction.java   View Source Code Vote up 5 votes
/** (Non-javadoc)
 * Method declared on IActionDelegate.
 * @throws InterruptedException 
 * @throws InvocationTargetException 
 */
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
	statusMap = new HashMap();
	unaddedList = new ArrayList();
	String title = Policy.bind("GenerateSVNDiff.title"); //$NON-NLS-1$
	final IResource[] resources = getSelectedResources();
	run(new IRunnableWithProgress() {
		public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
			 try {
				modifiedResources = getModifiedResources(resources, monitor);
			} catch (SVNException e) {
				SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
			}		
		}
		
	}, true, PROGRESS_BUSYCURSOR);
	if (modifiedResources == null || modifiedResources.length == 0) {
		MessageDialog.openInformation(getShell(), Policy.bind("GenerateSVNDiff.title"), Policy.bind("GenerateSVNDiff.noDiffsFoundMsg")); //$NON-NLS-1$ //$NON-NLS-1$
		return;
	}
	IResource[] unaddedResources = new IResource[unaddedList.size()];
	unaddedList.toArray(unaddedResources);
	GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(modifiedResources), unaddedResources, statusMap);
	wizard.setWindowTitle(title);
	wizard.setSelectedResources(getSelectedResources());
	WizardDialog dialog = new WizardDialogWithPersistedLocation(getShell(), wizard, "GenerateDiffFileWizard"); //$NON-NLS-1$
	dialog.setMinimumPageSize(350, 250);
	dialog.open();
}
 
Example 32
Project: gwt-eclipse-plugin   File: AbstractOpenWizardAction.java   View Source Code Vote up 5 votes
@Override
public void run() {
  Shell localShell = getShell();
  if (!doCreateProjectFirstOnEmptyWorkspace(localShell)) {
    return;
  }

  try {
    INewWizard wizard = createWizard();
    wizard.init(PlatformUI.getWorkbench(), getSelection());

    WizardDialog dialog = new WizardDialog(localShell, wizard);
    IPixelConverter converter =
        PixelConverterFactory.createPixelConverter(JFaceResources.getDialogFont());
    dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70),
        converter.convertHeightInCharsToPixels(20));
    dialog.create();
    int res = dialog.open();
    if (res == Window.OK && wizard instanceof NewElementWizard) {
      createdElement = ((NewElementWizard) wizard).getCreatedElement();
    }

    notifyResult(res == Window.OK);
  } catch (CoreException e) {
    String title = NewWizardMessages.AbstractOpenWizardAction_createerror_title;
    String message = NewWizardMessages.AbstractOpenWizardAction_createerror_message;
    ExceptionHandler.handle(e, localShell, title, message);
  }
}
 
Example 33
Project: PDFReporter-Studio   File: SortFieldCellEditor.java   View Source Code Vote up 5 votes
@Override
protected Object openDialogBox(Control cellEditorWindow) {
	SortFieldEditor wizard = new SortFieldEditor();
	wizard.setList((List<?>) getValue());
	WizardDialog dialog = new WizardDialog(cellEditorWindow.getShell(), wizard);
	dialog.create();
	if (dialog.open() == Dialog.OK) {
		return wizard.getList();
	}
	return null;
}
 
Example 34
Project: IDRT-Import-and-Mapping-Tool   File: BiobankImportCommand.java   View Source Code Vote up 5 votes
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	wiz = new BiobankImportWizard();
	WizardDialog wizardDialog = new WizardDialog(Application.getShell(),
			wiz);
	wizardDialog.open();
	return null;
}
 
Example 35
Project: hadoop-2.6.0-cdh5.4.3   File: EditLocationAction.java   View Source Code Vote up 5 votes
@Override
public void run() {

  final HadoopServer server = serverView.getSelectedServer();
  if (server == null)
    return;

  WizardDialog dialog = new WizardDialog(null, new Wizard() {
    private HadoopLocationWizard page = new HadoopLocationWizard(server);

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

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

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

  super.run();
}
 
Example 36
Project: PDFReporter-Studio   File: PatternCellEditor.java   View Source Code Vote up 5 votes
@Override
protected Object openDialogBox(Control cellEditorWindow) {
	PatternEditor wizard = new PatternEditor();
	wizard.setValue((String) getValue());
	WizardDialog dialog = new WizardDialog(cellEditorWindow.getShell(), wizard);
	dialog.create();
	if (dialog.open() == Dialog.OK) {
		return wizard.getValue();
	}
	return null;
}
 
Example 37
Project: PDFReporter-Studio   File: MarkerCellEditor.java   View Source Code Vote up 5 votes
@Override
protected Object openDialogBox(Control cellEditorWindow) {
	MarkerEditor wizard = new MarkerEditor();
	wizard.setValue((MarkersDTO) getValue());
	WizardDialog dialog = new WizardDialog(cellEditorWindow.getShell(),
			wizard);
	dialog.create();
	if (dialog.open() == Dialog.OK)
		return wizard.getValue();
	return null;
}
 
Example 38
Project: APICloud-Studio   File: CheckoutAsAction.java   View Source Code Vote up 5 votes
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
		if (!WorkspacePathValidator.validateWorkspacePath()) return;
	    final ISVNRemoteFolder[] folders = getSelectedRemoteFolders();
	    CheckoutWizard wizard = new CheckoutWizard(folders);
	    WizardDialog dialog = new ClosableWizardDialog(shell, wizard);
	    dialog.open();
	    for(ISVNRemoteFolder folder:folders){
	    	String name=folder.getName();
	    	String url=folder.getUrl().toString();
	    	String appId=url.substring(url.indexOf("A"), url.lastIndexOf("/"));
//	    	SVNUtil.saveSVnurlInfo(name, appId);
	    }
	}
 
Example 39
Project: PDFReporter-Studio   File: ParameterCellEditor.java   View Source Code Vote up 5 votes
@Override
protected Object openDialogBox(Control cellEditorWindow) {
	ParameterEditor wizard = new ParameterEditor();
	wizard.setValue((ParameterDTO) getValue());
	wizard.setExpressionContext(expContext);
	WizardDialog dialog = new WizardDialog(cellEditorWindow.getShell(), wizard);
	dialog.create();
	if (dialog.open() == Dialog.OK) {
		return wizard.getValue();
	}
	return null;
}
 
Example 40
Project: PDFReporter-Studio   File: ParameterCellEditor.java   View Source Code Vote up 5 votes
@Override
protected Object openDialogBox(Control cellEditorWindow) {
	ParameterEditor wizard = new ParameterEditor();
	wizard.setValue((ParameterDTO) getValue());
	wizard.setExpressionContext(expContext);
	WizardDialog dialog = new WizardDialog(cellEditorWindow.getShell(), wizard);
	dialog.create();
	if (dialog.open() == Dialog.OK) {
		return wizard.getValue();
	}
	return null;
}
 
Example 41
Project: PDFReporter-Studio   File: VErrorPreview.java   View Source Code Vote up 5 votes
public static boolean openExpressionEditor(JasperReportsConfiguration jContext,
		JRExpressionCollector reportCollector, JRDesignDataset dataset, JRDesignExpression exp) {
	SelectionHelper.getActiveJRXMLEditor();

	JRExpressionCollector datasetCollector = reportCollector.getCollector(dataset);
	List<JRExpression> datasetExpressions = datasetCollector.getExpressions();
	for (JRExpression expr : datasetExpressions) {
		if (expr.getId() == exp.getId()) {
			if (!ExpressionEditorSupportUtil.isExpressionEditorDialogOpen()) {
				JRExpressionEditor wizard = new JRExpressionEditor();
				wizard.setExpressionContext(new ExpressionContext(dataset, jContext));
				wizard.setValue(exp);
				WizardDialog dialog = ExpressionEditorSupportUtil.getExpressionEditorWizardDialog(Display.getDefault()
						.getActiveShell(), wizard);
				if (dialog.open() == Dialog.OK) {
					JRExpression e = wizard.getValue();
					IEditorPart activeJRXMLEditor = SelectionHelper.getActiveJRXMLEditor();
					if (activeJRXMLEditor != null && activeJRXMLEditor instanceof JrxmlEditor) {
						JrxmlEditor editor = (JrxmlEditor) activeJRXMLEditor;
						CommandStack cs = (CommandStack) editor.getAdapter(CommandStack.class);
						if (cs != null) {
							cs.execute(new SetExpressionValueCommand((JRDesignExpression) expr, e.getText(), e.getValueClassName()));
							jContext.getJasperDesign().getEventSupport()
									.firePropertyChange(JasperDesign.PROPERTY_NAME, true, false);
						}
					}
				}
			}
			return true;
		}
	}
	return false;
}
 
Example 42
Project: PDFReporter-Studio   File: TextStyleView.java   View Source Code Vote up 5 votes
/**
 * Create operation for a TextStyle, open the dialog to set the style attributes
 * 
 */
private void doCreate(){
	TextStyleWizard wizard = new TextStyleWizard(true, null);
	WizardDialog dialog = getEditorDialog(wizard);
	if (dialog.open() == Dialog.OK) {
		TextStyle newStyle = wizard.getTableStyle();
		TemplateStyleView.getTemplateStylesStorage().addStyle(newStyle);
	}
}
 
Example 43
Project: PDFReporter-Studio   File: ExportMetadataAction.java   View Source Code Vote up 5 votes
@Override
public void run() {
	StructuredSelection selection = (StructuredSelection) treeViewer.getSelection();

	ExportMetadataWizard wizard = new ExportMetadataWizard(selection);
	WizardDialog dialog = new WizardDialog(UIUtils.getShell(), wizard);
	dialog.create();
	if (dialog.open() == Dialog.OK) {

	}
}
 
Example 44
Project: IDRT-Import-and-Mapping-Tool   File: UploadProjectCommand.java   View Source Code Vote up 5 votes
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	
	UploadProjectWizard wiz = new UploadProjectWizard();
	WizardDialog wizardDialog = new WizardDialog(Application.getShell(),
			wiz);
	wizardDialog.open();
	return null;
}
 
Example 45
Project: scenarioo-example-swtbot-e4   File: OrderCreateHandler.java   View Source Code Vote up 5 votes
@Execute
public void execute(final Shell shell, final OrderService orderService, final ArticleService articleSerice) {

	LOGGER.info(this.getClass().getSimpleName() + " called");

	WizardDialog dialog = new WizardDialog(shell, new NewOrderWizard(orderService, articleSerice));
	Window.setDefaultImage(OrderPluginImages.ORDER.getImage());
	dialog.open();
}
 
Example 46
Project: n4js   File: WorkingSetConfigurationDialog.java   View Source Code Vote up 4 votes
private void editSelectedWorkingSet() {
	if (manager instanceof MutableWorkingSetManager) {
		final IStructuredSelection selection = tableViewer.getStructuredSelection();
		final Object firstElement = selection.getFirstElement();
		if (firstElement instanceof WorkingSet) {
			final WorkingSet oldState = (WorkingSet) firstElement;
			if (!OTHERS_WORKING_SET_ID.equals(oldState.getId())) {
				final WorkingSetEditWizard wizard = ((MutableWorkingSetManager) manager).createEditWizard();

				wizard.init(PlatformUI.getWorkbench(), selection);
				// make sure the wizard validates against changed set of working set of this dialog
				wizard.setAllWorkingSets(this.allWorkingSets);

				final WizardDialog dialog = new WizardDialog(getShell(), wizard);
				if (dialog.open() == Window.OK) {
					final WorkingSet newState = wizard.getWorkingSet().orNull();
					diffBuilder.edit(oldState, newState);
					getShell().getDisplay().asyncExec(new Runnable() {

						@Override
						public void run() {
							int oldStateIndex = allWorkingSets.indexOf(oldState);

							// if the old element is not in the list of all working sets
							if (-1 == oldStateIndex) {
								// abort the edit operation
								return;
							}

							// replace old state with new state in allWorkingSets
							allWorkingSets.remove(oldState);
							allWorkingSets.add(oldStateIndex, newState);

							// replace table viewer element
							tableViewer.replace(newState, oldStateIndex);

							// always check edited working set elements
							tableViewer.setChecked(newState, true);
							// set selection to newState element
							tableViewer.setSelection(new StructuredSelection(newState));
						}

					});
				}
			}
		}
	}
}
 
Example 47
Project: gemoc-studio-modeldebugging   File: CreateDomainModelWizardContextAction.java   View Source Code Vote up 4 votes
protected void createNewEMFProject() {
	// launch the appropriate wizard

	// "org.eclipse.emf.importer.ui.EMFProjectWizard" = create EMFProject
	// from existing Ecore file

	IWizardDescriptor descriptor = WizardFinder
			.findNewWizardDescriptor("org.eclipse.ecoretools.emf.design.wizardID");

	// Then if we have a wizard, open it.
	if (descriptor != null) {
		// add a listener to capture the creation of the resulting project
		NewProjectWorkspaceListener workspaceListener = new NewProjectWorkspaceListener();
		ResourcesPlugin.getWorkspace().addResourceChangeListener(
				workspaceListener);
		try {
			IWizard wizard;
			wizard = descriptor.createWizard();
			// this wizard need some dedicated initialization
			((EcoreModelerWizard) wizard)
					.setInitialProjectName(MelangeXDSMLProjectHelper
							.baseProjectName(gemocLanguageIProject)
							+ ".model");
			((EcoreModelerWizard) wizard).init(PlatformUI.getWorkbench(),
					(IStructuredSelection) PlatformUI.getWorkbench()
							.getActiveWorkbenchWindow()
							.getSelectionService().getSelection());
			// ((EcoreModelWizard)wizard).init(PlatformUI.getWorkbench(),
			// (IStructuredSelection) selection);
			WizardDialog wd = new WizardDialog(PlatformUI.getWorkbench()
					.getActiveWorkbenchWindow().getShell(), wizard);
			wd.create();
			wd.setTitle(wizard.getWindowTitle());

			int res = wd.open();
			if (res == WizardDialog.OK) {
				ResourcesPlugin.getWorkspace()
						.removeResourceChangeListener(workspaceListener);
				createdProject = workspaceListener
						.getLastCreatedProject();
				// update the project configuration model
				if (createdProject != null) {
					addEMFProjectToConf(createdProject);
				}
			}
		} catch (CoreException e) {
			Activator.error(e.getMessage(), e);
		} finally {
			// make sure to remove listener in all situations
			ResourcesPlugin.getWorkspace().removeResourceChangeListener(
					workspaceListener);
		}
	}
}
 
Example 48
Project: gemoc-studio-modeldebugging   File: CreateAnimatorProjectWizardContextAction.java   View Source Code Vote up 4 votes
protected void createNewODProject() {
	final IWizardDescriptor descriptor = WizardFinder
			.findNewWizardDescriptor(org.eclipse.gemoc.xdsmlframework.extensions.sirius.Activator.PLUGIN_ID
					+ ".wizards.NewGemocDebugRepresentationWizard");
	// Then if we have a wizard, open it.
	if (descriptor != null) {
		NewProjectWorkspaceListener workspaceListener = new NewProjectWorkspaceListener();
		ResourcesPlugin.getWorkspace().addResourceChangeListener(
				workspaceListener);
		try {
			IWorkbenchWizard wizard;
			wizard = descriptor.createWizard();
			((NewGemocDebugRepresentationWizard) wizard).setInitialProjectName(gemocLanguageIProject.getName());
			if(melangeLanguage != null){
				((NewGemocDebugRepresentationWizard) wizard)
				.setInitialLanguageName(melangeLanguage.getName());
			}
			IWorkbench workbench = PlatformUI.getWorkbench();
			wizard.init(workbench, null);
			WizardDialog wd = new WizardDialog(workbench
					.getActiveWorkbenchWindow().getShell(), wizard);
			wd.create();
			wd.setTitle(wizard.getWindowTitle());
			int res = wd.open();
			if (res == WizardDialog.OK) {
				ResourcesPlugin.getWorkspace()
						.removeResourceChangeListener(workspaceListener);
				IProject createdProject = workspaceListener
						.getLastCreatedProject();
				// update the project configuration model
				if (createdProject != null) {
					/* SiriusAnimatorProject animatorProject = Xdsml_baseFactoryImpl.eINSTANCE
							.createSiriusAnimatorProject();
					animatorProject
							.setProjectName(createdProject.getName());
					addOrUpdateProjectToConf(animatorProject); */
					// DVK may be we should update something the melange files ?
				} else {
					Activator
							.error("not able to detect which project was created by wizard",
									null);
				}
			}
		} catch (CoreException e) {
			Activator.error(e.getMessage(), e);
		} finally {
			ResourcesPlugin.getWorkspace().removeResourceChangeListener(
					workspaceListener);
		}
	} else {
		Activator
				.error("wizard with id=org.eclipse.gemoc.xdsmlframework.extensions.sirius.wizards.NewGemocDebugRepresentationWizard not found",
						null);
	}
}
 
Example 49
Project: gemoc-studio-modeldebugging   File: CreateEditorProjectWizardContextAction.java   View Source Code Vote up 4 votes
protected void createNewODProject() {
	final IWizardDescriptor descriptor = WizardFinder
			.findNewWizardDescriptor("org.eclipse.gemoc.xdsmlframework.extensions.sirius.wizards.NewGemocSiriusProjectWizard");
	// Then if we have a wizard, open it.
	if (descriptor != null) {
		NewProjectWorkspaceListener workspaceListener = new NewProjectWorkspaceListener();
		ResourcesPlugin.getWorkspace().addResourceChangeListener(
				workspaceListener);
		try {
			IWorkbenchWizard wizard;
			wizard = descriptor.createWizard();
			 ((NewGemocSiriusProjectWizard)wizard).setInitialProjectName(MelangeXDSMLProjectHelper
					                                                .baseProjectName(gemocLanguageIProject));

			IWorkbench workbench = PlatformUI.getWorkbench();
			wizard.init(workbench, null);
			WizardDialog wd = new WizardDialog(workbench
					.getActiveWorkbenchWindow().getShell(), wizard);
			wd.create();
			wd.setTitle(wizard.getWindowTitle());

			int res = wd.open();
			if (res == WizardDialog.OK) {
				ResourcesPlugin.getWorkspace()
						.removeResourceChangeListener(workspaceListener);
				createdProject = workspaceListener
						.getLastCreatedProject();
				// update the project configuration model
				if (createdProject != null) {
					// maybe we should do something in the melange file ?
				} else {
					Activator
							.error("not able to detect which project was created by wizard",
									null);
				}
			}
		} catch (CoreException e) {
			Activator.error(e.getMessage(), e);
		} finally {
			ResourcesPlugin.getWorkspace().removeResourceChangeListener(
					workspaceListener);
		}
	} else {
		Activator
				.error("wizard with id=org.eclipse.sirius.ui.specificationproject.wizard not found",
						null);
	}
}
 
Example 50
Project: Tarski   File: MarkerMapping.java   View Source Code Vote up 4 votes
private void goForRelPage(final IMarker iMarker) {
  final MappingWizard relationWizard = new MappingWizard(iMarker, true);

  final WizardDialog dialog = new WizardDialog(MarkerActivator.getShell(), relationWizard);
  dialog.open();
}
 
Example 51
Project: Tarski   File: AddRemoveTypeCommand.java   View Source Code Vote up 4 votes
private static void addType(final IMarker selectedMarker) {
  final MarkerWizard markerWizard = new MarkerWizard(selectedMarker);
  final WizardDialog dialog = new WizardDialog(Activator.getShell(), markerWizard);
  dialog.open();
}
 
Example 52
Project: convertigo-eclipse   File: HtmlConnectorDesignComposite.java   View Source Code Vote up 4 votes
public void createStatementFromGenerator(Document dom) {
	// Retrieve selected statement generator xpath
	String statementGeneratorXpath = xpathEvaluator.getSelectionXpath();
	
	// retrieve element on which generate a statement 
	// every test has been done before activating the button, no need to do them again
	Element element = (Element)(dom.getDocumentElement().getChildNodes().item(0));
	boolean clickable = false, valuable = false, checkable = false, selectable = false, radioable = false, formable = false;

	if(element.getTagName().equalsIgnoreCase("A")){
		clickable = true;
	}else if(element.getTagName().equalsIgnoreCase("INPUT")){
		String type = element.getAttribute("type");
		clickable = Arrays.binarySearch( new String[]{"button", "checkbox", "radio", "submit"}, type)>-1; //warning, must be sort
		valuable = Arrays.binarySearch( new String[]{"", "password", "text"}, type)>-1; //warning, must be sort
		checkable = Arrays.binarySearch( new String[]{"checkbox", "radio"}, type)>-1; //warning, must be sort
		radioable = type.equals("radio");
	}else if(element.getTagName().equalsIgnoreCase("TEXTAREA")){
		valuable = true;
	}else if(element.getTagName().equalsIgnoreCase("SELECT")){
		selectable = true;
	}else if(element.getTagName().equalsIgnoreCase("FORM")){
		formable = true;
	}
	
	// Retrieve parent Statement
	StatementWithExpressions parentObject = getParentStatement();
	
	// launch wizard
	StatementGeneratorWizard statementGeneratorWizard = new StatementGeneratorWizard(parentObject, 
																					statementGeneratorXpath, 
																					new boolean[] {	clickable, 
																									valuable, 
																									checkable, 
																									selectable, 
																									radioable, 
																									formable
																								}
																					);
	
	WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), statementGeneratorWizard);
	wzdlg.open();
	if (wzdlg.getReturnCode() != Window.CANCEL) {
		// TODO
	}
}
 
Example 53
Project: pgcodekeeper   File: NewDiffProjectAction.java   View Source Code Vote up 4 votes
public NewDiffProjectAction(){
    WizardDialog dialog = new WizardDialog(
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
            new DiffWizard(null, Activator.getDefault().getPreferenceStore()));
    dialog.open();
}
 
Example 54
Project: convertigo-eclipse   File: HtmlConnectorDesignComposite.java   View Source Code Vote up 4 votes
public void createScreenClassFromSelection() throws EngineException {
	String className = "com.twinsoft.convertigo.beans.core.ScreenClass";
	
	// Retrieve selected criteria xpath
	String criteriaXpath = xpathEvaluator.getSelectionXpath();

	// Retrieve parent ScreenClass
	HtmlScreenClass parentObject = getParentHtmlScreenClass();
	
	NewObjectWizard newObjectWizard = new NewObjectWizard(parentObject, className);
	WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), newObjectWizard);
	wzdlg.setPageSize(850, 650);
	wzdlg.open();
	if (wzdlg.getReturnCode() != Window.CANCEL) {
		HtmlScreenClass htmlScreenClass = (HtmlScreenClass)newObjectWizard.newBean;
		if (htmlScreenClass != null) {
			String screenClassName = htmlScreenClass.getName();
			
			// Add criteria to screen class
			createCriteria(htmlScreenClass, criteriaXpath);
			
			// Set detected ScreenClass to newly created one
			if (htmlConnector.isLearning()) {
				detectedScreenClass = htmlScreenClass;
				ConvertigoPlugin.logDebug2("(HtmlConnectorDesignComposite) Detected screen class is set to newly created one named '"+ screenClassName +"'");
			}
			else {
				ConvertigoPlugin.logDebug2("(HtmlConnectorDesignComposite) New screen class named '"+ screenClassName +"' has been added");
			}

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

			// Set selection on newly created screenclass
			fireObjectSelected(new CompositeEvent(htmlScreenClass));

			// Highlight new detected ScreenClass in Tree
			if (htmlConnector.isLearning())
				Engine.theApp.fireObjectDetected(new EngineEvent(htmlScreenClass));

			//TODO:toolScreenclass.setEnabled(false);
		}
	}
}
 
Example 55
Project: DarwinSPL   File: ExampleCreationCommandHandler.java   View Source Code Vote up 4 votes
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {

	// IFile featureModelFile =
	// SelectionUtil.getFirstSelectedIFileWithExtension("hyfeature");
	//
	// if (featureModelFile == null) {
	// //TODO: Error
	// return null;
	// }
	//
	// HyFeatureModel featureModel =
	// EcoreIOUtil.loadModel(featureModelFile);
	//
	// try {
	// DEFeatureModel exportedFeatureModel = (DEFeatureModel)
	// exporter.exportValidFeatureModel(featureModel);
	// IFile exportedFile = ResourceUtil.deriveFile(featureModelFile,
	// "feature");
	// EcoreIOUtil.saveModelAs(exportedFeatureModel, exportedFile);
	// } catch(HyFeatureModelWellFormednessException e) {
	// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
	// public void run() {
	// Shell activeShell =
	// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
	// final String PID = "HFM Exporter Plugin";
	// MultiStatus info = new MultiStatus(PID, 1, e.getMessage(), null);
	// ErrorDialog.openError(activeShell, "HyFM not well formed!", null,
	// info);
	// }
	// });
	// e.printStackTrace();
	// }

	Map<String, Class<? extends HyFMExample>> availableExamples = new HashMap<String, Class<? extends HyFMExample>>();
	availableExamples.put("VaMoS Example", CarAssistanceExample.class);
	availableExamples.put("VaMoS Reconf Example", VamosReconfExample.class);
	availableExamples.put("HyVar Use Cases", HyVarUseCases.class);
	availableExamples.put("HyVar GM", HyVarUseCaseGM.class);
	
	availableExamples.put("Isola Example", IsolaExample.class);

	availableExamples.put("HyVarUseCaseReview", HyVarUseCaseOne.class);
	
	availableExamples.put("Small Evolution Example", SmallEvolutionExample.class);
	
	ExampleSelectionWizard exampleSelectionWizard = new ExampleSelectionWizard(availableExamples);

	Shell activeShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();

	WizardDialog wizardDialog = new WizardDialog(activeShell, exampleSelectionWizard);
	wizardDialog.open();
	
	
	return null;
}
 
Example 56
Project: team-explorer-everywhere   File: MergeTask.java   View Source Code Vote up 4 votes
@Override
public IStatus run() {

    final MergeWizard mergeWizard = new MergeWizard(repository, sourcePath);
    final WizardDialog mergeDialog = new WizardDialog(getShell(), mergeWizard);

    mergeWizard.setNeedsProgressMonitor(true);

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

    MergeFlags mergeFlags = mergeWizard.getMergeFlags();

    /* Mix-in the "no auto resolve" preference, if set. */
    if (!TFSCommonUIClientPlugin.getDefault().getPreferenceStore().getBoolean(
        UIPreferenceConstants.AUTO_RESOLVE_CONFLICTS)) {
        mergeFlags = mergeFlags.combine(MergeFlags.NO_AUTO_RESOLVE);
    }

    final MergeCommand mergeCommand = new MergeCommand(
        repository,
        mergeWizard.getSourcePath(),
        mergeWizard.getTargetPath(),
        mergeWizard.getFromVersion(),
        mergeWizard.getToVersion(),
        LockLevel.UNCHANGED,
        RecursionType.FULL,
        mergeFlags);

    final IStatus mergeStatus = getCommandExecutor().execute(new ResourceChangingCommand(mergeCommand));

    try {
        if (mergeStatus.getSeverity() == IStatus.ERROR) {
            return mergeStatus;
        }

        if (mergeCommand.hasConflicts()) {
            final ConflictDescription[] conflicts = mergeCommand.getConflictDescriptions();

            final ConflictResolutionTask conflictTask =
                new ConflictResolutionTask(getShell(), repository, conflicts);
            conflictTask.run();
        } else if (!mergeStatus.isOK()) {
            if (mergeStatus.getSeverity() == IStatus.INFO) {
                MessageDialog.openInformation(
                    getShell(),
                    Messages.getString("MergeTask.NoChangesToMergeDialogTitle"), //$NON-NLS-1$
                    mergeStatus.getMessage());

                return Status.OK_STATUS;
            }
            return mergeStatus;
        }

        return mergeStatus;
    } finally {
        final ICommand refreshCommand = new RefreshPendingChangesCommand(repository);
        getCommandExecutor().execute(refreshCommand);

        CodeMarkerDispatch.dispatch(CODEMARKER_MERGE_TASK_COMPLETE);
    }
}
 
Example 57
Project: subclipse   File: CheckoutWizardAction.java   View Source Code Vote up 4 votes
public void execute(IAction action) throws InvocationTargetException, InterruptedException {	    
    CheckoutWizard wizard = new CheckoutWizard();
    WizardDialog dialog = new ClosableWizardDialog(shell, wizard);
    dialog.open();
}
 
Example 58
Project: PDFReporter-Studio   File: CreatePercentageCommand.java   View Source Code Vote up 4 votes
/**
 * Creates the object.
 */
@Override
protected void createObject() {
	if (jrElement == null) {
		JRCloneable field = null;
		ResetTypeEnum rtype = ResetTypeEnum.REPORT;
		JRGroup group = null;

		PercentageWizard wizard = new PercentageWizard();
		WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
		wizard.init(jasperDesign);
		dialog.create();
		if (dialog.open() == Dialog.OK) {
			field = wizard.getField();
			rtype = wizard.getResetType();
			group = wizard.getGroup();

			super.createObject();
			if (field != null) {
				JRDesignTextField tf = (JRDesignTextField) jrElement;
				
				
				// Create the expressions based of the reset type selected by the user...
				JRDesignVariable variable = null;
				try {
					if (field instanceof JRField)
					{
						variable = createVariable(((JRField) field).getName(),
								((JRField) field).getValueClassName(), rtype, group);
						
					}
					else if (field instanceof JRVariable)
					{
						variable = createVariable(((JRVariable) field).getName(),
								((JRVariable) field).getValueClassName(), rtype, group);
					}
					
					if (variable == null)
					{
						return; // we don't want to continue in this case...
					}
					
					jasperDesign.addVariable(variable);
					
				} catch (Exception e) {
					UIUtils.showError(e);
					
				}
				
				JRDesignExpression expression = new JRDesignExpression();
				if (field instanceof JRField)
					expression.setText(createExpression(((JRField) field).getName(), variable.getName(), ((JRField) field).getValueClass()));
				if (field instanceof JRVariable)
					expression.setText(createExpression(((JRVariable) field).getName(), variable.getName(), ((JRVariable) field).getValueClass()));
				tf.setExpression(expression);
				tf.setPattern("#,##0.00%");
				
				// Set the evaluation time of this textfield to AUTO
				tf.setEvaluationTime( net.sf.jasperreports.engine.type.EvaluationTimeEnum.AUTO);

				
			}
		}
	}
}
 
Example 59
Project: chromedevtools   File: PushChangesWizard.java   View Source Code Vote up 4 votes
public static void start(final List<? extends ScriptTargetMapping> filePairs, Shell shell,
    final ErrorPositionHighlighter positionHighlighter) {
  // Create pages.
  final PageImpl<ChooseVmPageElements> chooseVmPage = new PageImpl<ChooseVmPageElements>(
      "choose VM", //$NON-NLS-1$
      CHOOSE_VM_PAGE_FACTORY,
      Messages.PushChangesWizard_CHOOSE_VM,
      Messages.PushChangesWizard_CHOOSE_VM_DESCRIPTION);

  final PageImpl<V8PreviewPageElements> v8PreviewPage = new PageImpl<V8PreviewPageElements>(
      "v8 preview", //$NON-NLS-1$
      V8_PREVIEW_PAGE_FACTORY,
      Messages.PushChangesWizard_V8_PREVIEW,
      Messages.PushChangesWizard_V8_PREVIEW_DESCRIPTION);
  final PageImpl<PageElements> multipleVmStubPage = new PageImpl<PageElements>(
      "multiple vm", //$NON-NLS-1$
      MULTIPLE_VM_STUB_PAGE_FACTORY,
      Messages.PushChangesWizard_MULTIPLE_VM,
      Messages.PushChangesWizard_MULTIPLE_VM_DESCRIPTION);

  final PageSet pageSet = new PageSet() {
    public List<? extends PageImpl<?>> getAllPages() {
      return Arrays.<PageImpl<?>>asList(chooseVmPage, v8PreviewPage,
          multipleVmStubPage);
    }
    public PageImpl<ChooseVmPageElements> getChooseVmPage() {
      return chooseVmPage;
    }
    public PageImpl<V8PreviewPageElements> getV8PreviewPage() {
      return v8PreviewPage;
    }
    public PageImpl<PageElements> getMultipleVmStubPage() {
      return multipleVmStubPage;
    }
    public WizardLogic createLogic(final LogicBasedWizard wizardImpl) {
      WizardLogicBuilder logicBuilder = new WizardLogicBuilder(this, wizardImpl);
      return logicBuilder.create(filePairs, positionHighlighter);
    }
  };

  // Start wizard engine.
  LogicBasedWizard wizard = new LogicBasedWizard(pageSet);
  wizard.setWindowTitle(Messages.PushChangesWizard_TITLE);
  WizardDialog wizardDialog = new WizardDialog(shell, wizard);
  wizardDialog.open();
}
 
Example 60
Project: ModelDebugging   File: CreateEditorProjectWizardContextAction.java   View Source Code Vote up 4 votes
protected void createNewODProject() {
	final IWizardDescriptor descriptor = WizardFinder
			.findNewWizardDescriptor("org.eclipse.gemoc.xdsmlframework.extensions.sirius.wizards.NewGemocSiriusProjectWizard");
	// Then if we have a wizard, open it.
	if (descriptor != null) {
		NewProjectWorkspaceListener workspaceListener = new NewProjectWorkspaceListener();
		ResourcesPlugin.getWorkspace().addResourceChangeListener(
				workspaceListener);
		try {
			IWorkbenchWizard wizard;
			wizard = descriptor.createWizard();
			 ((NewGemocSiriusProjectWizard)wizard).setInitialProjectName(MelangeXDSMLProjectHelper
					                                                .baseProjectName(gemocLanguageIProject));

			IWorkbench workbench = PlatformUI.getWorkbench();
			wizard.init(workbench, null);
			WizardDialog wd = new WizardDialog(workbench
					.getActiveWorkbenchWindow().getShell(), wizard);
			wd.create();
			wd.setTitle(wizard.getWindowTitle());

			int res = wd.open();
			if (res == WizardDialog.OK) {
				ResourcesPlugin.getWorkspace()
						.removeResourceChangeListener(workspaceListener);
				createdProject = workspaceListener
						.getLastCreatedProject();
				// update the project configuration model
				if (createdProject != null) {
					// maybe we should do something in the melange file ?
				} else {
					Activator
							.error("not able to detect which project was created by wizard",
									null);
				}
			}
		} catch (CoreException e) {
			Activator.error(e.getMessage(), e);
		} finally {
			ResourcesPlugin.getWorkspace().removeResourceChangeListener(
					workspaceListener);
		}
	} else {
		Activator
				.error("wizard with id=org.eclipse.sirius.ui.specificationproject.wizard not found",
						null);
	}
}