List of usage examples for org.eclipse.jface.wizard WizardPage setPageComplete
public void setPageComplete(boolean complete)
From source file:com.nokia.tools.variant.confml.ui.parts.ConfMLProjectPathsPart.java
License:Open Source License
public boolean validate(WizardPage page) { Map<IPath, String> locations = new HashMap<IPath, String>(); if (!locationGroup.confmlLocation.isValidPath()) { page.setErrorMessage("Confml Location: The specified value must have single path segment"); page.setPageComplete(false); return false; }//from www . j av a 2s . c o m locations.put(locationGroup.confmlLocation.getPath(), "Confml"); if (!locationGroup.implmlLocation.isValidPath()) { page.setErrorMessage("Implml Location: The specified value must have single path segment"); page.setPageComplete(false); return false; } if (locations.containsKey(locationGroup.implmlLocation.getPath())) { page.setErrorMessage("Implml Location: The paths must be different"); page.setPageComplete(false); return false; } locations.put(locationGroup.implmlLocation.getPath(), "Implml"); if (!locationGroup.contentLocation.isValidPath()) { page.setErrorMessage("Content Location: The specified value must have single path segment"); page.setPageComplete(false); return false; } if (locations.containsKey(locationGroup.contentLocation.getPath())) { page.setErrorMessage("Content Location: The paths must be different"); page.setPageComplete(false); return false; } locations.put(locationGroup.contentLocation.getPath(), "Content"); if (!locationGroup.metadataLocation.isValidPath()) { page.setErrorMessage("Metadata Location: The specified value must have single path segment"); page.setPageComplete(false); return false; } if (locations.containsKey(locationGroup.metadataLocation.getPath())) { page.setErrorMessage("Metadata Location: The paths must be different"); page.setPageComplete(false); return false; } return true; }
From source file:com.nokia.tools.variant.confml.ui.parts.ConfMLProjectSettingsPart.java
License:Open Source License
public boolean validate(WizardPage page) { final String layerID = getLayerID(); if (layerID.length() == 0) { page.setErrorMessage("Layer ID: a value must be specified"); page.setPageComplete(false); propertiesGroup.idField.setRequired(true); propertiesGroup.idField.setErrorMessage(null); return false; }/*from w w w .j a v a 2 s . c o m*/ if (!VALIDATOR_ID_PATTERN.matcher(layerID).matches()) { page.setErrorMessage("Layer ID: ID must be in reverse DNS form"); page.setPageComplete(false); propertiesGroup.idField.setErrorMessage("Layer ID: ID must be in reverse DNS form"); return false; } propertiesGroup.idField.setRequired(false); propertiesGroup.idField.setErrorMessage(null); final String version = getLayerVersion(); if (version.length() == 0) { page.setErrorMessage("Layer Version: a value must be specified"); page.setPageComplete(false); propertiesGroup.versionField.setRequired(true); propertiesGroup.versionField.setErrorMessage(null); return false; } try { new Version(version); } catch (Exception ex) { page.setErrorMessage( "Layer Version: The specified version does not have the correct format (major.minor.micro.qualifier) or contains invalid characters"); page.setPageComplete(false); propertiesGroup.versionField.setRequired(false); propertiesGroup.versionField.setErrorMessage( "The specified version does not have the correct format (major.minor.micro.qualifier) or contains invalid characters"); return false; } propertiesGroup.versionField.setRequired(false); propertiesGroup.versionField.setErrorMessage(null); return true; }
From source file:com.siteview.mde.ui.templates.OptionTemplateSection.java
License:Open Source License
/** * 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.//from ww w . j ava 2s. c o m * * @param option * the option that is required and currently not set */ protected void flagMissingRequiredOption(TemplateOption option) { WizardPage page = null; for (int i = 0; i < pages.size(); i++) { TemplatePage tpage = (TemplatePage) pages.get(i); ArrayList list = tpage.options; if (list.contains(option)) { page = tpage.page; break; } } if (page != null) { page.setPageComplete(false); String message = NLS.bind(MDEUIMessages.OptionTemplateSection_mustBeSet, option.getMessageLabel()); page.setErrorMessage(message); } }
From source file:com.siteview.mde.ui.templates.OptionTemplateSection.java
License:Open Source License
/** * Resets the current page state by clearing the error message and making * the page complete, thereby allowing users to flip to the next page. *///from www. jav a2 s. co m protected void resetPageState() { if (pages.size() == 0) return; WizardPage firstPage = ((TemplatePage) pages.get(0)).page; IWizardContainer container = firstPage.getWizard().getContainer(); WizardPage currentPage = (WizardPage) container.getCurrentPage(); currentPage.setErrorMessage(null); currentPage.setPageComplete(true); }
From source file:fr.inria.diverse.commons.eclipse.pde.wizards.pages.pde.ui.templates.OptionTemplateSection.java
License:Open Source License
/** * 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.// w w w. j av a 2s . c o m * * @param option * the option that is required and currently not set */ protected void flagMissingRequiredOption(TemplateOption option) { WizardPage page = null; for (int i = 0; i < pages.size(); i++) { TemplatePage tpage = pages.get(i); ArrayList<TemplateOption> list = tpage.options; if (list.contains(option)) { page = tpage.page; break; } } if (page != null) { page.setPageComplete(false); String message = NLS.bind(PDEUIMessages.OptionTemplateSection_mustBeSet, option.getMessageLabel()); page.setErrorMessage(message); } }
From source file:fr.inria.diverse.commons.eclipse.pde.wizards.pages.pde.ui.templates.OptionTemplateSection.java
License:Open Source License
/** * Resets the current page state by clearing the error message and making * the page complete, thereby allowing users to flip to the next page. *//*from w ww .jav a 2 s . c o m*/ protected void resetPageState() { if (pages.size() == 0) return; WizardPage firstPage = pages.get(0).page; IWizardContainer container = firstPage.getWizard().getContainer(); WizardPage currentPage = (WizardPage) container.getCurrentPage(); currentPage.setErrorMessage(null); currentPage.setPageComplete(true); }
From source file:net.bioclipse.ds.sdk.pdewizard.DSTemplate.java
License:Open Source License
@Override public void addPages(Wizard wizard) { this.wizard = wizard; WizardPage page = createPage(0); page.setTitle("Endpoint and data"); page.setDescription("Create endpoints and select a data file (SD-file)"); page.setPageComplete(false); wizard.addPage(page);/*from w w w . j a v a2 s . co m*/ WizardPage page2 = createPage(1); page2.setTitle("Model selection"); page2.setDescription("Select the models to build"); page2.setPageComplete(false); wizard.addPage(page2); // WizardPage page3 = createPage(2); page3.setTitle("Exact matches"); page3.setDescription("Set parameters for exact matches"); wizard.addPage(page3); WizardPage page4 = createPage(3); page4.setTitle("Near neighbours"); page4.setDescription("Set parameters for near neighbours"); wizard.addPage(page4); WizardPage page5 = createPage(4); page5.setTitle("QSAR model"); page5.setDescription("Set parameters for the QSAR model"); wizard.addPage(page5); // WizardPage page6 = createPage(5); // page6.setTitle("Structural alerts"); // page6.setDescription("Set parameters for the QSAR model"); // wizard.addPage(page6); markPagesAdded(); }
From source file:net.rim.ejde.internal.ui.wizards.templates.AbstractBBTemplateSection.java
License:Open Source License
/** * Update the wizard page error message. * * @param page//from ww w .ja v a 2 s. c om * The wizard page * @param names * The component name with error * @param status * The error status */ protected void updateStatus(WizardPage page, List<String> names, IStatus status) { if (status.getSeverity() == IStatus.ERROR) { page.setPageComplete(false); IStatus[] children = status.getChildren(); for (int i = 0; i < children.length; i++) { if (children[i].getSeverity() == IStatus.ERROR) { if (names.get(i).length() > 0) { page.setMessage(names.get(i) + ": " + children[i].getMessage(), IMessageProvider.ERROR); } else { page.setMessage(children[i].getMessage(), IMessageProvider.ERROR); } break; } } } else if (status.getSeverity() == IStatus.WARNING) { page.setPageComplete(true); IStatus[] children = status.getChildren(); for (int i = 0; i < children.length; i++) { if (children[i].getSeverity() == IStatus.WARNING) { if (names.get(i).length() > 0) { page.setMessage(names.get(i) + ": " + children[i].getMessage(), IMessageProvider.WARNING); } else { page.setMessage(children[i].getMessage(), IMessageProvider.ERROR); } break; } } } else { page.setPageComplete(true); page.setMessage(null); } }
From source file:net.sourceforge.eclipsetrader.core.ui.wizards.SecurityWizard.java
License:Open Source License
public WizardDialog create() { securityPage = new SecurityPage(); addPage(securityPage);/* w w w . j a va 2 s. c om*/ WizardPage page = new WizardPage("") { //$NON-NLS-1$ public void createControl(Composite parent) { setControl(quoteFeedOptions.createControls(parent)); } }; page.setTitle(Messages.SecurityWizard_QuoteFeedTitle); page.setDescription(Messages.SecurityWizard_QuoteFeedDescription); page.setPageComplete(true); addPage(page); page = new WizardPage("") { //$NON-NLS-1$ public void createControl(Composite parent) { setControl(level2FeedOptions.createControls(parent)); } }; page.setTitle(Messages.SecurityWizard_Level2FeedTitle); page.setDescription(Messages.SecurityWizard_Level2FeedDescription); page.setPageComplete(true); addPage(page); page = new WizardPage("") { //$NON-NLS-1$ public void createControl(Composite parent) { setControl(historyFeedOptions.createControls(parent)); } }; page.setTitle(Messages.SecurityWizard_HistoryFeedTitle); page.setDescription(Messages.SecurityWizard_HistoryFeedDescription); page.setPageComplete(true); addPage(page); page = new WizardPage("") { //$NON-NLS-1$ public void createControl(Composite parent) { setControl(tradeSourceOptions.createControls(parent, null)); } }; page.setTitle(Messages.SecurityWizard_TradeSourceTitle); page.setDescription(Messages.SecurityWizard_TradeSourceDescription); addPage(page); page = new WizardPage("") { //$NON-NLS-1$ public void createControl(Composite parent) { setControl(intradayOptions.createControls(parent, null)); } }; page.setTitle(Messages.SecurityWizard_IntradayChartsTitle); page.setDescription(Messages.SecurityWizard_IntradayChartsDescription); addPage(page); WizardDialog dlg = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), this); dlg.create(); return dlg; }
From source file:org.caleydo.view.bicluster.internal.loading.BiClusterStartupAddon.java
License:Open Source License
/** * @param changeListener//from w ww . ja v a2 s .c o m * */ protected void checkAllThere(WizardPage page, Listener changeListener) { boolean ok = validate(); page.setPageComplete(ok); changeListener.handleEvent(null); // fake it }