org.eclipse.jface.wizard.IWizardPage Java Examples

The following examples show how to use org.eclipse.jface.wizard.IWizardPage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ADocSpecExportWizard.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public IWizardPage getPreviousPage(IWizardPage page) {
	if (page == configAdocPage) {
		return null;
	}
	if (page == processAdocPage) {
		return configAdocPage;
	}
	if (page == comparePage) {
		return processAdocPage;
	}
	if (page == summaryPage) {
		return comparePage;
	}
	if (page == processOutputPage) {
		return null;
	}
	throw new RuntimeException("Missing page predecessor.");
}
 
Example #2
Source File: DataSourceSelectionPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public IWizardPage getNextPage( )
{
	if ( isCPSelected( ) )
		return getNextPageCP( );

	prevSelectedDataSourceType = getSelectedDataSource( );
	if ( prevSelectedDataSourceType instanceof ExtensionManifest )
	{
		String dataSourceElementID = ( (ExtensionManifest) prevSelectedDataSourceType ).getDataSourceElementID( );
		String dataSourceDisplayName = ( (ExtensionManifest) prevSelectedDataSourceType ).getDataSourceDisplayName( );
		String dataSourceExtensionID = ( (ExtensionManifest) prevSelectedDataSourceType ).getExtensionID( );
		IWizardPage nextPage = getExtensionDataSourcePage( dataSourceElementID,
				dataSourceDisplayName,
				dataSourceExtensionID );
		if ( nextPage != null )
			return nextPage;
	}
	return helper.getNextPage( prevSelectedDataSourceType );
}
 
Example #3
Source File: FilterImplementationWizard.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
  protected IWizardPage getDefinitionSelectionWizardPage(
  		List<ConnectorImplementation> existingImplementation) {
  	return new AbstractDefinitionSelectionImpementationWizardPage(implWorkingCopy,existingImplementation,((IDefinitionRepositoryStore) defStore).getDefinitions(),getPageTitle(),getPageDescription(),messageProvider){

	@Override
	protected ITreeContentProvider getContentProvider() {
		return new FilterUniqueDefinitionContentProvider();
	}
	
	@Override
	protected ITreeContentProvider getCustomContentProvider() {
		return  new FilterUniqueDefinitionContentProvider(true);
	}

	@Override
	protected void bindValue() {
		final IViewerObservableValue observeSingleSelection = ViewersObservables.observeSingleSelection(explorer.getRightTableViewer());
		context.bindValue(observeSingleSelection, EMFObservables.observeValue(implementation, ConnectorImplementationPackage.Literals.CONNECTOR_IMPLEMENTATION__DEFINITION_ID),defIdStrategy,defModelStrategy) ;
		context.bindValue(ViewersObservables.observeSingleSelection(versionCombo), EMFObservables.observeValue(implementation, ConnectorImplementationPackage.Literals.CONNECTOR_IMPLEMENTATION__DEFINITION_VERSION));
	}
	
};
  }
 
Example #4
Source File: NewMapReduceProjectWizard.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
@Override
public IWizardPage getNextPage(IWizardPage page) {
  // if (page == firstPage
  // && firstPage.generateDriver.getSelection()
  // )
  // {
  // return newDriverPage; // if "generate mapper" checked, second page is
  // new driver page
  // }
  // else
  // {
  IWizardPage answer = super.getNextPage(page);
  if (answer == newDriverPage) {
    return null; // dont flip to new driver page unless "generate
    // driver" is checked
  } else if (answer == javaPage) {
    return answer;
  } else {
    return answer;
  }
  // }
}
 
Example #5
Source File: ADocSpecExportWizard.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public IWizardPage getNextPage(IWizardPage page) {
	if (page == configAdocPage) {
		return processAdocPage;
	}
	if (page == processAdocPage) {
		if (getSpecChangeSet() == null || getSpecChangeSet().isEmpty())
			return processOutputPage;
		return comparePage;
	}
	if (page == comparePage) {
		return summaryPage;
	}
	if (page == summaryPage) {
		return processOutputPage;
	}
	if (page == processOutputPage) {
		return null;
	}
	throw new RuntimeException("Missing page successor.");
}
 
