org.eclipse.jface.wizard.WizardPage Java Examples

The following examples show how to use org.eclipse.jface.wizard.WizardPage. 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: BaseTemplate.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Locates the page that this option is presented in and flags that the
 * option
 * is required and is currently not set. The flagging is done by setting the
 * page incomplete and setting the error message that uses option's message
 * label.
 *
 * @param option
 *            the option that is required and currently not set
 */
protected void flagErrorMessage ( final TemplateOption option, final String newMessage, final int newType )
{
    for ( int i = 0; i < getPageCount (); i++ )
    {
        final WizardPage page = getPage ( i );
        for ( final TemplateOption pageOption : getOptions ( i ) )
        {
            if ( pageOption.equals ( option ) )
            {
                page.setPageComplete ( false );
                page.setMessage ( newMessage, newType );
            }
        }
    }
}
 
Example #2
Source File: WizardStartPage.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
@Override
public WizardPage getNextPage() {
    refreshData();
    
    if(wizardData.pageList.size() > 0) {
        // Add the first sub page
        WizardDataSub pd = wizardData.pageList.get(0);
        if (pd != null) {
            if (pd.wizardPage[0] == null) {
                pd.wizardPage[0] = new WizardSubPageMain(pd);
                ((Wizard)(getWizard())).addPage(pd.wizardPage[0]);
            }
            return(pd.wizardPage[0]);
        }
    }
    return(null);
}
 
Example #3
Source File: WizardSubPage.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
@Override
public WizardPage getNextPage() {
    refreshData();
    
    // Get the Next Sub Main Page
    // If pages provide more Sub Pages this function
    // should be overridden
    int newPageNumber = getSubPageNumber()+1;
    if(newPageNumber < wizardData.getPageCount()) {
        WizardDataSub pd = wizardData.pageList.get(newPageNumber);
        if(pd != null) {
            if (pd.wizardPage[0] == null) {
                pd.wizardPage[0] = new WizardSubPageMain(pd);
                ((Wizard)getWizard()).addPage(pd.wizardPage[0]);
            }
            return(pd.wizardPage[0]);
        }
    }
    return null;
}
 
Example #4
Source File: WizardSubPageDataSource.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
@Override
public WizardPage getNextPage() {
    refreshData();
    switch(dsType) {
        case DS_VIEW:
            if (!(pageData.wizardPage[2] instanceof WizardSubPageDataView)) {
                pageData.wizardPage[2] = new WizardSubPageDataView(pageData);
                ((Wizard)getWizard()).addPage(pageData.wizardPage[2]);
            }
            return(pageData.wizardPage[2]);

        case DS_DOC:
            if (!(pageData.wizardPage[2] instanceof WizardSubPageFormTable)) {
                pageData.wizardPage[2] = new WizardSubPageFormTable(pageData);
                ((Wizard)getWizard()).addPage(pageData.wizardPage[2]);
            }
            return(pageData.wizardPage[2]);
    }        
    return null;
}
 
Example #5
Source File: ApplicationLayoutDropWizard.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
@Override
public void handlePageChanging(final PageChangingEvent event) {
    // Assume success
    event.doit = true;

    // Get the current and target pages
    WizardPage currPage = (WizardPage)event.getCurrentPage();
    WizardPage targetPage = (WizardPage)event.getTargetPage();
    
    if ((currPage instanceof AlwStartPage) && (targetPage instanceof AlwPropertiesPage)) {
        // Moving from first to second page
        LayoutConfig lc = getStartPage().getSelectedLayoutConfig();
        if (lc != null) {
            String errorMsg = "This configuration is in a library that is not yet enabled in this application.\nEnabling the library will add it as a dependency in Xsp Properties.\nXsp Properties is currently open in another editor and cannot be modified.\nClose Xsp Properties in order to proceed.";  // $NLX-ApplicationLayoutDropWizard.Thisconfigurationisinalibrarythat-1$
            String proceedMsg = "This configuration is in a library that is not yet enabled in this application.\nEnabling the library will add it as a dependency in Xsp Properties.\nClick Continue to update your Xsp Properties."; // $NLX-ApplicationLayoutDropWizard.Thisconfigurationisinalibrarythat.1-1$
            event.doit = WizardUtils.findStandardDefAndAddDependency(lc.facesDef.getNamespaceUri(), lc.tagName, _panelData.getDesignerProject(), errorMsg, proceedMsg); 
        }
    }        
}
 
