use of org.eclipse.equinox.internal.p2.ui.viewers.ProvElementContentProvider in project translationstudio8 by heartsome.
the class UpdateWizardPage method createControl.
public void createControl(final Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout();
gridLayout.marginWidth = 0;
gridLayout.marginHeight = 0;
composite.setLayout(gridLayout);
treeViewer = new TreeViewer(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
GridData data = new GridData(GridData.FILL_BOTH);
Tree tree = treeViewer.getTree();
tree.setLayoutData(data);
tree.setHeaderVisible(true);
IUColumnConfig[] columns = getColumnConfig();
for (int i = 0; i < columns.length; i++) {
TreeColumn tc = new TreeColumn(tree, SWT.LEFT, i);
tc.setResizable(true);
tc.setText(columns[i].getColumnTitle());
tc.setWidth(columns[i].getWidthInPixels(tree));
}
contentProvider = new ProvElementContentProvider();
treeViewer.setContentProvider(contentProvider);
labelProvider = new IUDetailsLabelProvider(null, getColumnConfig(), getShell());
treeViewer.setLabelProvider(labelProvider);
setControl(composite);
final Runnable runnable = new Runnable() {
public void run() {
// updateStatus(input, operation);
setDrilldownElements(input, operation);
treeViewer.setInput(input);
}
};
if (operation != null && !operation.hasResolved()) {
try {
getContainer().run(true, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
operation.resolveModal(monitor);
parent.getDisplay().asyncExec(runnable);
}
});
} catch (Exception e) {
StatusManager.getManager().handle(new Status(IStatus.ERROR, ProvUIActivator.PLUGIN_ID, e.getMessage(), e));
}
} else {
runnable.run();
}
}
Aggregations