Search in sources :

Example 1 with AnyAdaptableLabelProvider

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

the class KnownConfigurationsView method createPartControl.

public void createPartControl(Composite parent) {
    // viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    viewer = new MTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    /*viewer.setContentProvider(new ConfigurationsContentProvider() );*/
    /*viewer.setLabelProvider(new ConfigurationsLabelProvider() );*/
    viewer.setLabelProvider(new AnyAdaptableLabelProvider());
    final KnownConfigurationsProvider cp = new KnownConfigurationsProvider();
    viewer.setContentProvider(cp);
    getDebugUIPlugin().getPreferenceStore().addPropertyChangeListener(cp);
    viewer.getTree().addDisposeListener(new DisposeListener() {

        public void widgetDisposed(DisposeEvent e) {
            getDebugUIPlugin().getPreferenceStore().removePropertyChangeListener(cp);
        }
    });
    // viewer.setInput(KnownConfigurations.getInstance().getRootNode() );
    viewer.setInput(KnownConfigurations.getInstance());
    makeActions();
    createContextMenu();
    hookDoubleClick();
    provideSelection();
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) DisposeEvent(org.eclipse.swt.events.DisposeEvent) MTreeViewer(org.hibernate.eclipse.console.viewers.xpl.MTreeViewer) AnyAdaptableLabelProvider(org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider)

Example 2 with AnyAdaptableLabelProvider

use of org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider 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 3 with AnyAdaptableLabelProvider

use of org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider 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 4 with AnyAdaptableLabelProvider

use of org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider 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

AnyAdaptableLabelProvider (org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider)4 DeferredContentProvider (org.hibernate.eclipse.console.workbench.DeferredContentProvider)3 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)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 MTreeViewer (org.hibernate.eclipse.console.viewers.xpl.MTreeViewer)1 CheckedTreeSelectionDialog (org.hibernate.eclipse.mapper.editors.reveng.xpl.CheckedTreeSelectionDialog)1