Search in sources :

Example 1 with IUiContentProvider

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

the class TabContainerUiContentProvider method configure.

protected final void configure() {
    int count = m_folder.getItemCount();
    for (int i = 0; i < count; i++) {
        CTabItem tabItem = m_folder.getItem(i);
        IUiContentProvider contentProvider = (IUiContentProvider) tabItem.getData();
        configute(tabItem, i, contentProvider);
    }
}
Also used : CTabItem(org.eclipse.swt.custom.CTabItem) IUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider) Point(org.eclipse.swt.graphics.Point)

Example 2 with IUiContentProvider

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

the class TabContainerUiContentProvider method saveToObject.

@Override
public void saveToObject() throws Exception {
    List<IUiContentProvider> providers = Lists.newArrayList();
    if (!m_showEmptyPage) {
        int count = m_folder.getItemCount();
        for (int i = 0; i < count; i++) {
            IUiContentProvider provider = (IUiContentProvider) m_folder.getItem(i).getData();
            providers.add(provider);
            provider.saveToObject();
        }
    }
    saveToObject(providers);
}
Also used : IUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider) Point(org.eclipse.swt.graphics.Point)

Example 3 with IUiContentProvider

use of org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider 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 4 with IUiContentProvider

use of org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider 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 5 with IUiContentProvider

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

the class JTableColumnContainerUiContentProvider method updateFromObject.

// //////////////////////////////////////////////////////////////////////////
// 
// Update
// 
// //////////////////////////////////////////////////////////////////////////
public void updateFromObject() throws Exception {
    List<IUiContentProvider> providers = Lists.newArrayList();
    for (ColumnBindingInfo binding : m_binding.getColumns()) {
        providers.add(new UIContentContainer<ColumnBindingInfo>(binding, m_bindings, Messages.JTableColumnContainerUiContentProvider_column, m_provider));
    }
    updateFromObject(providers);
}
Also used : ColumnBindingInfo(org.eclipse.wb.internal.swing.databinding.model.bindings.ColumnBindingInfo) IUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider)

Aggregations

IUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider)22 List (java.util.List)6 Point (org.eclipse.swt.graphics.Point)5 ChooseClassConfiguration (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassConfiguration)5 DatabindingsProvider (org.eclipse.wb.internal.rcp.databinding.DatabindingsProvider)5 BindingInfo (org.eclipse.wb.internal.rcp.databinding.model.context.BindingInfo)5 CompositeInfo (org.eclipse.wb.internal.swt.model.widgets.CompositeInfo)5 BindingUiContentProviderContext (org.eclipse.wb.internal.rcp.databinding.model.context.BindingUiContentProviderContext)4 ColumnBindingInfo (org.eclipse.wb.internal.swing.databinding.model.bindings.ColumnBindingInfo)3 IBindingInfo (org.eclipse.wb.internal.core.databinding.model.IBindingInfo)2 UiContentProviderComposite (org.eclipse.wb.internal.core.databinding.ui.editor.UiContentProviderComposite)2 AbstractBindingInfo (org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo)2 KnownElementsObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.KnownElementsObservableInfo)2 BeansListObservableFactoryInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.designer.BeansListObservableFactoryInfo)2 BeansObservableFactoryInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.designer.BeansObservableFactoryInfo)2 BeansSetObservableFactoryInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.designer.BeansSetObservableFactoryInfo)2 TreeObservableLabelProviderInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.designer.TreeObservableLabelProviderInfo)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 CTabItem (org.eclipse.swt.custom.CTabItem)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1