public void reset() {
    final TextWithImports emptyExpressionFragment =
        new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, "");
    ((CardLayout) myMainPanel.getLayout())
        .show(myMainPanel, myRenderer == null ? EMPTY_PANEL_ID : DATA_PANEL_ID);
    if (myRenderer == null) {
      return;
    }
    final String className = myRenderer.getClassName();
    myClassNameField.setText(className);
    final ValueLabelRenderer labelRenderer = myRenderer.getLabelRenderer();
    final ChildrenRenderer childrenRenderer = myRenderer.getChildrenRenderer();
    final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();

    if (rendererSettings.isBase(labelRenderer)) {
      myRbDefaultLabel.setSelected(true);
      myLabelEditor.setText(emptyExpressionFragment);
    } else {
      myRbExpressionLabel.setSelected(true);
      myLabelEditor.setText(((LabelRenderer) labelRenderer).getLabelExpression());
    }

    if (rendererSettings.isBase(childrenRenderer)) {
      myRbDefaultChildrenRenderer.setSelected(true);
      myChildrenEditor.setText(emptyExpressionFragment);
      myChildrenExpandedEditor.setText(emptyExpressionFragment);
      getTableModel().clear();
    } else if (childrenRenderer instanceof ExpressionChildrenRenderer) {
      myRbExpressionChildrenRenderer.setSelected(true);
      final ExpressionChildrenRenderer exprRenderer = (ExpressionChildrenRenderer) childrenRenderer;
      myChildrenEditor.setText(exprRenderer.getChildrenExpression());
      myChildrenExpandedEditor.setText(exprRenderer.getChildrenExpandable());
      getTableModel().clear();
    } else {
      myRbListChildrenRenderer.setSelected(true);
      myChildrenEditor.setText(emptyExpressionFragment);
      myChildrenExpandedEditor.setText(emptyExpressionFragment);
      if (childrenRenderer instanceof EnumerationChildrenRenderer) {
        getTableModel().init(((EnumerationChildrenRenderer) childrenRenderer).getChildren());
      } else {
        getTableModel().clear();
      }
    }

    updateEnabledState();
    updateContext(className);
  }
 public boolean isModified() {
   if (myRenderer == null) {
     return false;
   }
   final CompoundReferenceRenderer cloned = (CompoundReferenceRenderer) myRenderer.clone();
   flushDataTo(cloned);
   return !DebuggerUtilsEx.externalizableEqual(cloned, myOriginalRenderer);
 }
 public void apply() throws ConfigurationException {
   if (myRenderer == null) {
     return;
   }
   flushDataTo(myRenderer);
   // update the renderer to compare with in order to find out whether we've been modified since
   // last apply
   myOriginalRenderer = (CompoundReferenceRenderer) myRenderer.clone();
 }
 private void flushDataTo(final CompoundReferenceRenderer renderer) { // label
   LabelRenderer labelRenderer = null;
   if (myRbExpressionLabel.isSelected()) {
     labelRenderer = new LabelRenderer();
     labelRenderer.setLabelExpression(myLabelEditor.getText());
   }
   renderer.setLabelRenderer(labelRenderer);
   // children
   ChildrenRenderer childrenRenderer = null;
   if (myRbExpressionChildrenRenderer.isSelected()) {
     childrenRenderer = new ExpressionChildrenRenderer();
     ((ExpressionChildrenRenderer) childrenRenderer)
         .setChildrenExpression(myChildrenEditor.getText());
     ((ExpressionChildrenRenderer) childrenRenderer)
         .setChildrenExpandable(myChildrenExpandedEditor.getText());
   } else if (myRbListChildrenRenderer.isSelected()) {
     childrenRenderer = new EnumerationChildrenRenderer(getTableModel().getExpressions());
   }
   renderer.setChildrenRenderer(childrenRenderer);
   // classname
   renderer.setClassName(myClassNameField.getText());
 }