Search in sources :

Example 1 with ObservableListTreeContentProvider

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;
}
Also used : IListProperty(org.eclipse.core.databinding.property.list.IListProperty) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ObservableListTreeContentProvider(org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider) ObservableTreeItemStyledCellLabelProvider(org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItemStyledCellLabelProvider) OpenShiftExplorerLabelProvider(org.jboss.tools.openshift.internal.ui.explorer.OpenShiftExplorerLabelProvider) MultiListProperty(org.eclipse.core.databinding.property.list.MultiListProperty)

Example 2 with ObservableListTreeContentProvider

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;
}
Also used : IListProperty(org.eclipse.core.databinding.property.list.IListProperty) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ObservableListTreeContentProvider(org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider) ObservableTreeItemStyledCellLabelProvider(org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItemStyledCellLabelProvider) MultiListProperty(org.eclipse.core.databinding.property.list.MultiListProperty)

Example 3 with ObservableListTreeContentProvider

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;
}
Also used : TreeViewer(org.eclipse.jface.viewers.TreeViewer) ObservableListTreeContentProvider(org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider) ObservableTreeItem(org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItem) MultiListProperty(org.eclipse.core.databinding.property.list.MultiListProperty)

Aggregations

MultiListProperty (org.eclipse.core.databinding.property.list.MultiListProperty)3 ObservableListTreeContentProvider (org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider)3 TreeViewer (org.eclipse.jface.viewers.TreeViewer)3 IListProperty (org.eclipse.core.databinding.property.list.IListProperty)2 ObservableTreeItemStyledCellLabelProvider (org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItemStyledCellLabelProvider)2 OpenShiftExplorerLabelProvider (org.jboss.tools.openshift.internal.ui.explorer.OpenShiftExplorerLabelProvider)1 ObservableTreeItem (org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItem)1