本文整理汇总了Java中org.eclipse.jface.databinding.viewers.ObservableListContentProvider类的典型用法代码示例。如果您正苦于以下问题:Java ObservableListContentProvider类的具体用法?Java ObservableListContentProvider怎么用?Java ObservableListContentProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ObservableListContentProvider类属于org.eclipse.jface.databinding.viewers包,在下文中一共展示了ObservableListContentProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
@Override
public void init ( final ICommonContentExtensionSite config )
{
final ITreeContentProvider contentProvider = config.getService ().getContentExtensionById ( this.contentExtensionId ).getContentProvider ();
if ( contentProvider instanceof ObservableSetTreeContentProvider )
{
addSource ( ( (ObservableSetTreeContentProvider)contentProvider ).getKnownElements () );
}
else if ( contentProvider instanceof ObservableSetContentProvider )
{
addSource ( ( (ObservableSetContentProvider)contentProvider ).getKnownElements () );
}
else if ( contentProvider instanceof ObservableListContentProvider )
{
addSource ( ( (ObservableListContentProvider)contentProvider ).getKnownElements () );
}
else if ( contentProvider instanceof ObservableListTreeContentProvider )
{
addSource ( ( (ObservableListTreeContentProvider)contentProvider ).getKnownElements () );
}
}
示例2: createTable
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
public TableViewer createTable(
final Composite parent,
final WritableList<IGuiIconDescription> descriptions,
final IObjectModel<String> searchStringModel) {
final GuiIconDescriptionViewerFilter viewerFilter = new GuiIconDescriptionViewerFilter();
final TableViewer table = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
createColumns(table);
table.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
table.setContentProvider(new ObservableListContentProvider());
table.setInput(descriptions);
table.setLabelProvider(new TableLabelProvider());
table.setFilters(viewerFilter);
searchStringModel.addChangeListener(new IChangeableObjectListener() {
@Override
public void objectChanged() {
viewerFilter.setSearchText(searchStringModel.get());
table.refresh();
}
});
return table;
}
示例3: initDataBindings
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap[] observeMaps = EMFEditObservables.observeMaps(editingDomain, listContentProvider.getKnownElements(), new EStructuralFeature[]{Literals.ENTITY__NAME});
tableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps));
tableViewer.setContentProvider(listContentProvider);
//
IObservableList architectureCloudProvidersObserveList = EMFEditObservables.observeList(Realm.getDefault(), editingDomain, architecture, ArchitecturePackage.Literals.ARCHITECTURE__CLOUD_ENVIRONMENTS);
tableViewer.setInput(architectureCloudProvidersObserveList);
//
IObservableValue observeSingleSelectionTableViewer = ViewerProperties.singleSelection().observe(tableViewer);
IObservableValue cloudProviderCloudProviderModelObserveValue = BeanProperties.value("cloudProvider").observe(cloudProviderModel);
bindingContext.bindValue(observeSingleSelectionTableViewer, cloudProviderCloudProviderModelObserveValue, null, null);
//
return bindingContext;
}
示例4: initPaaS
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
private void initPaaS (Specification specification)
{
List<? extends PlatformServiceDescriptor> paaSDescriptors = null;
if (specification instanceof CloudSpecification)
paaSDescriptors = OverviewHelper.getPaaSRuntimeDescriptors((CloudSpecification)specification);
else if (specification instanceof ServiceSpecification)
paaSDescriptors = OverviewHelper.getPlatformDescriptors((ServiceSpecification)specification, false, true);
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap observeMap = PojoObservables.observeMap(listContentProvider.getKnownElements(), ProvidedPlatformRuntimeServiceDescriptor.class, "name");
cvPaaS.setLabelProvider(new ObservableMapLabelProvider(observeMap));
cvPaaS.setContentProvider(listContentProvider);
IObservableList selfList = Properties.selfList(CloudSpecification.class).observe(paaSDescriptors);
cvPaaS.setInput(selfList);
// set default selection
if (!paaSDescriptors.isEmpty())
{
final ISelection selection = new StructuredSelection(paaSDescriptors.get(0));
cvPaaS.setSelection(selection);
}
}
示例5: init
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
@PostConstruct
public void init(final EMenuService inService) {
inService.registerContextMenu(viewer.getControl(), getPopupID());
viewer.setContentProvider(new ObservableListContentProvider());
viewer.setSorter(new ViewerSorter(languageService.getContentLanguage()));
viewer.setInput(getDBInput());
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(final SelectionChangedEvent inEvent) {
selectionService.setSelection(((IStructuredSelection) inEvent
.getSelection()).getFirstElement());
}
});
hookDoubleClickAction();
hookDragnDrop();
}
示例6: createListControl
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
private void createListControl(final int inIndent) {
results = new TableViewer(search,
SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.MULTI);
results.setContentProvider(new ObservableListContentProvider());
results.setLabelProvider(getLabelProvider());
results.addDoubleClickListener(getDoubleClickListener());
results.addDragSupport(DND.DROP_COPY, getDragTypes(),
getDragSourceAdapter(results));
results.addSelectionChangedListener(getSelectionChangedListener());
final Control lControl = results.getControl();
final GridData lLayout = new GridData(SWT.FILL, SWT.FILL, true, true);
lLayout.horizontalIndent = inIndent;
lControl.setLayoutData(lLayout);
}
示例7: createListSection
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
public void createListSection ( final ScrolledForm form, final ConfigurationEditorInput input, final String attribute, final String label, final String delimiter, final String pattern )
{
final IObservableList list = StringSplitListObservable.observeString ( Observables.observeMapEntry ( input.getDataMap (), attribute, String.class ), delimiter, pattern );
// section
final Section section = this.toolkit.createSection ( form.getBody (), ExpandableComposite.TITLE_BAR );
section.setText ( label );
final Composite client = this.toolkit.createComposite ( section, SWT.NONE );
section.setClient ( client );
this.toolkit.paintBordersFor ( client );
client.setLayout ( new GridLayout ( 1, true ) );
final GridData gd = new GridData ( GridData.FILL_BOTH );
gd.horizontalSpan = 2;
section.setLayoutData ( gd );
// fields
final ListViewer viewer = new ListViewer ( client );
viewer.setContentProvider ( new ObservableListContentProvider () );
viewer.setInput ( list );
viewer.getControl ().setLayoutData ( new GridData ( GridData.FILL_BOTH ) );
viewer.setSorter ( new ViewerSorter () );
}
示例8: createTable
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
public TableViewer createTable(final Composite parent, final WritableList<IDependencyRelation> descriptions) {
final TableViewer table = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
createColumns(table);
table.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
table.setContentProvider(new ObservableListContentProvider());
table.setInput(descriptions);
table.setLabelProvider(new TableLabelProvider());
ColumnViewerToolTipSupport.enableFor(table);
return table;
}
示例9: createTable
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
public TableViewer createTable(final Composite parent, final WritableList<IType> descriptions) {
final TableViewer table = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
createColumns(table);
table.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
table.setContentProvider(new ObservableListContentProvider());
table.setInput(descriptions);
table.setLabelProvider(new TableLabelProvider());
ColumnViewerToolTipSupport.enableFor(table);
return table;
}
示例10: customizeEmployees
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
public void customizeEmployees(TableViewer viewer) {
viewer.setContentProvider(new ObservableListContentProvider());
viewer.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
Employee emp = (Employee) element;
return String.format("%s %s (id=%d)", emp.getFirstName(), emp.getLastName(), emp.getId());
}
});
}
示例11: initDataBindings
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap[] observeMaps = BeansObservables.observeMaps(listContentProvider.getKnownElements(), Preference.class, new String[]{"name", "value"});
preferencesViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps));
preferencesViewer.setContentProvider(listContentProvider);
//
IObservableList preferencesGetWidgetObserveList = BeanProperties.list("preferences").observe(getWidget());
preferencesViewer.setInput(preferencesGetWidgetObserveList);
//
ObservableListContentProvider listContentProvider_1 = new ObservableListContentProvider();
IObservableMap[] observeMaps_1 = BeansObservables.observeMaps(listContentProvider_1.getKnownElements(), Access.class, new String[]{"origin", "subdomains", "browserOnly"});
accessViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps_1));
accessViewer.setContentProvider(listContentProvider_1);
//
IObservableList accessesGetWidgetObserveList = BeanProperties.list("accesses").observe(getWidget());
accessViewer.setInput(accessesGetWidgetObserveList);
//
ObservableListContentProvider listContentProvider_2 = new ObservableListContentProvider();
IObservableMap[] observeMapsPlugin = BeansObservables.observeMaps(listContentProvider_2.getKnownElements(), Plugin.class, new String[]{"name", "spec"});
featuresTableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMapsPlugin));
featuresTableViewer.setContentProvider(listContentProvider_2);
//
IObservableList featuresGetWidgetObserveList = BeanProperties.list("plugins").observe(getWidget());
featuresTableViewer.setInput(featuresGetWidgetObserveList);
//
return bindingContext;
}
示例12: initDataBindings
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap[] observeMaps = EMFEditObservables.observeMaps(editingDomain, listContentProvider.getKnownElements(), new EStructuralFeature[]{Literals.ENTITY__NAME});
tableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps));
tableViewer.setContentProvider(listContentProvider);
//
IObservableList appServiceContainerApplicationServicesObserveList = EMFEditObservables.observeList(Realm.getDefault(), editingDomain, softwareServiceContainer, ArchitecturePackage.Literals.SOFTWARE_SERVICE_CONTAINER__SOFTWARE_SERVICES);
tableViewer.setInput(appServiceContainerApplicationServicesObserveList);
//
return bindingContext;
}
示例13: initDataBindings
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap[] observeMaps = PojoObservables.observeMaps(listContentProvider.getKnownElements(), OperationInterface.class, new String[]{"name", "providingContainer.name"});
tableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps));
tableViewer.setContentProvider(listContentProvider);
//
IObservableList selfList = Properties.selfList(OperationInterface.class).observe(possibleInterfaces);
tableViewer.setInput(selfList);
//
return bindingContext;
}
示例14: initDataBindings
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap[] observeMaps = EMFEditObservables.observeMaps(editingDomain, listContentProvider.getKnownElements(), new EStructuralFeature[]{Literals.ENTITY__NAME, ApplicationPackage.Literals.OPERATION_INTERFACE__PROVIDING_CONTAINER});
tableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps){
@Override
public String getColumnText(Object element, int columnIndex) {
// TODO Auto-generated method stub
if (columnIndex == 1)
{
EObject container = ((OperationInterface)element).getProvidingContainer();
if(container != null){
return ((OperationInterface)element).getProvidingContainer().getName();
}
else{
return "Unresolved Operation Interface.";
}
}
return super.getColumnText(element, columnIndex);
}
});
tableViewer.setContentProvider(listContentProvider);
//
IObservableList applicationServiceRequiredInterfacesObserveList = EMFEditObservables.observeList(Realm.getDefault(), editingDomain, softwareService, ApplicationPackage.Literals.OPERATION_INTERFACE_CONTAINER__REQUIRED_INTERFACES);
tableViewer.setInput(applicationServiceRequiredInterfacesObserveList);
//
return bindingContext;
}
示例15: initDataBindings
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap[] observeMaps = EMFEditObservables.observeMaps(editingDomain, listContentProvider.getKnownElements(), new EStructuralFeature[]{ApplicationPackage.Literals.OPERATION__RETURN_PARAMETER, ApplicationPackage.Literals.OPERATION__PARAMETERS});
tableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps));
tableViewer.setContentProvider(listContentProvider);
//
IObservableList providedInterfaceOperationsObserveList = EMFEditObservables.observeList(Realm.getDefault(), editingDomain, providedInterface, ApplicationPackage.Literals.OPERATION_INTERFACE__OPERATIONS);
tableViewer.setInput(providedInterfaceOperationsObserveList);
//
return bindingContext;
}