use of org.eclipse.jface.wizard.IWizardPage in project dbeaver by serge-rider.
the class MultiPageWizardDialog method updateButtons.
@Override
public void updateButtons() {
boolean complete = true;
for (TreeItem item : pagesTree.getItems()) {
if (item.getData() instanceof IWizardPage) {
IWizardPage page = (IWizardPage) item.getData();
if (page.getControl() != null && !page.isPageComplete()) {
complete = false;
break;
}
}
}
Button button = getButton(IDialogConstants.OK_ID);
if (button != null && !button.isDisposed()) {
button.setEnabled(complete);
}
}
use of org.eclipse.jface.wizard.IWizardPage in project translationstudio8 by heartsome.
the class TSWizardDialog method updateSizeForWizard.
/**
* Computes the correct dialog size for the given wizard and resizes its shell if necessary.
*
* @param sizingWizard the wizard
*/
private void updateSizeForWizard(IWizard sizingWizard) {
Point delta = new Point(0, 0);
IWizardPage[] pages = sizingWizard.getPages();
for (int i = 0; i < pages.length; i++) {
// ensure the page container is large enough
Point pageDelta = calculatePageSizeDelta(pages[i]);
delta.x = Math.max(delta.x, pageDelta.x);
delta.y = Math.max(delta.y, pageDelta.y);
}
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);
}
}
use of org.eclipse.jface.wizard.IWizardPage in project translationstudio8 by heartsome.
the class TSWizardDialog method updateForPage.
/**
* 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());
}
// (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(//$NON-NLS-1$
JFaceResources.getString("WizardDialog.missingSetControl"), 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();
}
use of org.eclipse.jface.wizard.IWizardPage in project translationstudio8 by heartsome.
the class TSWizardDialog method nextPressed.
/**
* The Next button has been pressed.
*/
protected void nextPressed() {
IWizardPage page = currentPage.getNextPage();
if (page == null) {
// something must have happened getting the next page
return;
}
// show the next page
showPage(page);
}
use of org.eclipse.jface.wizard.IWizardPage in project translationstudio8 by heartsome.
the class TSWizardDialog method createPageControls.
/**
* Allow the wizard's pages to pre-create their page controls. This allows
* the wizard dialog to open to the correct size.
*/
private void createPageControls() {
// Allow the wizard pages to precreate their page controls
// This allows the wizard to open to the correct size
wizard.createPageControls(pageContainer);
// Ensure that all of the created pages are initially not visible
IWizardPage[] pages = wizard.getPages();
for (int i = 0; i < pages.length; i++) {
IWizardPage page = pages[i];
if (page.getControl() != null) {
page.getControl().setVisible(false);
}
}
}
Aggregations