コード例 #1
0
    private void checkState() {
      if (!onChange) {
        try {
          onChange = true;

          DockStation parent = dockable.getDockParent();
          boolean select = false;

          if (parent != null) {
            select = parent.isChildShowing(dockable) && parent.getFrontDockable() == dockable;
          }

          setSelected(select);
        } finally {
          onChange = false;
        }
      }
    }
コード例 #2
0
    private void checkDockable() {
      if (!onChange) {
        try {
          onChange = true;

          if (isSelected()) {
            DockController controller = dockable.getController();
            if (controller != null) {
              controller.setFocusedDockable(dockable, null, true, true, true);
            }
          } else {
            DockStation parent = this.parent;
            Dockable dockable = this.dockable;

            DockStation finalParent = StationChildrenActionSource.this.dockable.getDockParent();

            while (parent != null) {
              if (parent.getFrontDockable() == dockable) {
                parent.setFrontDockable(null);
              }
              if (parent == finalParent) {
                parent = null;
              } else {
                dockable = parent.asDockable();
                if (dockable != null) {
                  parent = dockable.getDockParent();
                } else {
                  parent = null;
                }
              }
            }
          }
        } finally {
          onChange = false;
        }
      }
    }