Example #6
Source File: ConnectorWizard.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
protected IWizardPage getOutputPageFor(final ConnectorDefinition definition) {
    AbstractConnectorOutputWizardPage outputPage = null;
    if (!definition.getOutput().isEmpty()) {
        if (!editMode && !supportsDatabaseOutputMode(getDefinition())) {
            connectorWorkingCopy.getOutputs().clear();
            createDefaultOutputs(definition);
        }
        if (extension != null && !extension.useDefaultOutputPage()) {
            outputPage = extension.getOutputPage();
        } else {
            if (supportsDatabaseOutputMode(definition)) {
                outputPage = new DatabaseConnectorOutputWizardPage();
            } else {
                outputPage = new ConnectorOutputWizardPage();
            }

        }
        outputPage.setMessageProvider(messageProvider);
        outputPage.setElementContainer(container);
        outputPage.setConnector(connectorWorkingCopy);
        outputPage.setDefinition(definition);
    }
    return outputPage;
}
 
Example #7
Source File: AbstractDefinitionWizardDialog.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void showPage(final IWizardPage page) {
    super.showPage(page);
    if (page instanceof AbstractConnectorConfigurationWizardPage || page instanceof SelectNameAndDescWizardPage) {
        final IConnectorDefinitionContainer wizard = (IConnectorDefinitionContainer) getWizard();
        final ConnectorDefinition defintion = wizard.getDefinition();
        final IRepositoryFileStore def = ((IRepositoryStore<? extends IRepositoryFileStore>) definitionRepositoryStore).getChild(URI.decode(defintion
                .eResource().getURI().lastSegment()), true);
        if (def != null) {
            final String displayName = def.getDisplayName();
            if (!displayName.equals(getShell().getText())) {
                getShell().setText(displayName);
            }
        }
    }
}
 
Example #8
Source File: TemplateNewFileWizard.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public IWizardPage getNextPage(IWizardPage page) {
	if (page instanceof NewFileWizardPrimaryPage && hasMoreThenOneTemplate()) {
		AbstractFileTemplate selectedTemplate = mainPage.getSelectedTemplate();
		List<TemplateVariable> variables = selectedTemplate.getVariables();
		if (variables.isEmpty())
			return null;
		selectedTemplate.setTemplateInfo(getFileInfo());
		TemplateParameterPage parameterPage = new TemplateParameterPage(selectedTemplate);

		parameterPage.setWizard(this);
		templateParameterPage = parameterPage;
		parameterPage.setTitle(page.getTitle());
		parameterPage.setDescription(page.getDescription());
		return parameterPage;
	}
	return super.getNextPage(page);
}
 
Example #9
Source File: ConnectorDefinitionWizardDialog.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void showPage(IWizardPage page) {
    super.showPage(page);
    if (page instanceof PageWidgetsWizardPage) {
        ExtensibleWizard wizard = (ExtensibleWizard) getWizard() ;
        wizard.addAdditionalPage(page) ;
        updateButtons() ;
        getButton(IDialogConstants.FINISH_ID).setText(Messages.apply) ;
        getButton(IDialogConstants.NEXT_ID).setVisible(false) ;
        getButton(IDialogConstants.BACK_ID).setVisible(false) ;
    } else {
        getButton(IDialogConstants.NEXT_ID).setVisible(true) ;
        getButton(IDialogConstants.BACK_ID).setVisible(true) ;
        getButton(IDialogConstants.FINISH_ID).setText(IDialogConstants.FINISH_LABEL);
    }
}
 
