Search in sources :

Example 1 with MTreeViewer

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

use of org.hibernate.eclipse.console.viewers.xpl.MTreeViewer in project jbosstools-hibernate by jbosstools.

the class CloseConfigAction method doCloseConfig.

protected void doCloseConfig() {
    for (Iterator<?> i = getSelectedNonResources().iterator(); i.hasNext(); ) {
        Object node = i.next();
        if (!(node instanceof ConsoleConfiguration)) {
            continue;
        }
        ConsoleConfiguration config = (ConsoleConfiguration) node;
        ((MTreeViewer) viewer).clearChildren(config);
        config.reset();
        viewer.refresh(node);
    }
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) MTreeViewer(org.hibernate.eclipse.console.viewers.xpl.MTreeViewer)

Aggregations

MTreeViewer (org.hibernate.eclipse.console.viewers.xpl.MTreeViewer)2 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)1 AnyAdaptableLabelProvider (org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider)1