Search in sources :

Example 1 with ChooseClassAndPropertiesConfiguration

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

the class AutomaticDatabindingSecondPage method createConfiguration.

private ChooseClassAndPropertiesConfiguration createConfiguration() {
    ChooseClassAndPropertiesConfiguration configuration = new ChooseClassAndPropertiesConfiguration();
    configuration.setDialogFieldLabel(Messages.AutomaticDatabindingSecondPage_beanClassLabel);
    configuration.setChooseInterfaces(true);
    configuration.setEmptyClassErrorMessage(Messages.AutomaticDatabindingSecondPage_beanClassMessage);
    configuration.setErrorMessagePrefix(Messages.AutomaticDatabindingSecondPage_beanClassErrorPrefix);
    configuration.setPropertiesLabel(Messages.AutomaticDatabindingSecondPage_propertiesLabel);
    configuration.setPropertiesMultiChecked(true);
    configuration.setReorderMode(true);
    configuration.setLoadedPropertiesCheckedStrategy(ChooseClassAndPropertiesConfiguration.LoadedPropertiesCheckedStrategy.All);
    configuration.setPropertiesErrorMessage(Messages.AutomaticDatabindingSecondPage_propertiesErrorMessage);
    m_databindingProvider.configure(configuration);
    return configuration;
}
Also used : ChooseClassAndPropertiesConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesConfiguration)

Example 2 with ChooseClassAndPropertiesConfiguration

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

the class ViewerInputBindingInfo method createContentProviders.

// //////////////////////////////////////////////////////////////////////////
// 
// Editing
// 
// //////////////////////////////////////////////////////////////////////////
@Override
public void createContentProviders(List<IUiContentProvider> providers, IPageListener listener, DatabindingsProvider provider) throws Exception {
    // configure page
    listener.setTitle(Messages.ViewerInputBindingInfo_title);
    listener.setMessage(Messages.ViewerInputBindingInfo_message);
    // 
    providers.add(new LabelUiContentProvider(Messages.ViewerInputBindingInfo_viewerLabel, m_viewerBindable.getPresentation().getTextForBinding()));
    providers.add(new LabelUiContentProvider(Messages.ViewerInputBindingInfo_inputLabel, m_inputObservable.getPresentationText()));
    m_labelProvider.createContentProviders(providers, provider, true);
    // element type editor
    ChooseClassAndPropertiesConfiguration configuration = new ChooseClassAndPropertiesConfiguration();
    configuration.setDialogFieldLabel(Messages.ViewerInputBindingInfo_elementClassLabel);
    configuration.setValueScope("beans");
    configuration.setChooseInterfaces(true);
    configuration.setEmptyClassErrorMessage(Messages.ViewerInputBindingInfo_elementClassEmptyMessage);
    configuration.setErrorMessagePrefix(Messages.ViewerInputBindingInfo_elementClassErrorPrefix);
    configuration.setPropertiesLabel(Messages.ViewerInputBindingInfo_elementClassPropertiesLabel);
    configuration.setPropertiesMultiChecked(true);
    configuration.setReorderMode(true);
    configuration.setShowSelectionButtons(false);
    configuration.setLoadedPropertiesCheckedStrategy(ChooseClassAndPropertiesConfiguration.LoadedPropertiesCheckedStrategy.None);
    configuration.setPropertiesErrorMessage(Messages.ViewerInputBindingInfo_elementClassPropertiesErrorMessage);
    // 
    if (m_inputObservable instanceof DetailBeanObservableInfo) {
        configuration.setDialogFieldEnabled(false);
        configuration.setValueScope("beans0");
        m_inputObservable.createContentProviders(providers, null, provider);
    }
    // 
    GlobalFactoryHelper.configureChooseElementForViewerInput(m_inputObservable, configuration);
    // 
    InputElementUiContentProvider inputUIContentProvider = new InputElementUiContentProvider(configuration, this);
    // 
    if (m_inputObservable instanceof DetailBeanObservableInfo) {
        new ChooseClassAndPropertiesRouter((ChooseClassAndPropertiesUiContentProvider) providers.get(providers.size() - 1), inputUIContentProvider);
    }
    // 
    providers.add(inputUIContentProvider);
    // 
    super.createContentProviders(providers, listener, provider);
}
Also used : ChooseClassAndPropertiesRouter(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesRouter) LabelUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.LabelUiContentProvider) InputElementUiContentProvider(org.eclipse.wb.internal.rcp.databinding.ui.contentproviders.InputElementUiContentProvider) ChooseClassAndPropertiesConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesConfiguration) DetailBeanObservableInfo(org.eclipse.wb.internal.rcp.databinding.model.beans.observables.DetailBeanObservableInfo)

