Java 类com.intellij.ui.popup.util.DetailView 实例源码

项目:tools-idea    文件:XBreakpointItem.java   
public void doUpdateDetailView(DetailView panel, boolean editorOnly) {
  Project project = ((XBreakpointBase)myBreakpoint).getProject();
  XLightBreakpointPropertiesPanel<XBreakpoint<?>> propertiesPanel = null;
  if (!editorOnly) {
    propertiesPanel = new XLightBreakpointPropertiesPanel<XBreakpoint<?>>(project, getManager(), myBreakpoint, true);

    panel.setPropertiesPanel(propertiesPanel.getMainPanel());
  }

  XSourcePosition sourcePosition = myBreakpoint.getSourcePosition();
  if (sourcePosition != null) {
    showInEditor(panel, sourcePosition.getFile(), sourcePosition.getLine());
  }
  else {
    panel.clearEditor();
  }

  if (propertiesPanel != null) {
    propertiesPanel.setDetailView(panel);
    propertiesPanel.loadProperties();
    propertiesPanel.getMainPanel().revalidate();

  }

}
项目:intellij-ce-playground    文件:XBreakpointItem.java   
public void doUpdateDetailView(DetailView panel, boolean editorOnly) {
  XBreakpointBase breakpoint = (XBreakpointBase)myBreakpoint;
  Project project = breakpoint.getProject();
  //saveState();
  if (myPropertiesPanel != null) {
    myPropertiesPanel.dispose();
    myPropertiesPanel = null;
  }
  if (!editorOnly) {
    myPropertiesPanel = new XLightBreakpointPropertiesPanel<XBreakpointBase<?,?,?>>(project, getManager(), breakpoint, true);

    panel.setPropertiesPanel(myPropertiesPanel.getMainPanel());
  }

  XSourcePosition sourcePosition = myBreakpoint.getSourcePosition();
  if (sourcePosition != null && sourcePosition.getFile().isValid()) {
    showInEditor(panel, sourcePosition.getFile(), sourcePosition.getLine());
  }
  else {
    panel.clearEditor();
  }

  if (myPropertiesPanel != null) {
    myPropertiesPanel.setDetailView(panel);
    myPropertiesPanel.loadProperties();
    myPropertiesPanel.getMainPanel().revalidate();

  }

}
项目:intellij-ce-playground    文件:BreakpointItem.java   
protected static void showInEditor(DetailView panel, VirtualFile virtualFile, int line) {
  TextAttributes attributes =
    EditorColorsManager.getInstance().getGlobalScheme().getAttributes(DebuggerColors.BREAKPOINT_ATTRIBUTES);

  DetailView.PreviewEditorState state = DetailView.PreviewEditorState.create(virtualFile, line, attributes);

  if (state.equals(panel.getEditorState())) {
    return;
  }

  panel.navigateInPreviewEditor(state);

  TextAttributes softerAttributes = attributes.clone();
  Color backgroundColor = softerAttributes.getBackgroundColor();
  if (backgroundColor != null) {
    softerAttributes.setBackgroundColor(ColorUtil.softer(backgroundColor));
  }

  final Editor editor = panel.getEditor();
  if (editor != null) {
    final MarkupModel editorModel = editor.getMarkupModel();
    final MarkupModel documentModel =
      DocumentMarkupModel.forDocument(editor.getDocument(), editor.getProject(), false);

    for (RangeHighlighter highlighter : documentModel.getAllHighlighters()) {
      if (highlighter.getUserData(DebuggerColors.BREAKPOINT_HIGHLIGHTER_KEY) == Boolean.TRUE) {
        final int line1 = editor.offsetToLogicalPosition(highlighter.getStartOffset()).line;
        if (line1 != line) {
          editorModel.addLineHighlighter(line1,
                                         DebuggerColors.BREAKPOINT_HIGHLIGHTER_LAYER + 1, softerAttributes);
        }
      }
    }
  }
}
项目:tools-idea    文件:JavaBreakpointItem.java   
@Override
protected void doUpdateDetailView(DetailView panel, boolean editorOnly) {
  BreakpointPropertiesPanel breakpointPropertiesPanel = null;
  if (!editorOnly) {
    breakpointPropertiesPanel = myBreakpointFactory != null ? myBreakpointFactory
      .createBreakpointPropertiesPanel(myBreakpoint.getProject(), false) : null;

    if (breakpointPropertiesPanel != null) {
      breakpointPropertiesPanel.initFrom(myBreakpoint, true);

      breakpointPropertiesPanel.setSaveOnRemove(true);

      final JPanel mainPanel = breakpointPropertiesPanel.getPanel();
      panel.setPropertiesPanel(mainPanel);
    }
    else {
      panel.setPropertiesPanel(null);
    }
  }

  if (myBreakpoint instanceof BreakpointWithHighlighter) {
    SourcePosition sourcePosition = ((BreakpointWithHighlighter)myBreakpoint).getSourcePosition();
    VirtualFile virtualFile = sourcePosition.getFile().getVirtualFile();
    showInEditor(panel, virtualFile, sourcePosition.getLine());
  } else {
    panel.clearEditor();
  }
  if (breakpointPropertiesPanel != null) {
    breakpointPropertiesPanel.setDetailView(panel);
  }
}
项目:tools-idea    文件:BreakpointItem.java   
protected static void showInEditor(DetailView panel, VirtualFile virtualFile, int line) {
  TextAttributes attributes =
    EditorColorsManager.getInstance().getGlobalScheme().getAttributes(DebuggerColors.BREAKPOINT_ATTRIBUTES);

  DetailView.PreviewEditorState state = DetailView.PreviewEditorState.create(virtualFile, line, attributes);

  if (state.equals(panel.getEditorState())) {
    return;
  }

  panel.navigateInPreviewEditor(state);

  TextAttributes softerAttributes = attributes.clone();
  Color backgroundColor = softerAttributes.getBackgroundColor();
  if (backgroundColor != null) {
    softerAttributes.setBackgroundColor(ColorUtil.softer(backgroundColor));
  }

  final Editor editor = panel.getEditor();
  final MarkupModel editorModel = editor.getMarkupModel();
  final MarkupModel documentModel =
    DocumentMarkupModel.forDocument(editor.getDocument(), editor.getProject(), false);

  for (RangeHighlighter highlighter : documentModel.getAllHighlighters()) {
    if (highlighter.getUserData(DebuggerColors.BREAKPOINT_HIGHLIGHTER_KEY) == Boolean.TRUE) {
      final int line1 = editor.offsetToLogicalPosition(highlighter.getStartOffset()).line;
      if (line1 != line) {
        editorModel.addLineHighlighter(line1,
                                       DebuggerColors.BREAKPOINT_HIGHLIGHTER_LAYER + 1, softerAttributes);
      }
    }
  }
}
项目:consulo    文件:BreakpointItem.java   
protected static void showInEditor(DetailView panel, VirtualFile virtualFile, int line) {
  TextAttributes attributes =
          EditorColorsManager.getInstance().getGlobalScheme().getAttributes(DebuggerColors.BREAKPOINT_ATTRIBUTES);

  DetailView.PreviewEditorState state = DetailView.PreviewEditorState.create(virtualFile, line, attributes);

  if (state.equals(panel.getEditorState())) {
    return;
  }

  panel.navigateInPreviewEditor(state);

  TextAttributes softerAttributes = attributes.clone();
  Color backgroundColor = softerAttributes.getBackgroundColor();
  if (backgroundColor != null) {
    softerAttributes.setBackgroundColor(ColorUtil.softer(backgroundColor));
  }

  final Editor editor = panel.getEditor();
  final MarkupModel editorModel = editor.getMarkupModel();
  final MarkupModel documentModel =
          DocumentMarkupModel.forDocument(editor.getDocument(), editor.getProject(), false);

  for (RangeHighlighter highlighter : documentModel.getAllHighlighters()) {
    if (highlighter.getUserData(DebuggerColors.BREAKPOINT_HIGHLIGHTER_KEY) == Boolean.TRUE) {
      final int line1 = editor.offsetToLogicalPosition(highlighter.getStartOffset()).line;
      if (line1 != line) {
        editorModel.addLineHighlighter(line1,
                                       DebuggerColors.BREAKPOINT_HIGHLIGHTER_LAYER + 1, softerAttributes);
      }
    }
  }
}
项目:intellij-ce-playground    文件:BreakpointNoneItem.java   
@Override
protected void doUpdateDetailView(DetailView panel, boolean editorOnly) {
}
项目:intellij-ce-playground    文件:XLightBreakpointPropertiesPanel.java   
public void setDetailView(DetailView detailView) {
  myMasterBreakpointPanel.setDetailView(detailView);
}
项目:intellij-ce-playground    文件:XMasterBreakpointPanel.java   
public void setDetailView(DetailView detailView) {
  if (myMasterBreakpointChooser != null) {
    myMasterBreakpointChooser.setDetailView(detailView);
  }
}
项目:intellij-ce-playground    文件:BookmarkItem.java   
@Override
protected void doUpdateDetailView(DetailView panel, boolean editorOnly) {
  panel.navigateInPreviewEditor(DetailView.PreviewEditorState.create(myBookmark.getFile(), myBookmark.getLine()));
}
项目:tools-idea    文件:BreakpointPropertiesPanel.java   
public void setDetailView(DetailView detailView) {
  myMasterBreakpointChooser.setDetailView(detailView);
}
项目:tools-idea    文件:BreakpointNoneItem.java   
@Override
protected void doUpdateDetailView(DetailView panel, boolean editorOnly) {
}
项目:tools-idea    文件:XLightBreakpointPropertiesPanel.java   
public void setDetailView(DetailView detailView) {
  myMasterBreakpointPanel.setDetailView(detailView);
}
项目:tools-idea    文件:XMasterBreakpointPanel.java   
public void setDetailView(DetailView detailView) {
  myMasterBreakpointChooser.setDetailView(detailView);
}
项目:tools-idea    文件:BookmarkItem.java   
@Override
protected void doUpdateDetailView(DetailView panel, boolean editorOnly) {
  panel.navigateInPreviewEditor(DetailView.PreviewEditorState.create(myBookmark.getFile(), myBookmark.getLine()));
}
项目:consulo    文件:BreakpointNoneItem.java   
@Override
protected void doUpdateDetailView(DetailView panel, boolean editorOnly) {
}
项目:consulo    文件:XLightBreakpointPropertiesPanel.java   
public void setDetailView(DetailView detailView) {
  myMasterBreakpointPanel.setDetailView(detailView);
}
项目:consulo    文件:XMasterBreakpointPanel.java   
public void setDetailView(DetailView detailView) {
  if (myMasterBreakpointChooser != null) {
    myMasterBreakpointChooser.setDetailView(detailView);
  }
}
项目:consulo    文件:BookmarkItem.java   
@Override
protected void doUpdateDetailView(DetailView panel, boolean editorOnly) {
  panel.navigateInPreviewEditor(DetailView.PreviewEditorState.create(myBookmark.getFile(), myBookmark.getLine()));
}