コード例 #1
0
  protected void showErrorPage(final ErrorInfo info) {
    storeState();
    hideProgress();
    myRootComponent = null;

    myErrorMessages.removeAll();

    if (info.myShowStack) {
      info.myMessages.add(
          0, new FixableMessageInfo(true, info.myDisplayMessage, "", "", null, null));

      ByteArrayOutputStream stream = new ByteArrayOutputStream();
      info.myThrowable.printStackTrace(new PrintStream(stream));
      myErrorStack.setText(stream.toString());
      myErrorStackLayout.show(myErrorStackPanel, ERROR_STACK_CARD);
    } else {
      myErrorStack.setText(null);
      myErrorStackLayout.show(myErrorStackPanel, ERROR_NO_STACK_CARD);
    }

    for (FixableMessageInfo message : info.myMessages) {
      addErrorMessage(
          message, message.myErrorIcon ? Messages.getErrorIcon() : Messages.getWarningIcon());
    }

    myErrorPanel.revalidate();
    myLayout.show(this, ERROR_CARD);

    DesignerToolWindowManager.getInstance(getProject()).refresh(true);
    repaint();
  }
コード例 #2
0
  protected void restoreState() {
    DesignerToolWindowManager toolManager = DesignerToolWindowManager.getInstance(getProject());

    if (myExpandedState != null) {
      List<RadComponent> expanded = new ArrayList<RadComponent>();
      for (int[] path : myExpandedState) {
        pathToComponent(expanded, myRootComponent, path, 0);
      }
      myExpandedComponents = expanded;
      toolManager.expandFromState();
      myExpandedState = null;
    }

    List<RadComponent> selection = new ArrayList<RadComponent>();

    int[][] selectionState = mySourceSelectionState.get(getEditorText());
    if (selectionState != null) {
      for (int[] path : selectionState) {
        pathToComponent(selection, myRootComponent, path, 0);
      }
    }

    if (selection.isEmpty()) {
      if (mySelectionState != null) {
        for (int[] path : mySelectionState) {
          pathToComponent(selection, myRootComponent, path, 0);
        }
      }
    }

    if (selection.isEmpty()) {
      toolManager.refresh(true);
    } else {
      mySurfaceArea.setSelection(selection);
    }

    mySelectionState = null;
  }
コード例 #3
0
 public EditableArea getActionsArea() {
   TreeEditableArea treeArea = DesignerToolWindowManager.getInstance(getProject()).getTreeArea();
   return treeArea == null ? mySurfaceArea : treeArea;
 }