Search in sources :

Example 1 with DeferredContentProvider

use of org.hibernate.eclipse.console.workbench.DeferredContentProvider in project jbosstools-hibernate by jbosstools.

the class TableFilterView method createTreeViewer.

protected TreeViewer createTreeViewer() {
    TreeViewer viewer = new TreeViewer(tree);
    viewer.setLabelProvider(new AnyAdaptableLabelProvider());
    viewer.setContentProvider(new DeferredContentProvider());
    viewer.setInput(null);
    return viewer;
}
Also used : TreeViewer(org.eclipse.jface.viewers.TreeViewer) DeferredContentProvider(org.hibernate.eclipse.console.workbench.DeferredContentProvider) AnyAdaptableLabelProvider(org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider)

Example 2 with DeferredContentProvider

use of org.hibernate.eclipse.console.workbench.DeferredContentProvider in project jbosstools-hibernate by jbosstools.

the class TablePropertiesBlock method createTreeSelectionDialog.

private CheckedTreeSelectionDialog createTreeSelectionDialog() {
    return new CheckedTreeSelectionDialog(getComposite().getShell(), new AnyAdaptableLabelProvider(), new DeferredContentProvider()) {

        protected Composite createSelectionButtons(Composite composite) {
            Composite buttonComposite = new Composite(composite, SWT.RIGHT);
            GridLayout layout = new GridLayout();
            layout.numColumns = 2;
            buttonComposite.setLayout(layout);
            buttonComposite.setFont(composite.getFont());
            GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
            data.grabExcessHorizontalSpace = true;
            composite.setData(data);
            Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, MapperMessages.TablePropertiesBlock_select_all_children, false);
            SelectionListener listener = new SelectionAdapter() {

                public void widgetSelected(SelectionEvent e) {
                    IStructuredSelection viewerElements = (IStructuredSelection) getTreeViewer().getSelection();
                    Iterator<?> iterator = viewerElements.iterator();
                    while (iterator.hasNext()) {
                        getTreeViewer().setSubtreeChecked(iterator.next(), true);
                    }
                    updateOKStatus();
                }
            };
            selectButton.addSelectionListener(listener);
            Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, MapperMessages.TablePropertiesBlock_deselect_all, false);
            listener = new SelectionAdapter() {

                public void widgetSelected(SelectionEvent e) {
                    getTreeViewer().setCheckedElements(new Object[0]);
                    updateOKStatus();
                }
            };
            deselectButton.addSelectionListener(listener);
            return buttonComposite;
        }

        protected boolean evaluateIfTreeEmpty(Object input) {
            return false;
        }
    };
}
Also used : Composite(org.eclipse.swt.widgets.Composite) CheckedTreeSelectionDialog(org.hibernate.eclipse.mapper.editors.reveng.xpl.CheckedTreeSelectionDialog) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) DeferredContentProvider(org.hibernate.eclipse.console.workbench.DeferredContentProvider) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) AnyAdaptableLabelProvider(org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 3 with DeferredContentProvider

use of org.hibernate.eclipse.console.workbench.DeferredContentProvider in project jbosstools-hibernate by jbosstools.

the class TypeMappingView method initialize.

protected void initialize() {
    super.initialize();
    tableViewer = createTypeMappingViewer();
    viewer = new TreeViewer(tree);
    viewer.setLabelProvider(new AnyAdaptableLabelProvider());
    viewer.setContentProvider(new DeferredContentProvider());
    viewer.setInput(null);
}
Also used : TreeViewer(org.eclipse.jface.viewers.TreeViewer) DeferredContentProvider(org.hibernate.eclipse.console.workbench.DeferredContentProvider) AnyAdaptableLabelProvider(org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider)

Aggregations

DeferredContentProvider (org.hibernate.eclipse.console.workbench.DeferredContentProvider)3 AnyAdaptableLabelProvider (org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider)3 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 SelectionListener (org.eclipse.swt.events.SelectionListener)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 CheckedTreeSelectionDialog (org.hibernate.eclipse.mapper.editors.reveng.xpl.CheckedTreeSelectionDialog)1