use of org.bndtools.utils.swt.FilterPanelPart in project bndtools by bndtools.
the class ProjectListControl method createFilter.
private void createFilter(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout(2, false);
gridLayout.marginHeight = gridLayout.marginWidth = 0;
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
composite.setLayout(gridLayout);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.grabExcessHorizontalSpace = true;
composite.setLayoutData(gridData);
FilterPanelPart filterPart = new FilterPanelPart(Activator.getDefault().getScheduler());
filterPart.createControl(composite, 0, 0);
filterPart.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
String filter = (String) event.getNewValue();
updatedFilter(filter);
}
});
ToolBar toolbar = new ToolBar(composite, SWT.FLAT);
ToolItem tiCheckAll = new ToolItem(toolbar, SWT.FLAT);
tiCheckAll.setImage(Activator.getImageDescriptor("icons/check_all.gif").createImage());
tiCheckAll.setToolTipText(Messages.checkAll);
tiCheckAll.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Object[] objs = contentProvider.getElements(null);
for (Object obj : objs) {
ProjectDiff diff = (ProjectDiff) obj;
diff.setRelease(true);
}
tableViewer.refresh();
}
});
ToolItem tiUncheckAll = new ToolItem(toolbar, SWT.FLAT);
tiUncheckAll.setImage(Activator.getImageDescriptor("icons/uncheck_all.gif").createImage());
tiUncheckAll.setToolTipText(Messages.uncheckAll);
tiUncheckAll.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Object[] objs = contentProvider.getElements(null);
for (Object obj : objs) {
ProjectDiff diff = (ProjectDiff) obj;
diff.setRelease(false);
}
tableViewer.refresh();
}
});
}
Aggregations