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();
}
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);
}
}
Aggregations