예제 #1
0
 protected void loadComponentState() {
   final String key = getComponentStateKey();
   final MasterDetailsStateService stateService = getStateService();
   if (key != null && stateService != null) {
     final MasterDetailsState state = stateService.getComponentState(key, myState.getClass());
     if (state != null) {
       loadState(state);
     }
   }
 }
예제 #2
0
 public void disposeUIResources() {
   myState.getProportions().saveSplitterProportions(myWholePanel);
   myAutoScrollHandler.cancelAllRequests();
   myDetails.disposeUIResources();
   myInitializedConfigurables.clear();
   clearChildren();
   final String key = getComponentStateKey();
   final MasterDetailsStateService stateService = getStateService();
   if (key != null && stateService != null) {
     stateService.setComponentState(key, getState());
   }
   myCurrentConfigurable = null;
 }
예제 #3
0
  public void reset() {
    loadComponentState();
    myHasDeletedItems = false;
    ((DefaultTreeModel) myTree.getModel()).reload();
    // myTree.requestFocus();
    myState.getProportions().restoreSplitterProportions(myWholePanel);

    final Enumeration enumeration = myRoot.breadthFirstEnumeration();
    boolean selected = false;
    while (enumeration.hasMoreElements()) {
      final MyNode node = (MyNode) enumeration.nextElement();
      if (node instanceof MyRootNode) continue;
      final String path = getNodePathString(node);
      if (!selected && Comparing.strEqual(path, myState.getLastEditedConfigurable())) {
        TreeUtil.selectInTree(node, false, myTree);
        selected = true;
      }
    }
    if (!selected) {
      TreeUtil.selectFirstNode(myTree);
    }
    updateSelectionFromTree();
  }
예제 #4
0
 protected void setSelectedNode(@Nullable MyNode node) {
   if (node != null) {
     myState.setLastEditedConfigurable(getNodePathString(node));
   }
   updateSelection(node != null ? node.getConfigurable() : null);
 }