Example 3 with ChooseClassAndPropertiesConfiguration

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

the class VirtualEditingSupportInfo method createContentProviders.

// //////////////////////////////////////////////////////////////////////////
// 
// Editing
// 
// //////////////////////////////////////////////////////////////////////////
public void createContentProviders(List<IUiContentProvider> providers) throws Exception {
    // CellEditor
    providers.add(new LabelUiContentProvider(Messages.VirtualEditingSupportInfo_cellEditorLabel, getCellEditorPresentationText()));
    // 
    ChooseClassAndPropertiesConfiguration cellEditorConfiguration = new ChooseClassAndPropertiesConfiguration();
    cellEditorConfiguration.setBaseClassName("org.eclipse.jface.viewers.CellEditor");
    cellEditorConfiguration.setDialogFieldLabel(Messages.VirtualEditingSupportInfo_chooseLabel);
    cellEditorConfiguration.setEmptyClassErrorMessage(Messages.VirtualEditingSupportInfo_chooseEmptyMessage);
    cellEditorConfiguration.setErrorMessagePrefix(Messages.VirtualEditingSupportInfo_chooseErrorPrefix);
    cellEditorConfiguration.setPropertiesLabel(Messages.VirtualEditingSupportInfo_choosePropertiesLabel);
    cellEditorConfiguration.setLoadedPropertiesCheckedStrategy(ChooseClassAndPropertiesConfiguration.LoadedPropertiesCheckedStrategy.None);
    cellEditorConfiguration.setPropertiesErrorMessage(Messages.VirtualEditingSupportInfo_choosePropertyMessage);
    cellEditorConfiguration.setDefaultValues(new String[] { "org.eclipse.jface.viewers.TextCellEditor", "org.eclipse.jface.viewers.ComboBoxCellEditor", "org.eclipse.jface.viewers.CheckboxCellEditor" });
    // 
    providers.add(new CellEditorUiContentProvider(cellEditorConfiguration));
    // 
    providers.add(new SeparatorUiContentProvider());
    // Element property
    providers.add(new LabelUiContentProvider(Messages.VirtualEditingSupportInfo_elementProperty, getElementPropertyPresentationText()));
    // 
    ChooseClassAndPropertiesConfiguration elementConfiguration = new ChooseClassAndPropertiesConfiguration();
    elementConfiguration.setDialogFieldLabel(Messages.VirtualEditingSupportInfo_chooseBeanLabel);
    elementConfiguration.setEmptyClassErrorMessage(Messages.VirtualEditingSupportInfo_chooseBeanEmptyMessage);
    elementConfiguration.setErrorMessagePrefix(Messages.VirtualEditingSupportInfo_chooseBeanErrorPrefix);
    elementConfiguration.setPropertiesLabel(Messages.VirtualEditingSupportInfo_chooseBeanPropertiesLabel);
    elementConfiguration.setLoadedPropertiesCheckedStrategy(ChooseClassAndPropertiesConfiguration.LoadedPropertiesCheckedStrategy.None);
    elementConfiguration.setPropertiesErrorMessage(Messages.VirtualEditingSupportInfo_chooseBeanPropertiesErrorMessage);
    // 
    providers.add(new ElementPropertyUiContentProvider(elementConfiguration));
}
Also used : SeparatorUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.SeparatorUiContentProvider) LabelUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.LabelUiContentProvider) ChooseClassAndPropertiesConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesConfiguration)

Example 4 with ChooseClassAndPropertiesConfiguration

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

the class DetailBeanObservableInfo method getConfiguration.

protected ChooseClassAndPropertiesConfiguration getConfiguration() {
    if (m_configuration == null) {
        m_configuration = new ChooseClassAndPropertiesConfiguration();
        m_configuration.setDialogFieldLabel(Messages.DetailBeanObservableInfo_objectLabel);
        m_configuration.setValueScope("beans");
        m_configuration.setChooseInterfaces(true);
        m_configuration.setEmptyClassErrorMessage(Messages.DetailBeanObservableInfo_errorMessage);
        m_configuration.setErrorMessagePrefix(Messages.DetailBeanObservableInfo_errorMessagePrefix);
        m_configuration.setPropertiesLabel(Messages.DetailBeanObservableInfo_propertiesLabel);
        m_configuration.setPropertiesErrorMessage(Messages.DetailBeanObservableInfo_propertiesErrorMessage);
    }
    return m_configuration;
}
Also used : ChooseClassAndPropertiesConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesConfiguration)

