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;
}
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);
}
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));
}
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;
}
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;
}
});
}
Aggregations