use of org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider in project jbosstools-openshift by jbosstools.
the class BuildConfigWizardPage method createBuildConfigsViewer.
private TreeViewer createBuildConfigsViewer(Tree tree, IBuildConfigPageModel model, DataBindingContext dbc) {
TreeViewer buildConfigsViewer = new TreeViewer(tree);
IListProperty childrenProperty = new MultiListProperty(new IListProperty[] { BeanProperties.list(IBuildConfigPageModel.PROPERTY_BUILDCONFIGS), BeanProperties.list(ObservableTreeItem.PROPERTY_CHILDREN) });
ObservableListTreeContentProvider contentProvider = new ObservableListTreeContentProvider(childrenProperty.listFactory(), null);
buildConfigsViewer.setContentProvider(contentProvider);
buildConfigsViewer.setLabelProvider(new ObservableTreeItemStyledCellLabelProvider());
buildConfigsViewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
buildConfigsViewer.setComparator(ProjectViewerComparator.createProjectTreeSorter(new OpenShiftExplorerLabelProvider()));
buildConfigsViewer.setInput(model);
return buildConfigsViewer;
}
use of org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider in project jbosstools-openshift by jbosstools.
the class ApplicationSourceListPage method createServerTemplatesViewer.
private TreeViewer createServerTemplatesViewer(Composite parent, final Text templateFilterText) {
TreeViewer viewer = new TreeViewer(parent, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
IListProperty childrenProperty = new MultiListProperty(new IListProperty[] { BeanProperties.list(IApplicationSourceListPageModel.PROPERTY_APP_SOURCES), BeanProperties.list(ObservableTreeItem.PROPERTY_CHILDREN) });
ObservableListTreeContentProvider contentProvider = new ObservableListTreeContentProvider(childrenProperty.listFactory(), null);
viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(new ObservableTreeItemStyledCellLabelProvider());
viewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
viewer.setComparator(new ApplicationSourceComparator());
viewer.addFilter(new AppSourceViewerFilter(templateFilterText));
templateFilterText.addKeyListener(onFilterKeyPressed(viewer));
viewer.setInput(model);
return viewer;
}
use of org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPage method createResourcesTreeViewer.
@SuppressWarnings("unchecked")
private TreeViewer createResourcesTreeViewer(Composite parent, ServerSettingsWizardPageModel model, Text selectorText) {
TreeViewer applicationTemplatesViewer = new TreeViewer(parent, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
IListProperty<ServerSettingsWizardPageModel, ObservableTreeItem> childrenProperty = new MultiListProperty<>(new IListProperty[] { BeanProperties.list(ServerSettingsWizardPageModel.PROPERTY_RESOURCE_ITEMS), BeanProperties.list(ObservableTreeItem.PROPERTY_CHILDREN) });
ObservableListTreeContentProvider contentProvider = new ObservableListTreeContentProvider(childrenProperty.listFactory(), null);
applicationTemplatesViewer.setContentProvider(contentProvider);
applicationTemplatesViewer.setLabelProvider(new ResourcesViewLabelProvider());
applicationTemplatesViewer.addFilter(new ServiceViewerFilter(selectorText));
applicationTemplatesViewer.setComparator(ProjectViewerComparator.createProjectTreeSorter());
applicationTemplatesViewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
applicationTemplatesViewer.setInput(model);
return applicationTemplatesViewer;
}
Aggregations