@Override
  @SuppressWarnings({"EmptyCatchBlock"})
  public void readExternal(final Element element) {
    myId = element.getAttributeValue(ID_ATTR);
    myWasRead = true;
    try {
      myActive = Boolean.valueOf(element.getAttributeValue(ACTIVE_ATTR)).booleanValue();
    } catch (NumberFormatException ignored) {
    }
    try {
      myAnchor = ToolWindowAnchor.fromText(element.getAttributeValue(ANCHOR_ATTR));
    } catch (IllegalArgumentException ignored) {
    }
    myAutoHide = Boolean.valueOf(element.getAttributeValue(AUTOHIDE_ATTR)).booleanValue();
    try {
      myInternalType = ToolWindowType.valueOf(element.getAttributeValue(INTERNAL_TYPE_ATTR));
    } catch (IllegalArgumentException ignored) {
    }
    try {
      setTypeAndCheck(ToolWindowType.valueOf(element.getAttributeValue(TYPE_ATTR)));
    } catch (IllegalArgumentException ignored) {
    }
    myVisible = Boolean.valueOf(element.getAttributeValue(VISIBLE_ATTR)).booleanValue();
    if (element.getAttributeValue(SHOW_STRIPE_BUTTON) != null) {
      myShowStripeButton =
          Boolean.valueOf(element.getAttributeValue(SHOW_STRIPE_BUTTON)).booleanValue();
    }
    try {
      myWeight = Float.parseFloat(element.getAttributeValue(WEIGHT_ATTR));
    } catch (NumberFormatException ignored) {
    }
    try {
      String value = element.getAttributeValue(SIDE_WEIGHT_ATTR);
      if (value != null) {
        mySideWeight = Float.parseFloat(value);
      }
    } catch (NumberFormatException ignored) {
    }
    try {
      myOrder = Integer.valueOf(element.getAttributeValue(ORDER_ATTR)).intValue();
    } catch (NumberFormatException ignored) {
    }
    try {
      int x = Integer.parseInt(element.getAttributeValue(X_ATTR));
      int y = Integer.parseInt(element.getAttributeValue(Y_ATTR));
      int width = Integer.parseInt(element.getAttributeValue(WIDTH_ATTR));
      int height = Integer.parseInt(element.getAttributeValue(HEIGHT_ATTR));
      myFloatingBounds = new Rectangle(x, y, width, height);
    } catch (NumberFormatException ignored) {
    }
    mySplitMode = Boolean.parseBoolean(element.getAttributeValue(SIDE_TOOL_ATTR));

    myContentUiType =
        ToolWindowContentUiType.getInstance(element.getAttributeValue(CONTENT_UI_ATTR));
  }
 /** Copies all data from the passed <code>WindowInfo</code> into itself. */
 void copyFrom(final WindowInfoImpl info) {
   myActive = info.myActive;
   myAnchor = info.myAnchor;
   myAutoHide = info.myAutoHide;
   myFloatingBounds =
       info.myFloatingBounds == null ? null : (Rectangle) info.myFloatingBounds.clone();
   myId = info.myId;
   setTypeAndCheck(info.myType);
   myInternalType = info.myInternalType;
   myVisible = info.myVisible;
   myWeight = info.myWeight;
   mySideWeight = info.mySideWeight;
   myOrder = info.myOrder;
   mySplitMode = info.mySplitMode;
   myContentUiType = info.myContentUiType;
 }
 void setType(@NotNull final ToolWindowType type) {
   if (ToolWindowType.DOCKED == type || ToolWindowType.SLIDING == type) {
     myInternalType = type;
   }
   setTypeAndCheck(type);
 }