Search in sources :

Example 1 with HaleWizardPage

use of eu.esdihumboldt.hale.ui.HaleWizardPage in project hale by halestudio.

the class AbstractGenericCustomFunctionWizard method setContainer.

/**
 * @see Wizard#setContainer(IWizardContainer)
 */
@Override
public void setContainer(IWizardContainer wizardContainer) {
    super.setContainer(wizardContainer);
    if (wizardContainer instanceof HaleWizardDialog) {
        final HaleWizardDialog container = (HaleWizardDialog) wizardContainer;
        // has to be pageChanging, because closing the tray in page changed
        // leads to an exception
        ((HaleWizardDialog) wizardContainer).addPageChangingListener(new IPageChangingListener() {

            @Override
            public void handlePageChanging(PageChangingEvent event) {
                boolean helpAvailable = false;
                if (event.getTargetPage() instanceof HaleWizardPage<?>) {
                    HaleWizardPage<?> page = (HaleWizardPage<?>) event.getTargetPage();
                    helpAvailable = page.getHelpContext() != null;
                }
                container.setHelpButtonEnabled(helpAvailable);
                if (container.getTray() != null)
                    container.closeTray();
            }
        });
    }
}
Also used : HaleWizardPage(eu.esdihumboldt.hale.ui.HaleWizardPage) PageChangingEvent(org.eclipse.jface.dialogs.PageChangingEvent) IPageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener) HaleWizardDialog(eu.esdihumboldt.hale.ui.util.wizard.HaleWizardDialog)

Example 2 with HaleWizardPage

use of eu.esdihumboldt.hale.ui.HaleWizardPage in project hale by halestudio.

the class AbstractGenericFunctionWizard method setContainer.

/**
 * @see Wizard#setContainer(IWizardContainer)
 */
@Override
public void setContainer(IWizardContainer wizardContainer) {
    super.setContainer(wizardContainer);
    if (wizardContainer instanceof HaleWizardDialog) {
        final HaleWizardDialog container = (HaleWizardDialog) wizardContainer;
        // has to be pageChanging, because closing the tray in page changed
        // leads to an exception
        ((HaleWizardDialog) wizardContainer).addPageChangingListener(new IPageChangingListener() {

            @Override
            public void handlePageChanging(PageChangingEvent event) {
                boolean helpAvailable = false;
                if (event.getTargetPage() instanceof HaleWizardPage<?>) {
                    HaleWizardPage<?> page = (HaleWizardPage<?>) event.getTargetPage();
                    helpAvailable = page.getHelpContext() != null;
                }
                container.setHelpButtonEnabled(helpAvailable);
                if (container.getTray() != null)
                    container.closeTray();
            }
        });
    }
}
Also used : HaleWizardPage(eu.esdihumboldt.hale.ui.HaleWizardPage) PageChangingEvent(org.eclipse.jface.dialogs.PageChangingEvent) IPageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener) HaleWizardDialog(eu.esdihumboldt.hale.ui.util.wizard.HaleWizardDialog)

Aggregations

HaleWizardPage (eu.esdihumboldt.hale.ui.HaleWizardPage)2 HaleWizardDialog (eu.esdihumboldt.hale.ui.util.wizard.HaleWizardDialog)2 IPageChangingListener (org.eclipse.jface.dialogs.IPageChangingListener)2 PageChangingEvent (org.eclipse.jface.dialogs.PageChangingEvent)2