Java Code Examples for org.eclipse.swt.widgets.Table.getSelection()

The following are Jave code examples for showing how to use getSelection() of the org.eclipse.swt.widgets.Table class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: ide-plugins   File: PluginsSWT.java   View Source Code Vote up 6 votes
private void checkSelection(final Table table) {
    TableItem[] items = table.getSelection();
    if (items != null && items.length > 0) {
        for (TableItem item: items) {
            Plugin plugin = (Plugin) item.getData();
            if (plugin != null) {
                if (source.stream().anyMatch(p -> p.equals(plugin))) {
                    btnSelect.setEnabled(true);
                } else if (target.stream().anyMatch(p -> p.equals(plugin))) {
                    btnDeselect.setEnabled(true);
                }
                return;
            }
        }
    }
    btnSelect.setEnabled(false);
    btnDeselect.setEnabled(false);
}