/** * @since 3.4 */ @Override public boolean isVisible() { if (visibleEnabled) { return super.isVisible() && isEnabled(); } return super.isVisible(); }
private void updateButton() { Button item = (Button) widget; String text = label; if (text == null) { if (command != null) { try { text = command.getCommand().getName(); } catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); } } } if (text != null) { item.setText(text); } String toolTipText = getToolTipText(text); item.setToolTipText(toolTipText); if (item.getSelection() != checkedState) { item.setSelection(checkedState); } // allow the handler update its enablement boolean shouldBeEnabled = isEnabled(); // disabled command + visibility follows enablement == disposed if (!item.isDisposed() && item.getEnabled() != shouldBeEnabled) { item.setEnabled(shouldBeEnabled); } }
boolean shouldBeEnabled = isEnabled();
boolean shouldBeEnabled = isEnabled();