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