use of org.bndtools.core.ui.resource.RequirementLabelProvider in project bndtools by bndtools.
the class RunBlacklistPart method createSection.
private void createSection(Section section, FormToolkit tk) {
section.setText("Run Blacklist");
section.setDescription("The specified requirements will be excluded from the resolution.");
// Create toolbar
ToolBar toolbar = new ToolBar(section, SWT.FLAT);
section.setTextClient(toolbar);
fillToolBar(toolbar);
// Create main panel
Composite composite = tk.createComposite(section);
section.setClient(composite);
table = tk.createTable(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
viewer = new TableViewer(table);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setLabelProvider(new RequirementLabelProvider());
// Listeners
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
removeTool.setEnabled(!viewer.getSelection().isEmpty());
}
});
table.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if (e.character == SWT.DEL) {
doRemove();
} else if (e.character == '+') {
doAddBundle();
}
}
});
RequirementViewerDropAdapter dropper = new RequirementViewerDropAdapter();
dropper.install(viewer);
// Layout
GridLayout layout;
GridData gd;
layout = new GridLayout(2, false);
layout.horizontalSpacing = 0;
layout.verticalSpacing = 5;
layout.marginHeight = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
gd.widthHint = 50;
gd.heightHint = 50;
table.setLayoutData(gd);
gd = new GridData(SWT.RIGHT, SWT.CENTER, true, false);
}
use of org.bndtools.core.ui.resource.RequirementLabelProvider in project bndtools by bndtools.
the class RunRequirementsPart method createSection.
private void createSection(Section section, FormToolkit tk) {
section.setText("Run Requirements");
section.setDescription("The specified requirements will be used to resolve a set of runtime bundles from available repositories.");
// Create toolbar
ToolBar toolbar = new ToolBar(section, SWT.FLAT);
section.setTextClient(toolbar);
fillToolBar(toolbar);
// Create main panel
Composite composite = tk.createComposite(section);
section.setClient(composite);
table = tk.createTable(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
viewer = new TableViewer(table);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setLabelProvider(new RequirementLabelProvider());
btnAutoResolve = tk.createButton(composite, "Auto-resolve on save", SWT.CHECK);
btnResolveNow = tk.createButton(composite, "Resolve", SWT.PUSH);
btnResolveNow.setImage(resolveIcon);
// Listeners
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
removeTool.setEnabled(!viewer.getSelection().isEmpty());
}
});
table.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if (e.character == SWT.DEL) {
doRemove();
} else if (e.character == '+') {
doAddBundle();
}
}
});
RequirementViewerDropAdapter dropper = new RequirementViewerDropAdapter();
dropper.install(viewer);
btnAutoResolve.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ResolveMode old = resolveMode;
resolveMode = btnAutoResolve.getSelection() ? ResolveMode.auto : ResolveMode.manual;
updateButtonStates();
if (old != resolveMode)
markDirty();
}
});
btnResolveNow.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
btnResolveNow.setEnabled(false);
doResolve();
}
});
// Layout
GridLayout layout;
GridData gd;
layout = new GridLayout(2, false);
layout.horizontalSpacing = 0;
layout.verticalSpacing = 5;
layout.marginHeight = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
gd.widthHint = 50;
gd.heightHint = 50;
table.setLayoutData(gd);
gd = new GridData(SWT.RIGHT, SWT.CENTER, true, false);
btnResolveNow.setLayoutData(gd);
}
Aggregations