Search in sources :

Example 1 with ChooseClassConfiguration

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

the class ObservableMapLabelProviderInfo method createContentProviders.

// //////////////////////////////////////////////////////////////////////////
// 
// Editing
// 
// //////////////////////////////////////////////////////////////////////////
/**
 * Create {@link IUiContentProvider} content providers for edit this model.
 */
@Override
public void createContentProviders(List<IUiContentProvider> providers, DatabindingsProvider provider, boolean useClear) {
    ChooseClassConfiguration configuration = new ChooseClassConfiguration();
    configuration.setDialogFieldLabel(Messages.ObservableMapLabelProviderInfo_title);
    configuration.setValueScope(MAP_PROVIDER_CLASS);
    if (useClear) {
        configuration.setClearValue(MAP_PROVIDER_CLASS);
        configuration.setBaseClassNames(MAP_PROVIDER_CLASS, "org.eclipse.jface.databinding.viewers.ObservableMapCellLabelProvider");
        configuration.setConstructorsParameters(new Class[] { IObservableMap[].class }, new Class[] { IObservableMap.class });
    } else {
        configuration.setBaseClassName("org.eclipse.jface.viewers.IBaseLabelProvider");
    }
    configuration.setEmptyClassErrorMessage(Messages.ObservableMapLabelProviderInfo_emptyMessage);
    configuration.setErrorMessagePrefix(Messages.ObservableMapLabelProviderInfo_errorPrefix);
    // 
    SimpleClassUiContentProvider contentProvider = new SimpleClassUiContentProvider(configuration, this);
    contentProvider.getDialogField().setEnabled(m_binding.getCodeSupport() == null);
    providers.add(contentProvider);
}
Also used : IObservableMap(org.eclipse.core.databinding.observable.map.IObservableMap) SimpleClassUiContentProvider(org.eclipse.wb.internal.rcp.databinding.ui.contentproviders.SimpleClassUiContentProvider) ChooseClassConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassConfiguration)

Example 2 with ChooseClassConfiguration

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

the class TreeViewerInputBindingInfo method createContentProviders.

// //////////////////////////////////////////////////////////////////////////
// 
// Editing
// 
// //////////////////////////////////////////////////////////////////////////
@Override
public void createContentProviders(List<IUiContentProvider> providers, IPageListener listener, DatabindingsProvider provider) throws Exception {
    // configure page
    listener.setTitle(Messages.TreeViewerInputBindingInfo_title);
    listener.setMessage(Messages.TreeViewerInputBindingInfo_errorMessage);
    // 
    providers.add(new LabelUiContentProvider(Messages.TreeViewerInputBindingInfo_viewerLabel, m_viewerBindable.getPresentation().getTextForBinding()));
    providers.add(new LabelUiContentProvider(Messages.TreeViewerInputBindingInfo_inputLabel, m_inputObservable.getPresentationText()));
    // 
    TreeInputElementUiContentProvider inputEditor = new TreeInputElementUiContentProvider(this, listener, provider);
    // 
    if (m_inputObservable instanceof DetailBeanObservableInfo) {
        m_inputObservable.createContentProviders(providers, null, provider);
        // 
        ChooseClassAndPropertiesUiContentProvider masterUIContentProvider = (ChooseClassAndPropertiesUiContentProvider) providers.get(providers.size() - 1);
        // 
        ChooseClassConfiguration configuration = new ChooseClassConfiguration();
        configuration.setDialogFieldLabel(Messages.TreeViewerInputBindingInfo_chooseLabel);
        configuration.setValueScope("beans1");
        configuration.setChooseInterfaces(true);
        configuration.setEmptyClassErrorMessage(Messages.TreeViewerInputBindingInfo_chooseEmptyMessage);
        configuration.setErrorMessagePrefix(Messages.TreeViewerInputBindingInfo_chooseErrorPrefix);
        // 
        TreeDetailUiContentProvider detailUIContentProvider = new TreeDetailUiContentProvider(configuration, (DetailBeanObservableInfo) m_inputObservable);
        providers.add(detailUIContentProvider);
        // 
        new ChooseClassAndPropertiesRouter(masterUIContentProvider, detailUIContentProvider);
        new ChooseClassRouter(detailUIContentProvider, new MultiTargetRunnable(detailUIContentProvider, inputEditor.getElementTypeUIProviders()));
    }
    // 
    providers.add(inputEditor);
    // 
    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) TreeDetailUiContentProvider(org.eclipse.wb.internal.rcp.databinding.ui.contentproviders.TreeDetailUiContentProvider) ChooseClassRouter(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassRouter) TreeInputElementUiContentProvider(org.eclipse.wb.internal.rcp.databinding.ui.contentproviders.TreeInputElementUiContentProvider) ChooseClassAndPropertiesUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesUiContentProvider) MultiTargetRunnable(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.MultiTargetRunnable) DetailBeanObservableInfo(org.eclipse.wb.internal.rcp.databinding.model.beans.observables.DetailBeanObservableInfo) ChooseClassConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassConfiguration)