Example #10
Source File: NewMapReduceProjectWizard.java    From RDFS with Apache License 2.0 6 votes vote down vote up
@Override
public IWizardPage getNextPage(IWizardPage page) {
  // if (page == firstPage
  // && firstPage.generateDriver.getSelection()
  // )
  // {
  // return newDriverPage; // if "generate mapper" checked, second page is
  // new driver page
  // }
  // else
  // {
  IWizardPage answer = super.getNextPage(page);
  if (answer == newDriverPage) {
    return null; // dont flip to new driver page unless "generate
    // driver" is checked
  } else if (answer == javaPage) {
    return answer;
  } else {
    return answer;
  }
  // }
}
 
Example #11
Source File: CheckoutWizard.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public boolean canFinish() {
	IWizardPage page = getContainer().getCurrentPage();
	if (page == checkoutAsMultiplePage || page == projectPage) {
		return projectPage.isPageComplete();
	}
	if (page == checkoutAsWithoutProjectFilePage) {
		if (checkoutAsWithoutProjectFilePage.useWizard())
			return true;
		else
			return checkoutAsWithoutProjectFilePage.isPageComplete()
					&& projectPage.isPageComplete();
	}
	if (page == checkoutAsWithProjectFilePage) {
		return checkoutAsWithProjectFilePage.isPageComplete()
				&& projectPage.isPageComplete();
	}
	if (page == selectionPage || page instanceof SVNRepositoryProviderWizardPage) {
		return selectionPage.isPageComplete();
	}
	return super.canFinish();
}
 
Example #12
Source File: CreateTargetQueries.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public ICreateTargetQuery createNewPackageQuery() {
	return new ICreateTargetQuery() {
		public Object getCreatedTarget(Object selection) {
			IWorkbenchWizard packageCreationWizard= new NewPackageCreationWizard();

			IWizardPage[] pages= openNewElementWizard(packageCreationWizard, getShell(), selection);

			NewPackageWizardPage page= (NewPackageWizardPage) pages[0];
			return page.getNewPackageFragment();
		}

		public String getNewButtonLabel() {
			return ReorgMessages.ReorgMoveWizard_newPackage;
		}
	};
}
 
Example #13
Source File: ImportBluemixWizard.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
@Override
public IWizardPage getNextPage(IWizardPage page) {
    if (page == _zipFilePage) {
        return _importCopyMethodPage;
    } 
    else if (page == _importCopyMethodPage) {
        return _dirPage;
    }
    else if (page == _dirPage) {
        return _deployCopyMethodPage;
    }
    else if (page == _deployCopyMethodPage) {
        return _orgSpacePage;
    }
    
    return null;
}
 
Example #14
Source File: AssignJobWizard.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
@Override
public IWizardPage getNextPage(IWizardPage page) {
	if (page == assignChoicePage) {
		if(assignChoicePage.isAssignJob()){
			return assignJobPage;
		}else if(assignChoicePage.isCreateJob()){
			if(processWizard != null){
				processWizard.dispose();
			}
			processWizard = new NewProcessWizard(null);
			processWizard.setContainer(getContainer());
			processWizard.addPages();
			IWizardPage p = processWizard.getPages()[0];
			p.setWizard(this);
			return p;
		}
	}
	return null;
}
 
Example #15
Source File: TSWizardDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Update the receiver for the new page.
 * 
 * @param page
 */
private void updateForPage(IWizardPage page) {
	// ensure this page belongs to the current wizard
	if (wizard != page.getWizard()) {
		setWizard(page.getWizard());
	}
	// ensure that page control has been created
	// (this allows lazy page control creation)
	if (page.getControl() == null) {
		page.createControl(pageContainer);
		// the page is responsible for ensuring the created control is
		// accessible via getControl.
		Assert.isNotNull(page.getControl(), JFaceResources.format(
				JFaceResources.getString("WizardDialog.missingSetControl"), //$NON-NLS-1$
				new Object[] { page.getName() }));
		// ensure the dialog is large enough for this page
		updateSize(page);
	}
	// make the new page visible
	IWizardPage oldPage = currentPage;
	currentPage = page;

	currentPage.setVisible(true);
	if (oldPage != null) {
		oldPage.setVisible(false);
	}
	// update the dialog controls
	update();
}
 
