Search in sources :

Example 1 with IFormPresenter

use of org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport.IFormPresenter in project jbosstools-openshift by jbosstools.

the class ServerSettingsWizardPage method doCreateControls.

@Override
protected void doCreateControls(final Composite parent, final DataBindingContext dbc) {
    GridLayoutFactory.fillDefaults().numColumns(3).margins(0, 0).applyTo(parent);
    createControls(parent, model, dbc);
    // Since wizard fragment is cached and reused, this precaution is needed.
    isLoadingResources = false;
    new FormPresenterSupport(new IFormPresenter() {

        @Override
        public void setMessage(String message, int type) {
            if (getContainer() != null) {
                ServerSettingsWizardPage.this.setMessage(message, type);
            }
        }

        @Override
        public void setComplete(boolean complete) {
            if (getContainer() != null) {
                ServerSettingsWizardPage.this.setComplete(complete);
            }
        }

        @Override
        public Control getControl() {
            return parent;
        }
    }, dbc);
    // assuming that the wizard may be complete upon initialization
    setComplete(true);
    loadResources(getContainer());
}
Also used : Control(org.eclipse.swt.widgets.Control) FormPresenterSupport(org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport) IFormPresenter(org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport.IFormPresenter)

Aggregations

Control (org.eclipse.swt.widgets.Control)1 FormPresenterSupport (org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport)1 IFormPresenter (org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport.IFormPresenter)1