/** @see org.openquark.gems.client.valueentry.ValueEditor#setEditable(boolean) */
  @Override
  public void setEditable(boolean editable) {

    super.setEditable(editable);

    for (final DataConstructorEditorPanel dataConstructorEditorPanel : editorPanelList) {
      dataConstructorEditorPanel.setArgumentEditorsEditable(editable);
    }
  }
  /** @see org.openquark.gems.client.valueentry.ValueEditor#commitValue() */
  @Override
  public void commitValue() {

    removeFocusListener();

    // Make sure we are using the correct value node.
    if (focusChangeListener.getFocusedPanel() != null) {
      replaceValueNode(focusChangeListener.getFocusedPanel().getValueNode().copyValueNode(), true);
    }

    super.commitValue();
  }
  /**
   * Sets the focused look of this editor panel. If the editor is focused it will display value
   * entry panels for the data constructor argument values and use a different background color. If
   * focused is true then the first value entry panel will be added to the editor hierarchy.
   *
   * @param focused whether to have the focused look
   */
  public void setFocusedLook(boolean focused) {

    setBorder(focused ? FOCUSED_BORDER : NORMAL_BORDER);
    setBackground(focused ? FOCUSED_BACKGROUND_COLOR : NORMAL_BACKGROUND_COLOR);

    titleLabel.setForeground(focused ? FOCUSED_FOREGROUND_COLOR : NORMAL_FOREGROUND_COLOR);

    for (int i = 0; editorPanels != null && i < editorPanels.length; i++) {
      editorPanels[i].setFocusedLook(focused);
    }

    if (focused && parentEditor.isEditable()) {
      addChildEditorToHierarchy();
    }
  }
 /** @see org.openquark.gems.client.valueentry.ValueEditor#cancelValue() */
 @Override
 public void cancelValue() {
   removeFocusListener();
   super.cancelValue();
 }