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(); } }
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(); } }
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); } } } } }
@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); } }
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); } } } }
@Override protected void doUpdateDetailView(DetailView panel, boolean editorOnly) { }
public void setDetailView(DetailView detailView) { myMasterBreakpointPanel.setDetailView(detailView); }
public void setDetailView(DetailView detailView) { if (myMasterBreakpointChooser != null) { myMasterBreakpointChooser.setDetailView(detailView); } }
@Override protected void doUpdateDetailView(DetailView panel, boolean editorOnly) { panel.navigateInPreviewEditor(DetailView.PreviewEditorState.create(myBookmark.getFile(), myBookmark.getLine())); }
public void setDetailView(DetailView detailView) { myMasterBreakpointChooser.setDetailView(detailView); }