List of usage examples for org.eclipse.jface.wizard IWizardPage setVisible
void setVisible(boolean visible);
From source file:com.codesourcery.internal.installer.ui.WizardDialog.java
License:Open Source License
/** * Update the receiver for the new page. * /*from w ww . j ava 2s . c om*/ * @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(); }
From source file:com.microsoft.tfs.client.common.ui.framework.wizard.ExtendedWizardPage.java
License:Open Source License
/** * <p>/*from ww w. j a v a 2 s . co m*/ * {@link ExtendedWizardPage} overrides this {@link IWizardPage} method. It * uses <code>setVisible()</code> as a hook point to perform some additional * tasks when the page is shown or hidden. When the page is shown, * {@link #refresh()} is called to give the {@link ExtendedWizardPage} * subclass a chance to refresh page state. When the page is hidden, * {@link #onMovingToPreviousPage()} is called if navigating to the previous * page, and {@link #saveState(IDialogSettings)} is called to give the * subclass a chance to persist state. * </p> * * <p> * {@link ExtendedWizardPage} subclasses typically will not override this * method. * </p> */ @Override public void setVisible(final boolean visible) { /* * The DialogPage setVisible implementation just calls setVisible on the * control (getControl()) with the argument. */ super.setVisible(visible); if (visible) { final IWizardPage previousPage = getPreviousPage(); if (previousPage != null && previousPage.getControl() != null) { previousPage.setVisible(false); } refresh(); } else { final IWizardPage curPage = getContainer().getCurrentPage(); final IWizardPage prevPage = getPreviousPage(); if (curPage == prevPage) { onMovingToPreviousPage(); } saveState(getDialogSettings()); } }
From source file:org.bonitasoft.studio.configuration.ui.wizard.ConfigurationWizardDialog.java
License:Open Source License
@Override public void showPage(IWizardPage page) { super.showPage(page); page.setPreviousPage(null);/*from w ww.jav a2s.c o m*/ setControlEnabled(page.getControl(), ((ConfigurationWizard) getWizard()).getProcess() != null); ConfigurationWizard confWizard = (ConfigurationWizard) getWizard(); confWizard.updatePages(); page.setVisible(true); pageChooserViewer.setSelection(new StructuredSelection(getCurrentPage())); group.setText(page.getTitle()); String processName = getProcess().getName() + " (" + getProcess().getVersion() + ")"; setTitle(Messages.bind(Messages.configurationWizardTitle, processName)); if (((IProcessConfigurationWizardPage) page).isConfigurationPageValid(getConfiguration()) == null) { setMessage(Messages.bind(Messages.configurationWizardDesc, processName)); } }
From source file:org.eclipse.ui.preferences.WizardPropertyPage.java
License:Open Source License
private void createWizardPageContent(Composite parent) { fWizard = createWizard();/*w w w .j av a 2s.com*/ if (fWizard == null) return; fWizard.addPages(); PropertyPageWizardContainer wizardContainer = new PropertyPageWizardContainer(this, fWizard); wizardContainer.updateButtons(); wizardContainer.updateMessage(); fWizard.setContainer(wizardContainer); Composite messageComposite = new Composite(parent, SWT.NONE); messageComposite.setFont(parent.getFont()); messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); GridLayout layout = new GridLayout(1, false); layout.marginHeight = 0; messageComposite.setLayout(layout); Label messageLabel = new Label(messageComposite, SWT.WRAP); messageLabel.setFont(messageComposite.getFont()); messageLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); fWizard.createPageControls(parent); IWizardPage page = fWizard.getPages()[0]; if (page.getControl() == null) page.createControl(parent); Control pageControl = page.getControl(); pageControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); setPageName(page); setDescription(page, messageLabel); page.setVisible(true); setValid(fWizard.canFinish()); }
From source file:org.modelio.api.ui.ModelioWizardDialog.java
License:Apache License
/** * Update the receiver for the new page. * @param page//from w ww.j a v a 2 s . c o m */ @objid("bc21ab54-120f-11e2-b5c6-002564c97630") void updateForPage(final IWizardPage page) { // ensure this page belongs to the current wizard if (this.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(this.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 = this.currentPage; this.currentPage = page; this.currentPage.setVisible(true); if (oldPage != null) { oldPage.setVisible(false); } // update the dialog controls update(); }
From source file:org.teiid.designer.tools.textimport.ui.wizards.ImportTextWizard.java
License:Open Source License
/** * @see org.eclipse.jface.wizard.IWizard#getPreviousPage(org.eclipse.jface.wizard.IWizardPage) *//*from w w w . j a v a 2s. c om*/ @Override public IWizardPage getPreviousPage(IWizardPage thePage) { IWizardPage pPage = super.getPreviousPage(thePage); pPage.setVisible(true); return pPage; }
From source file:uk.ac.diamond.scisoft.ncd.rcp.wizards.NcdDataReductionWizard.java
License:Apache License
@Override public boolean canFinish() { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); ISourceProviderService service = (ISourceProviderService) window.getService(ISourceProviderService.class); NcdProcessingSourceProvider ncdResponseSourceProvider = (NcdProcessingSourceProvider) service .getSourceProvider(NcdProcessingSourceProvider.RESPONSE_STATE); NcdProcessingSourceProvider ncdSectorSourceProvider = (NcdProcessingSourceProvider) service .getSourceProvider(NcdProcessingSourceProvider.SECTOR_STATE); NcdProcessingSourceProvider ncdNormalisationSourceProvider = (NcdProcessingSourceProvider) service .getSourceProvider(NcdProcessingSourceProvider.NORMALISATION_STATE); NcdProcessingSourceProvider ncdBackgroundSourceProvider = (NcdProcessingSourceProvider) service .getSourceProvider(NcdProcessingSourceProvider.BACKGROUD_STATE); NcdProcessingSourceProvider ncdAverageSourceProvider = (NcdProcessingSourceProvider) service .getSourceProvider(NcdProcessingSourceProvider.AVERAGE_STATE); // We make visible the current page if it is an active one. IWizardContainer container = getContainer(); if (container != null && setupPage.isPageComplete()) { IWizardPage currentPage = container.getCurrentPage(); if (currentPage instanceof NcdDataReductionResponsePage) { currentPage.setVisible(ncdResponseSourceProvider.isEnableDetectorResponse()); }/*w w w . j av a 2 s .c om*/ if (currentPage instanceof NcdDataReductionSectorIntegrationPage) { currentPage.setVisible(ncdSectorSourceProvider.isEnableSector()); } if (currentPage instanceof NcdDataReductionNormalisationPage) { currentPage.setVisible(ncdNormalisationSourceProvider.isEnableNormalisation()); } if (currentPage instanceof NcdDataReductionBackgroundPage) { currentPage.setVisible(ncdBackgroundSourceProvider.isEnableBackground()); } if (currentPage instanceof NcdDataReductionAveragePage) { currentPage.setVisible(ncdAverageSourceProvider.isEnableAverage()); } return currentPage.isPageComplete(); } if (setupPage.isPageComplete() && selectedNcdDataReductionPage != null && !selectedNcdDataReductionPage.isPageComplete()) { return false; } return setupPage.isPageComplete() && (selectedNcdDataReductionPage == null || selectedNcdDataReductionPage.isPageComplete()); }