use of com.intellij.xdebugger.impl.breakpoints.ui.XLightBreakpointPropertiesPanel in project intellij-community by JetBrains.
the class XBreakpointItem method doUpdateDetailView.
@Override
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(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();
}
}
use of com.intellij.xdebugger.impl.breakpoints.ui.XLightBreakpointPropertiesPanel in project intellij-community by JetBrains.
the class DebuggerUIUtil method showXBreakpointEditorBalloon.
public static void showXBreakpointEditorBalloon(final Project project, @Nullable final Point point, final JComponent component, final boolean showAllOptions, final XBreakpoint breakpoint) {
final XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
final XLightBreakpointPropertiesPanel propertiesPanel = new XLightBreakpointPropertiesPanel(project, breakpointManager, (XBreakpointBase) breakpoint, showAllOptions);
final Ref<Balloon> balloonRef = Ref.create(null);
final Ref<Boolean> isLoading = Ref.create(Boolean.FALSE);
final Ref<Boolean> moreOptionsRequested = Ref.create(Boolean.FALSE);
propertiesPanel.setDelegate(() -> {
if (!isLoading.get()) {
propertiesPanel.saveProperties();
}
if (!balloonRef.isNull()) {
balloonRef.get().hide();
}
showXBreakpointEditorBalloon(project, point, component, true, breakpoint);
moreOptionsRequested.set(true);
});
isLoading.set(Boolean.TRUE);
propertiesPanel.loadProperties();
isLoading.set(Boolean.FALSE);
if (moreOptionsRequested.get()) {
return;
}
Runnable showMoreOptions = () -> {
propertiesPanel.saveProperties();
propertiesPanel.dispose();
BreakpointsDialogFactory.getInstance(project).showDialog(breakpoint);
};
final JComponent mainPanel = propertiesPanel.getMainPanel();
final Balloon balloon = showBreakpointEditor(project, mainPanel, point, component, showMoreOptions, breakpoint);
balloonRef.set(balloon);
final XBreakpointListener<XBreakpoint<?>> breakpointListener = new XBreakpointAdapter<XBreakpoint<?>>() {
@Override
public void breakpointRemoved(@NotNull XBreakpoint<?> removedBreakpoint) {
if (removedBreakpoint.equals(breakpoint)) {
balloon.hide();
}
}
};
balloon.addListener(new JBPopupListener.Adapter() {
@Override
public void onClosed(LightweightWindowEvent event) {
propertiesPanel.saveProperties();
propertiesPanel.dispose();
breakpointManager.removeBreakpointListener(breakpointListener);
}
});
breakpointManager.addBreakpointListener(breakpointListener);
ApplicationManager.getApplication().invokeLater(() -> IdeFocusManager.findInstance().requestFocus(mainPanel, true));
}
Aggregations