Search in sources :

Example 1 with UiContentProviderComposite

use of org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite in project windowbuilder by eclipse.

the class BindDialog method createDialogArea.

// //////////////////////////////////////////////////////////////////////////
// 
// GUI
// 
// //////////////////////////////////////////////////////////////////////////
@Override
protected Control createDialogArea(Composite parent) {
    // dialog area
    final ScrolledComposite container = new ScrolledComposite((Composite) super.createDialogArea(parent), SWT.BORDER | SWT.V_SCROLL);
    container.setExpandHorizontal(true);
    // 
    List<IUiContentProvider> providers = ExecutionUtils.runObjectLog(new RunnableObjectEx<List<IUiContentProvider>>() {

        @Override
        public List<IUiContentProvider> runObject() throws Exception {
            return m_databindingsProvider.getContentProviders(m_binding, BindDialog.this);
        }
    }, Collections.<IUiContentProvider>emptyList());
    m_providerComposite = new UiContentProviderComposite(this, providers, container, SWT.NONE);
    container.setContent(m_providerComposite);
    container.addControlListener(new ControlAdapter() {

        @Override
        public void controlResized(ControlEvent e) {
            Rectangle bounds = container.getClientArea();
            Point size = m_providerComposite.computeSize(bounds.width, SWT.DEFAULT);
            m_providerComposite.setBounds(bounds.x, bounds.y, size.x, size.y);
        }
    });
    GridDataFactory.create(container).fill().grab();
    // 
    return container;
}
Also used : ControlAdapter(org.eclipse.swt.events.ControlAdapter) Rectangle(org.eclipse.swt.graphics.Rectangle) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) List(java.util.List) Point(org.eclipse.swt.graphics.Point) ControlEvent(org.eclipse.swt.events.ControlEvent) IUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider) UiContentProviderComposite(org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite)

Example 2 with UiContentProviderComposite

use of org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite in project windowbuilder by eclipse.

the class BindWizardPage method calculateFinish.

public void calculateFinish() {
    if (m_providerComposite != null) {
        m_providerComposite.dispose();
        m_providerComposite = null;
    }
    List<IUiContentProvider> providers = ExecutionUtils.runObjectLog(new RunnableObjectEx<List<IUiContentProvider>>() {

        @Override
        public List<IUiContentProvider> runObject() throws Exception {
            m_binding = m_firstPage.getBinding();
            return m_context.provider.getContentProviders(m_binding, BindWizardPage.this);
        }
    }, Collections.<IUiContentProvider>emptyList());
    m_providerComposite = new UiContentProviderComposite(this, providers, m_composite, SWT.NONE);
    // initial state
    ExecutionUtils.runLog(new RunnableEx() {

        @Override
        public void run() throws Exception {
            m_providerComposite.performInitialize();
        }
    });
}
Also used : RunnableEx(org.eclipse.wb.internal.core.utils.execution.RunnableEx) List(java.util.List) IUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider) UiContentProviderComposite(org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite)

Example 3 with UiContentProviderComposite

use of org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite in project windowbuilder by eclipse.

the class TreeInputElementUiContentProvider method createContent.

@Override
public void createContent(Composite parent, int columns) {
    // create folder
    m_tabFolder = new TabFolder(parent, SWT.NONE);
    GridDataFactory.create(m_tabFolder).fill().grab().spanH(columns);
    // create designer page
    m_designerPageListener = new PageListenerWrapper(m_pageListener, m_completeListener);
    // 
    m_designerComposite = new UiContentProviderComposite(m_designerPageListener, createDesignerProviders(), m_tabFolder, SWT.NONE);
    TabFactory.item(m_tabFolder).text(Messages.TreeInputElementUiContentProvider_designerSupport).image(CHECK_IMAGE).control(m_designerComposite);
    // create jface page
    m_jfacePageListener = new PageListenerWrapper(m_pageListener, m_completeListener);
    // 
    m_jfaceComposite = new UiContentProviderComposite(m_jfacePageListener, createJFaceProviders(), m_tabFolder, SWT.NONE);
    TabFactory.item(m_tabFolder).text(Messages.TreeInputElementUiContentProvider_jfaceSupport).image(UNCHECK_IMAGE).control(m_jfaceComposite);
    // 
    m_tabFolder.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            handleTabSelection();
            calculateFinish();
        }
    });
}
Also used : PageListenerWrapper(org.eclipse.wb.internal.core.databinding.ui.editor.PageListenerWrapper) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) TabFolder(org.eclipse.swt.widgets.TabFolder) SelectionEvent(org.eclipse.swt.events.SelectionEvent) UiContentProviderComposite(org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite)

Example 4 with UiContentProviderComposite

use of org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite in project windowbuilder by eclipse.

the class SimpleBindDialog method createDialogArea.

// //////////////////////////////////////////////////////////////////////////
// 
// GUI
// 
// //////////////////////////////////////////////////////////////////////////
@Override
protected Control createDialogArea(Composite parent) {
    // dialog area
    Composite container = (Composite) super.createDialogArea(parent);
    // 
    m_providerComposite = new UiContentProviderComposite(this, m_providers, container, SWT.NONE);
    GridDataFactory.create(m_providerComposite).fill().grab();
    // 
    if (m_title != null) {
        setTitle(m_title);
    }
    if (m_message != null) {
        setMessage(m_message);
    }
    // 
    return container;
}
Also used : UiContentProviderComposite(org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite) Composite(org.eclipse.swt.widgets.Composite) UiContentProviderComposite(org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite)

Aggregations

UiContentProviderComposite (org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite)4 List (java.util.List)2 IUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider)2 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 ControlAdapter (org.eclipse.swt.events.ControlAdapter)1 ControlEvent (org.eclipse.swt.events.ControlEvent)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 Point (org.eclipse.swt.graphics.Point)1 Rectangle (org.eclipse.swt.graphics.Rectangle)1 Composite (org.eclipse.swt.widgets.Composite)1 TabFolder (org.eclipse.swt.widgets.TabFolder)1 PageListenerWrapper (org.eclipse.wb.internal.core.databinding.ui.editor.PageListenerWrapper)1 RunnableEx (org.eclipse.wb.internal.core.utils.execution.RunnableEx)1