code: public void updateStates(ElementBase ele, IDisable add, IDisable delete, IDisable copy, IDisable cut, IDisable paste,
                               IDisable properties, IDisable about) {
          boolean isNull = ele == null;
          boolean isLocked = isNull || ele.isLocked();
          boolean noDelete = isLocked || ele.getDefinition().isInternal();
          boolean noAdd = isLocked || !ele.canAcceptChild();
          boolean noEdit = isLocked || !ele.getDefinition().hasEditableProperties();
          Object cbData = Clipboard.getInstance().getData();
          Class<? extends ElementBase> clazz = cbData instanceof Layout ? ((Layout) cbData).getRootClass() : null;
          boolean noPaste = noAdd || clazz == null || !ele.canAcceptChild(clazz)
                  || !ElementBase.canAcceptParent(clazz, ele.getClass());
          disable(add, noAdd);
          disable(delete, noDelete);
          disable(copy, isNull);
          disable(cut, noDelete);
          disable(paste, noPaste);
          disable(properties, noEdit);
          disable(about, isNull);
      }
docs: Updates states on input elements (typically buttons or menu items) according to state of the
  specified UI element. Any parameter may be null.
  
  @param ele A UI element.
  @param add Add input element.
  @param delete Delete input element.
  @param copy Copy input element.
  @param cut Cut input element.
  @param paste Paste input element.
  @param properties Properties input element.
  @param about About input element.