/**
  * Sets the visibility of the action. The visibility can be changed at any time and has effect on
  * all occurrences of the action.
  *
  * @param visible the new state
  */
 public void setVisible(boolean visible) {
   if (visible != isVisible()) {
     if (visible) source.add(action);
     else source.remove(0, source.getDockActionCount());
   }
 }