Example #6
Source File: AbstractBluemixWizard.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
protected boolean runJob(IRunnableWithProgress runnable) {
    // Clear any errors
    ((WizardPage)getContainer().getCurrentPage()).setErrorMessage(null);
    _jobException = null;

    // Start the job
    try {
        getContainer().run(true, true, runnable);
    } catch (Exception e) {
        _jobException = e;
    } 

    // Check for errors
    if (_jobException != null) {
        String msg = StringUtil.format("{0} : {1}", _jobException.getMessage(), BluemixUtil.getErrorText(_jobException));
        ((WizardPage)getContainer().getCurrentPage()).setErrorMessage(msg);
        if (BluemixLogger.BLUEMIX_LOGGER.isErrorEnabled()) {
            BluemixLogger.BLUEMIX_LOGGER.errorp(this, "runJob", BluemixUtil.getRootCause(_jobException), "Error running job"); // $NON-NLS-1$ $NLE-AbstractBluemixWizard.Errorrunningjob-2$
        }            
        return false;
    }

    return true;
}
 
Example #7
Source File: DataSetEditor.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void updateButtons( )
{
	if ( getOkButton( ) != null )
	{
		PropertyPage propertyPage = this.getCurrentPropertyPage( );
		if ( propertyPage != null )
		{
			getOkButton( ).setEnabled( propertyPage.okToLeave( ) );
		}
		else if ( getCurrentNode( ).getPage( ) instanceof WizardPage )
		{
			getOkButton( ).setEnabled( ( (WizardPage) getCurrentNode( ).getPage( ) ).isPageComplete( ) );
		}
	}
}
 
Example #8
Source File: JointDataSetWizard.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public JointDataSetWizard( WizardPage[] pages, boolean useTransaction )
{
	super( );
	this.useTransaction = useTransaction;
	setForcePreviousAndNextButtons( true );
	for ( int i = 0; i < pages.length; i++ )
		addPage( pages[i] );
}
 
Example #9
Source File: ExportReportWizardPage.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Applies the status to the status line of a dialog page.
 */
private void applyToStatusLine( IStatus status )
{
	String message = status.getMessage( );
	if ( message.length( ) == 0 )
		message = PAGE_DESC;
	switch ( status.getSeverity( ) )
	{
		case IStatus.OK :
			setErrorMessage( null );
			setMessage( message );
			break;
		case IStatus.ERROR :
			setErrorMessage( message );
			setMessage( message, WizardPage.ERROR );
			break;
		case IStatus.WARNING :
			setErrorMessage( null );
			setMessage( message, WizardPage.WARNING );
			break;
		case IStatus.INFO :
			setErrorMessage( null );
			setMessage( message, WizardPage.INFORMATION );
			break;
		default :
			setErrorMessage( message );
			setMessage( null );
			break;
	}
}
 
Example #10
Source File: WizardReportSettingPage.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Applies the status to the status line of a dialog page.
 */
private void applyToStatusLine( IStatus status )
{
	String message = status.getMessage( );
	if ( message.length( ) == 0 )
		message = pageDesc;
	switch ( status.getSeverity( ) )
	{
		case IStatus.OK :
			setErrorMessage( null );
			setMessage( message );
			break;
		case IStatus.ERROR :
			setErrorMessage( message );
			setMessage( message, WizardPage.ERROR );
			break;
		case IStatus.WARNING :
			setErrorMessage( null );
			setMessage( message, WizardPage.WARNING );
			break;
		case IStatus.INFO :
			setErrorMessage( null );
			setMessage( message, WizardPage.INFORMATION );
			break;
		default :
			setErrorMessage( message );
			setMessage( null );
			break;
	}
}
 