Example #16
Source File: AbstractConnectorOutputWizardPage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public IWizardPage getPreviousPage() {
    if(previousPageBackup != null){
    	return previousPageBackup;
    }
	
	final IWizard wizard = getWizard();
    if(wizard != null){
        return wizard.getPreviousPage(this);
    }
    return super.getPreviousPage();
}
 
Example #17
Source File: PullUpMemberPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IWizardPage getNextPage() {
	initializeRefactoring();
	storeDialogSettings();
	if (getMethodsForAction(PULL_UP_ACTION).length == 0)
		return computeSuccessorPage();
       if (isDestinationInterface())
       	return computeSuccessorPage();
	return super.getNextPage();
}
 
Example #18
Source File: MSyncWizardOverviewPage.java    From slr-toolkit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This methods gets the chosen Bib-File and MendeleyFolder Selections.
 */
private void syncFolderSelection(){
	MSyncWizard myWiz = (MSyncWizard) this.getWizard();
	IWizardPage[] wpages = myWiz.getPages();
	this.folder_page = (MSyncWizardFolderPage)wpages[1];
	this.folder_selected = folder_page.getFolder_selected();
	((MSyncWizardFilePage)getWizard().getStartingPage()).getResourceSelected().setMendeleyFolder(folder_selected);
}
 
Example #19
Source File: UseSupertypeWizard.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IWizardPage getNextPage() {
	initializeRefactoring();
	IWizardPage nextPage= super.getNextPage();
	updateUpdateLabels();
	return nextPage;
}
 
Example #20
Source File: ConnectorDefinitionWizardDialog.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void cancelPressed() {
    if (getCurrentPage() instanceof PageWidgetsWizardPage) {
        ExtensibleWizard wizard = (ExtensibleWizard) getWizard() ;
        IWizardPage page = getCurrentPage() ;
        wizard.removeAdditionalPage(page,false) ;
        backPressed();
        if(page.getControl() != null){
            page.getControl().dispose() ;
        }

    } else {
        super.cancelPressed();
    }
}
 
Example #21
Source File: RemoteFetchLogWizardPage.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private void updateNextPage() {
    IWizardPage nextPage = getNextPage();
    if (nextPage instanceof RemoteFetchLogWizardRemotePage) {
        ((RemoteFetchLogWizardRemotePage) nextPage).setPageData(
                fProfile,
                fOverwriteExistingResourcesCheckbox != null ?
                        fOverwriteExistingResourcesCheckbox.getSelection() : false);
    }
}
 
Example #22
Source File: AssignJobWizard.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
@Override
public boolean performFinish() {
	IWizardPage currentPage = getContainer().getCurrentPage();
	if (currentPage == assignJobPage) {
		return assignJobPage.finish();
	} else if (currentPage == createJobPage && processWizard != null) {
		processWizard.performFinish();
		return newJobAction.createNewProcess(processWizard);

	}
	return false;
}
 
Example #23
Source File: ConfigurationWizardDialog.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void selectionChanged(SelectionChangedEvent event) {
    IWizardPage selectedPage = (IWizardPage) ((IStructuredSelection) event.getSelection()).getFirstElement();
    if (selectedPage != null && !selectedPage.equals(getCurrentPage())) {
        showPage(selectedPage);
    }
    updateButtons();
}
 
Example #24
Source File: TSWizardDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Computes the correct dialog size for the given page and resizes its shell if necessary.
 * 
 * @param page the wizard page
 */
private void updateSizeForPage(IWizardPage page) {
	// ensure the page container is large enough
	Point delta = calculatePageSizeDelta(page);
	if (delta.x > 0 || delta.y > 0) {
		// increase the size of the shell
		Shell shell = getShell();
		Point shellSize = shell.getSize();
		setShellSize(shellSize.x + delta.x, shellSize.y + delta.y);
		constrainShellSize();
	}
}
 