Example 5 with ChooseClassAndPropertiesConfiguration

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

the class DetailEmfObservableInfo method createContentProviders.

// //////////////////////////////////////////////////////////////////////////
// 
// Editing
// 
// //////////////////////////////////////////////////////////////////////////
@Override
public void createContentProviders(List<IUiContentProvider> providers, BindingUiContentProviderContext context, DatabindingsProvider provider) throws Exception {
    m_masterObservable.createContentProviders(providers, context, provider);
    // 
    ChooseClassAndPropertiesConfiguration configuration = new ChooseClassAndPropertiesConfiguration(getConfiguration());
    configuration.setBaseClassName("org.eclipse.emf.ecore.EObject");
    // 
    providers.add(new ObservableDetailUiContentProvider(configuration, this, provider) {

        @Override
        protected List<PropertyAdapter> getProperties(Class<?> choosenClass) throws Exception {
            List<PropertyAdapter> properties = Lists.newArrayList();
            for (PropertyInfo emfPropertyInfo : m_propertiesSupport.getProperties(choosenClass)) {
                properties.add(new ChooseClassAndTreePropertiesUiContentProvider.ObservePropertyAdapter(null, new EPropertyBindableInfo(m_propertiesSupport, null, emfPropertyInfo.type, emfPropertyInfo.name, emfPropertyInfo.reference)));
            }
            return properties;
        }

        @Override
        protected void setClassNameAndProperties(Class<?> beanClass, String beanClassName, List<String> properties) throws Exception {
            if (beanClassName == null) {
                setClassName(CoreUtils.getClassName(beanClass));
            } else {
                setClassName(beanClassName);
            }
            // 
            EObjectBindableInfo eObject = new EObjectBindableInfo(beanClass, null, m_propertiesSupport, null);
            // 
            Object[] adapters = new Object[properties.size()];
            for (int i = 0; i < adapters.length; i++) {
                adapters[i] = convertPropertyToAdapter(eObject.resolvePropertyReference(properties.get(i)));
            }
            // 
            setCheckedAndExpand(adapters);
            calculatePropertiesFinish();
        }

        @Override
        protected ObservePropertyAdapter convertPropertyToAdapter(IObserveInfo observe) throws Exception {
            if (observe instanceof EPropertyBindableInfo) {
                EPropertyBindableInfo property = (EPropertyBindableInfo) observe;
                ObservePropertyAdapter adapter = new ObservePropertyAdapter(convertPropertyToAdapter(property.getParent()), property);
                adapter.addToParent();
                return adapter;
            }
            return null;
        }
    });
}
Also used : IObserveInfo(org.eclipse.wb.internal.core.databinding.model.IObserveInfo) EObjectBindableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EObjectBindableInfo) ChooseClassAndPropertiesConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesConfiguration) ObservableDetailUiContentProvider(org.eclipse.wb.internal.rcp.databinding.ui.contentproviders.ObservableDetailUiContentProvider) List(java.util.List) EPropertyBindableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EPropertyBindableInfo) PropertyInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.PropertiesSupport.PropertyInfo)

Aggregations

ChooseClassAndPropertiesConfiguration (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesConfiguration)7 LabelUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.LabelUiContentProvider)2 List (java.util.List)1 IObserveInfo (org.eclipse.wb.internal.core.databinding.model.IObserveInfo)1 IUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider)1 ChooseClassAndPropertiesRouter (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesRouter)1 ChooseClassConfiguration (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassConfiguration)1 SeparatorUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.SeparatorUiContentProvider)1 DatabindingsProvider (org.eclipse.wb.internal.rcp.databinding.DatabindingsProvider)1 EObjectBindableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EObjectBindableInfo)1 EPropertyBindableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EPropertyBindableInfo)1 PropertyInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.PropertiesSupport.PropertyInfo)1 DetailBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.DetailBeanObservableInfo)1 BindingInfo (org.eclipse.wb.internal.rcp.databinding.model.context.BindingInfo)1 BindingUiContentProviderContext (org.eclipse.wb.internal.rcp.databinding.model.context.BindingUiContentProviderContext)1 InputElementUiContentProvider (org.eclipse.wb.internal.rcp.databinding.ui.contentproviders.InputElementUiContentProvider)1 ObservableDetailUiContentProvider (org.eclipse.wb.internal.rcp.databinding.ui.contentproviders.ObservableDetailUiContentProvider)1 CompositeInfo (org.eclipse.wb.internal.swt.model.widgets.CompositeInfo)1