Example #11
Source File: ICEItemTemplate.java    From ice with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Adds the page to the wizard.  
 */
public void addPages(Wizard wizard) {
	WizardPage p1 = createPage(0);
	p1.setPageComplete(false);
	p1.setTitle("New ICE Item Project");
	p1.setDescription("Specify ICE Item Parameters.");
	wizard.addPage(p1);
	markPagesAdded();
}
 
Example #12
Source File: JDBCSelectionPageHelper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
JDBCSelectionPageHelper( WizardPage page )
{
	DEFAULT_MESSAGE = JdbcPlugin.getResourceString( "wizard.message.createDataSource" ); //$NON-NLS-1$
	m_wizardPage = page;
	if ( page instanceof JDBCSelectionWizardPage ) // bidi_hcg
		bidiSupportObj = ( (JDBCSelectionWizardPage) page ).getBidiSupport( );
}
 
Example #13
Source File: WizardSubPageMain.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
@Override
public WizardPage getNextPage() {
    boolean newPage = true;
    refreshData();
    switch(pageData.type) {
        case WizardData.PAGE_TYPE_NAVIGATOR:
            if (!(pageData.wizardPage[1] instanceof WizardSubPageNav) ) {
                pageData.wizardPage[1] = new WizardSubPageNav(pageData);
                ((Wizard)getWizard()).addPage(pageData.wizardPage[1]);
            }
            return(pageData.wizardPage[1]);

        case WizardData.PAGE_TYPE_VIEW:
            if (pageData.wizardPage[1] instanceof WizardSubPageDataSource) {
                if (((WizardSubPageDataSource)pageData.wizardPage[1]).getType() == WizardSubPageDataSource.DS_VIEW) {
                    newPage = false;
                }
            }
            if (newPage) {
                pageData.wizardPage[1] = new WizardSubPageDataSource(pageData, WizardSubPageDataSource.DS_VIEW);
                ((Wizard)getWizard()).addPage(pageData.wizardPage[1]);
            }                
            return(pageData.wizardPage[1]);

        case WizardData.PAGE_TYPE_FORM:
            if (pageData.wizardPage[1] instanceof WizardSubPageDataSource) {
                if (((WizardSubPageDataSource)pageData.wizardPage[1]).getType() == WizardSubPageDataSource.DS_DOC) {
                    newPage = false;
                }
            }
            if (newPage) {
                pageData.wizardPage[1] = new WizardSubPageDataSource(pageData, WizardSubPageDataSource.DS_DOC);
                ((Wizard)getWizard()).addPage(pageData.wizardPage[1]);
            }                
            return(pageData.wizardPage[1]);
    }        
    return super.getNextPage();
}
 
Example #14
Source File: AbstractComposite.java    From developer-studio with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param parent
 *            Parent composite of
 * @param style
 *            SWT style
 * @param model
 */
public AbstractComposite(Composite parent, int style, ProjectDataModel model, ProjectOptionData optionData,
                         WizardPage wizardPage) {
	super(parent, style);
	setProjectModel(model);
	setProjectOptionData(optionData);
	if (null != getProjectOptionData().getFieldController()) {
		setFieldController(getProjectOptionData().getFieldController());
	}
	setWizardPage(wizardPage);
	projectModel.addObserver(this);
}
 
Example #15
Source File: NoMessageWizardPageSupport.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void handleStatusChanged() {
    boolean pageComplete = true;
    if (currentStatusStale) {
        pageComplete = false;
    } else if (currentStatus != null) {
        pageComplete = !currentStatus.matches(IStatus.ERROR
                | IStatus.CANCEL);
    }
    ((WizardPage) getDialogPage()).setPageComplete(pageComplete);
}
 
