Search in sources :

Example 1 with FormPresenterSupport

use of org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport 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)

Example 2 with FormPresenterSupport

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

the class OpenShiftServerEditorSection method createSection.

@Override
public void createSection(Composite parent) {
    super.createSection(parent);
    this.dbc = new DataBindingContext();
    this.formPresenterSupport = new FormPresenterSupport(new FormEditorPresenter(getManagedForm().getForm().getForm()), dbc);
    FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
    section.setText("OpenShift Server Adapter");
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(section);
    Composite container = createControls(toolkit, section, dbc);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container);
    toolkit.paintBordersFor(container);
    toolkit.adapt(container);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container);
    section.setClient(container);
    setupWarningToRestartAdapter(getServerEditor());
    loadResources(section, dbc);
    dbc.updateTargets();
}
Also used : FormEditorPresenter(org.jboss.tools.openshift.internal.common.ui.databinding.FormEditorPresenter) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) DataBindingContext(org.eclipse.core.databinding.DataBindingContext) ServerEditorSection(org.eclipse.wst.server.ui.editor.ServerEditorSection) Section(org.eclipse.ui.forms.widgets.Section) FormPresenterSupport(org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport)

Aggregations

FormPresenterSupport (org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport)2 DataBindingContext (org.eclipse.core.databinding.DataBindingContext)1 Composite (org.eclipse.swt.widgets.Composite)1 Control (org.eclipse.swt.widgets.Control)1 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)1 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)1 Section (org.eclipse.ui.forms.widgets.Section)1 ServerEditorSection (org.eclipse.wst.server.ui.editor.ServerEditorSection)1 FormEditorPresenter (org.jboss.tools.openshift.internal.common.ui.databinding.FormEditorPresenter)1 IFormPresenter (org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport.IFormPresenter)1