use of bndtools.model.clauses.VersionedClauseLabelProvider in project bndtools by bndtools.
the class RunBundlesPart method getLabelProvider.
@Override
protected IBaseLabelProvider getLabelProvider() {
return new VersionedClauseLabelProvider() {
@Override
public void update(ViewerCell cell) {
Object element = cell.getElement();
if (element instanceof String) {
String builder = (String) element;
StyledString label = new StyledString(builder, StyledString.QUALIFIER_STYLER);
cell.setText(label.getString());
cell.setStyleRanges(label.getStyleRanges());
cell.setImage(projectImg);
} else {
super.update(cell);
}
}
};
}
use of bndtools.model.clauses.VersionedClauseLabelProvider in project bndtools by bndtools.
the class MapValuesContentProvider method createSelectedBundlesPanel.
Control createSelectedBundlesPanel(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
new Label(panel, SWT.NONE).setText("Selected Bundles:");
Table selectedTable = new Table(panel, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
selectedViewer = new TableViewer(selectedTable);
selectedViewer.setContentProvider(new MapValuesContentProvider());
selectedViewer.setLabelProvider(new VersionedClauseLabelProvider());
selectedViewer.setInput(selectedBundles);
selectedViewer.addSelectionChangedListener(new ISelectionChangedListener() {
// Enable the remove button when a bundle is selected on the right
@Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection sel = selectedViewer.getSelection();
removeButton.setEnabled(!sel.isEmpty());
}
});
selectedViewer.addOpenListener(new IOpenListener() {
@Override
public void open(OpenEvent event) {
doRemove();
}
});
GridLayout layout;
GridData gd;
layout = new GridLayout(1, false);
panel.setLayout(layout);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = 300;
gd.widthHint = 250;
selectedTable.setLayoutData(gd);
return panel;
}
Aggregations