Example #16
Source File: ModuleSelectionDialogButtonField.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
public ModuleSelectionDialogButtonField(WizardPage page,
    IDialogFieldListener changeListener) {
  super();
  this.page = page;
  this.browseButtonEnabled = true;
  setDialogFieldListener(changeListener);
  setContentAssistProcessor(new ModuleCompletionProcessor());

  status = new StatusInfo();
}
 
Example #17
Source File: ConnectionContextTemplate.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void addPages ( final Wizard wizard )
{
    final WizardPage page = createPage ( 0, IHelpContextIds.TEMPLATE_CONNECTION );
    page.setTitle ( "Connection" );
    page.setDescription ( "Connection options" );
    wizard.addPage ( page );
    markPagesAdded ();
}
 
Example #18
Source File: PageForTaskIntegratorWizard.java    From CogniCrypt with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Overwriting the getNextPage method to extract the list of all questions from highLevelQuestion page and forward the data to pageForLinkAnswers at runtime
 */
@Override
public IWizardPage getNextPage() {
	final boolean isNextPressed = "nextPressed".equalsIgnoreCase(Thread.currentThread().getStackTrace()[2].getMethodName());
	if (isNextPressed) {
		final boolean validatedNextPress = nextPressed(this);
		if (!validatedNextPress) {
			return this;
		}
	}

	if (getName().equals(Constants.PAGE_NAME_FOR_MODE_OF_WIZARD) && !getCompositeChoiceForModeOfWizard().getObjectForDataInNonGuidedMode().isGuidedModeChosen()) {
		return null;
	}

	if (getName().equals(Constants.PAGE_NAME_FOR_CLAFER_FILE_CREATION)) {

	}
	/*
	 * This is for debugging only. To be removed for the final version. TODO Please add checks on the pages after mode selection to mark those pages as completed, or restrict the
	 * finish button.
	 */
	final IWizardPage nextPage = super.getNextPage();
	if (nextPage != null) {
		((WizardPage) nextPage).setPageComplete(true);

		// refresh the TreeViewer when coming to the XSL page
		if (nextPage.getName().equals(Constants.PAGE_NAME_FOR_XSL_FILE_CREATION)) {
			if (((PageForTaskIntegratorWizard) nextPage).treeViewer != null) {
				((PageForTaskIntegratorWizard) nextPage).treeViewer.refresh();
				((XslPage) nextPage).setTreeViewerInput();
			}
		} else if (nextPage.getName().equals(Constants.PAGE_NAME_FOR_CLAFER_FILE_CREATION)) {
			((ClaferPage) nextPage).initializeClaferModel();
		}
	}

	return nextPage;

}
 
Example #19
Source File: DetailViewTemplate.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void addPages ( final Wizard wizard )
{
    if ( this.id == null )
    {
        final WizardPage page = createPage ( 0, IHelpContextIds.TEMPLATE_DETAIL_VIEW );
        page.setTitle ( Messages.DetailViewTemplate_Page_Title );
        page.setDescription ( Messages.DetailViewTemplate_Page_Description );
        wizard.addPage ( page );
        markPagesAdded ();
    }
}
 
