Search in sources :

Example 1 with ExportSelectTargetPage

use of eu.esdihumboldt.hale.ui.io.ExportSelectTargetPage in project hale by halestudio.

the class IncludeSchemaConfigurationPage method createContent.

/**
 * @see eu.esdihumboldt.hale.ui.HaleWizardPage#createContent(org.eclipse.swt.widgets.Composite)
 */
@Override
protected void createContent(Composite page) {
    GridLayoutFactory.swtDefaults().numColumns(1).applyTo(page);
    Group includeGroup = new Group(page, SWT.NONE);
    includeGroup.setText("Include schema");
    GridLayoutFactory.swtDefaults().numColumns(2).applyTo(includeGroup);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(includeGroup);
    checkInclude = new Button(includeGroup, SWT.CHECK);
    checkInclude.setText("Include target schema in the archive");
    GridDataFactory.swtDefaults().span(2, 1).applyTo(checkInclude);
    IWizardContainer container = getContainer();
    if (container instanceof WizardDialog) {
        changeListener = new IPageChangingListener() {

            @Override
            public void handlePageChanging(PageChangingEvent event) {
                Object currentPage = event.getCurrentPage();
                Object targetPage = event.getTargetPage();
                if (currentPage instanceof FeatureChainingConfigurationPage && targetPage instanceof IncludeSchemaConfigurationPage) {
                    goingBack = true;
                } else if (currentPage instanceof ExportSelectTargetPage && targetPage instanceof IncludeSchemaConfigurationPage) {
                    goingBack = false;
                }
            }
        };
        WizardDialog dialog = (WizardDialog) container;
        dialog.addPageChangingListener(changeListener);
    } else {
        changeListener = null;
    }
}
Also used : IWizardContainer(org.eclipse.jface.wizard.IWizardContainer) Group(org.eclipse.swt.widgets.Group) Button(org.eclipse.swt.widgets.Button) PageChangingEvent(org.eclipse.jface.dialogs.PageChangingEvent) IPageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ExportSelectTargetPage(eu.esdihumboldt.hale.ui.io.ExportSelectTargetPage)

Aggregations

ExportSelectTargetPage (eu.esdihumboldt.hale.ui.io.ExportSelectTargetPage)1 IPageChangingListener (org.eclipse.jface.dialogs.IPageChangingListener)1 PageChangingEvent (org.eclipse.jface.dialogs.PageChangingEvent)1 IWizardContainer (org.eclipse.jface.wizard.IWizardContainer)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 Button (org.eclipse.swt.widgets.Button)1 Group (org.eclipse.swt.widgets.Group)1