code: public void onSelectionChanged(SelectionEvent event) {
  		int count = event.getSelection().length;
  		if (count == 0) {
  			focusButton.setDisabled(true);
  			showButton.setDisabled(true);
  		} else if (count == 1) {
  			focusButton.setDisabled(false);
  			showButton.setDisabled(false);
  		} else {
  			focusButton.setDisabled(false);
  			showButton.setDisabled(true);
  		}
  		for (ToolStripButton button : extraButtons) {
  			button.setDisabled(count == 0);
  		}
  	}
docs: ----------------------------------------------------------