Example #20
Source File: TemplateCustomPropertiesWizard.java    From M2Doc with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void addPages() {
    try {
        document = POIServices.getInstance().getXWPFDocument(URIConverter.INSTANCE, templateURI);
        properties = new TemplateCustomProperties(document);
        for (String missingVariable : properties.getMissingVariables()) {
            properties.getVariables().put(missingVariable, "");
        }
        for (String unusedVariable : properties.getUnusedDeclarations()) {
            properties.getVariables().remove(unusedVariable);
        }

        templateVariablesProperties = new TemplateVariablesPage(properties);
        templateCustomPropertiesPage = new TemplateCustomPropertiesPage(TokenRegistry.INSTANCE, properties,
                templateVariablesProperties);
        templateVariablesProperties.setWizardPage(templateCustomPropertiesPage);
        addPage(templateCustomPropertiesPage);
        addPage(templateVariablesProperties);
        // CHECKSTYLE:OFF
    } catch (final Exception e) {
        // CHECKSTYLE:ON
        addPage(new WizardPage("Invalid template") {

            @Override
            public void createControl(Composite parent) {
                final Composite container = new Composite(parent, parent.getStyle());
                setControl(container);
                setErrorMessage("Template invalid: " + e.getMessage());
                setPageComplete(false);
            }
        });
        Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e));
    }
}
 
Example #21
Source File: NewDataflowProjectWizard.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
@Override
public void addPages() {
  WizardPage landingPage = new NewDataflowProjectWizardLandingPage(creator);
  addPage(landingPage);

  defaultRunOptionsPage = new NewDataflowProjectWizardDefaultRunOptionsPage();
  addPage(defaultRunOptionsPage);
}
 
Example #22
Source File: WizardPageSupportWithoutMessages.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void handleStatusChanged() {
    boolean pageComplete = true;
    if (currentStatusStale) {
        pageComplete = false;
    } else if (currentStatus != null) {
        pageComplete = !currentStatus.matches(IStatus.ERROR
                | IStatus.CANCEL);
    }
    ((WizardPage) getDialogPage()).setPageComplete(pageComplete);
}
 
Example #23
Source File: NewOb2ModulePage.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
private boolean validatePage() {
    String err = null;
    int    errType = WizardPage.ERROR;
    try {
        if (rootContainer == null) {
            err = Messages.NewOb2ModulePage_CantCreateNoXdsProject;
            return false;
        }
        if (StringUtils.isBlank(moduleName)) {
            err = Messages.NewOb2ModulePage_EnterModuleName;
            errType = WizardPage.WARNING;
            return false;
        }
        
        if (!isValidName(moduleName)) {
            err = Messages.NewOb2ModulePage_ModNameInvalid;
            return false;
        }
        
        if (checkExist(sourceFolder, moduleName + ".ob2") ) { //$NON-NLS-1$
            err = String.format(Messages.NewOb2ModulePage_ModuleExists, moduleName + ".ob2", sourceFolder); //$NON-NLS-2$
            return false;
        }

    }
    finally {
        setMessage(err, errType);
    }
    return true;
}
 
Example #24
Source File: WizardPageBuilder.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create an instance of {@link WizardPage} for this {@link WizardPageBuilder}
 */
public WizardPage asPage() {
    final WizardPage page = new InternalWizardPage(title);
    page.setTitle(title);
    page.setDescription(description);
    return page;
}
 
Example #25
Source File: ExtensibleWizard.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
public IWizardPage[] getPages() {
    List<IWizardPage> result = getAllPageList() ;
    return result.toArray(new WizardPage[result.size()]) ;
}
 
Example #26
Source File: ParameterValueEditingSupport.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public ParameterValueEditingSupport(final ColumnViewer viewer,final WizardPage page) {
    super(viewer);
    this.page =  page ;
}
 
Example #27
Source File: WizardPageSupportWithoutMessages.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
private WizardPageSupportWithoutMessages(WizardPage wizardPage, DataBindingContext dbc) {
    super(wizardPage, dbc);
}
 
Example #28
Source File: LangNewProjectWizard.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
/** @return the second page of the wizard. Can be null if wizard has no second page. */
public abstract WizardPage getSecondPage();
 
Example #29
Source File: AppEngineWizard.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected WizardPage getPageAfterSourcesPage() {
    return appEngineConfigWizardPage;
}
 
Example #30
Source File: PythonProjectWizard.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Returns the page that should appear after the sources page, or null if no page comes after it.
 */
protected WizardPage getPageAfterSourcesPage() {
    return referencePage;
}