Example #25
Source File: ConnectorWizard.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addPages() {
    initialize();
    if (!editMode) {
        selectionPage = getSelectionPage(connectorWorkingCopy,
                messageProvider);
        addPage(selectionPage);
    }
    final IWizardPage nameAndDescriptionPage = getNameAndDescriptionPage();
    if (nameAndDescriptionPage != null) {
        addPage(nameAndDescriptionPage);
    }

    if (editMode) {
        final IDefinitionRepositoryStore definitionStore = getDefinitionStore();
        final ConnectorDefinition definition = definitionStore
                .getDefinition(connectorWorkingCopy.getDefinitionId(),
                        connectorWorkingCopy.getDefinitionVersion());
        final AbstractDefFileStore fStore = (AbstractDefFileStore) ((AbstractDefinitionRepositoryStore<?>) definitionStore)
                .getChild(URI.decode(definition.eResource().getURI()
                        .lastSegment()), true);
        if (!fStore.isReadOnly() && cleanConfiguration(definition)) {
            MessageDialog.openWarning(
                    Display.getDefault().getActiveShell(),
                    Messages.configurationChangedTitle,
                    Messages.configurationChangedMsg);
        }
        extension = findCustomWizardExtension(definition);
        final List<IWizardPage> pages = getPagesFor(definition);
        for (final IWizardPage p : pages) {
            addAdditionalPage(p);
        }
        addOuputPage(definition);
    }else {
        selectionPage.addConnectorDefinitionFilter(new DeprecatedConnectorViewerFilter());
    }

}
 
Example #26
Source File: DataSetBasePage.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public IWizardPage getExtensionDataSetNextPage( String dataSourceID,
		String dataSetID, DataSourceHandle dataSource, String dataSetName )
{
	this.dataSetID = dataSetID;
	this.dataSource = dataSource;
	this.dataSetName = dataSetName;

	setPageComplete( true );
	isUseODAV3( dataSourceID );
	return getDataSetPage( );
}
 
Example #27
Source File: TemplateNewProjectWizard.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IWizardPage getPreviousPage(IWizardPage page) {
	if (page instanceof TemplateParameterPage) {
		templateParameterPage = null;
		return templatePage;
	}
	return super.getPreviousPage(page);
}
 
Example #28
Source File: ConfigBluemixWizard.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
@Override
public IWizardPage getNextPage(IWizardPage page) {
    if (page == _dirPage) {
        if (ConfigManager.getInstance().getConfigFromDirectory(_dirPage.getDirectory()).isValid(false)) {
            // There's a config in the chosen directory
            return _configPage;
        } else {
            return _copyMethodPage;
        }
    } else if (page == _copyMethodPage) {
        return _cloudSpacePage;
    } else if (page == _cloudSpacePage) {
        if (ManifestUtil.getManifestFile(_dirPage.getDirectory()).exists()) {
            // There's a manifest in the chosen directory
            return _manifestPage;
        } else {
            return _namePage;
        }
    } else if (page == _configPage) {
        if (!_configPage.getUseExistingConfig()) {
            // User has chosen to overwrite the existing config
            return _copyMethodPage;
        }
    } else if (page == _manifestPage) {
        if (!_manifestPage.getUseExistingManifest()) {
            // User has chosen to overwrite the existing manifest
            return _namePage;
        }            
    }
    return null;
}
 
Example #29
Source File: ManageOrganizationWizard.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void createPageControls(Composite pageContainer) {
    super.createPageControls(pageContainer);
    organizationToEdit.ifPresent(orga -> {
        for (final IWizardPage p : getPages()) {
            if (p instanceof AbstractOrganizationWizardPage) {
                ((AbstractOrganizationWizardPage) p).setOrganization(orga);
            }
        }
    });
}
 
Example #30
Source File: SharingWizard.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
    * check if wizard can finish 
    */
public boolean canFinish() {
	IWizardPage page = getContainer().getCurrentPage();
	if (page == directoryPage) {
		return directoryPage.useProjectName() || directoryPage.getDirectoryName() != null;
	} else if (page == finishPage) {
		return true;
	}
	return super.canFinish();
}