Example 3 with ChooseClassConfiguration

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

the class CheckedElementsObservableInfo method createContentProviders.

// //////////////////////////////////////////////////////////////////////////
// 
// Editing
// 
// //////////////////////////////////////////////////////////////////////////
@Override
public void createContentProviders(List<IUiContentProvider> providers, BindingUiContentProviderContext context, DatabindingsProvider provider) throws Exception {
    super.createContentProviders(providers, context, provider);
    // 
    ChooseClassConfiguration configuration = new ChooseClassConfiguration();
    configuration.setDialogFieldLabel(Messages.CheckedElementsObservableInfo_label);
    configuration.setValueScope("beans");
    configuration.setChooseInterfaces(true);
    configuration.setEmptyClassErrorMessage(MessageFormat.format(Messages.CheckedElementsObservableInfo_emptyMessage, context.getDirection()));
    configuration.setErrorMessagePrefix(MessageFormat.format(Messages.CheckedElementsObservableInfo_errorPrefix, context.getDirection()));
    // 
    providers.add(new CheckedElementsUiContentProvider(configuration, this, provider));
}
Also used : CheckedElementsUiContentProvider(org.eclipse.wb.internal.rcp.databinding.ui.contentproviders.CheckedElementsUiContentProvider) ChooseClassConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassConfiguration)

Example 4 with ChooseClassConfiguration

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

the class UpdateListStrategyInfo method createConfiguration.

// //////////////////////////////////////////////////////////////////////////
// 
// Editing
// 
// //////////////////////////////////////////////////////////////////////////
@Override
protected ChooseClassConfiguration createConfiguration(BindingUiContentProviderContext context) {
    ChooseClassConfiguration configuration = super.createConfiguration(context);
    configuration.setDialogFieldLabel(Messages.UpdateListStrategyInfo_title);
    configuration.setDefaultValues(new String[] { "POLICY_UPDATE", "POLICY_NEVER", "POLICY_ON_REQUEST" });
    return configuration;
}
Also used : ChooseClassConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassConfiguration)

Example 5 with ChooseClassConfiguration

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

the class UpdateStrategyInfo method createConfiguration.

// //////////////////////////////////////////////////////////////////////////
// 
// Editing
// 
// //////////////////////////////////////////////////////////////////////////
/**
 * Create configuration for edit this strategy.
 */
protected ChooseClassConfiguration createConfiguration(BindingUiContentProviderContext context) {
    ChooseClassConfiguration configuration = new ChooseClassConfiguration();
    configuration.setValueScope(getStrategyClass());
    configuration.setRetargetClassName(getStrategyClass(), "POLICY_UPDATE");
    configuration.setBaseClassName(getStrategyClass());
    configuration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
    configuration.setEmptyClassErrorMessage(MessageFormat.format(Messages.UpdateStrategyInfo_errorMessage, context.getDirection()));
    configuration.setErrorMessagePrefix(MessageFormat.format(Messages.UpdateStrategyInfo_errorMessagePrefix, context.getDirection()));
    // 
    if (m_strategyType == StrategyType.ExtendetClass && m_strategyValue.toString().indexOf('(') != -1) {
        configuration.addDefaultStart(m_strategyValue.toString());
    }
    // 
    return configuration;
}
Also used : ChooseClassConfiguration(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassConfiguration)

Aggregations

ChooseClassConfiguration (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassConfiguration)24 IUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider)5 DatabindingsProvider (org.eclipse.wb.internal.rcp.databinding.DatabindingsProvider)5 BindingInfo (org.eclipse.wb.internal.rcp.databinding.model.context.BindingInfo)5 SimpleClassUiContentProvider (org.eclipse.wb.internal.rcp.databinding.ui.contentproviders.SimpleClassUiContentProvider)5 CompositeInfo (org.eclipse.wb.internal.swt.model.widgets.CompositeInfo)5 List (java.util.List)4 BindingUiContentProviderContext (org.eclipse.wb.internal.rcp.databinding.model.context.BindingUiContentProviderContext)4 LabelUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.LabelUiContentProvider)2 IObservableMap (org.eclipse.core.databinding.observable.map.IObservableMap)1 Image (org.eclipse.swt.graphics.Image)1 IPageListener (org.eclipse.wb.internal.core.databinding.ui.editor.IPageListener)1 ChooseClassAndPropertiesConfiguration (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesConfiguration)1 ChooseClassAndPropertiesRouter (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesRouter)1 ChooseClassAndPropertiesUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesUiContentProvider)1 ChooseClassRouter (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassRouter)1 ChooseClassUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassUiContentProvider)1 MultiTargetRunnable (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.MultiTargetRunnable)1 RunnableEx (org.eclipse.wb.internal.core.utils.execution.RunnableEx)1 BeanBindableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.bindables.BeanBindableInfo)1