mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
breakpoints-ui. breakpoints tree nodes sorting.
This commit is contained in:
@@ -19,6 +19,7 @@ import com.intellij.debugger.ui.breakpoints.Breakpoint;
|
||||
import com.intellij.debugger.ui.breakpoints.BreakpointFactory;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.xdebugger.breakpoints.ui.XBreakpointGroup;
|
||||
import com.intellij.xdebugger.breakpoints.ui.XBreakpointTypeGroup;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -56,4 +57,25 @@ public class XBreakpointCategoryGroup extends XBreakpointGroup {
|
||||
public String getName() {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(XBreakpointGroup o) {
|
||||
if (o instanceof XBreakpointTypeGroup) {
|
||||
return -1;
|
||||
}
|
||||
if (o instanceof XBreakpointCategoryGroup) {
|
||||
return getFactoryIndex() - ((XBreakpointCategoryGroup)o).getFactoryIndex();
|
||||
}
|
||||
return super.compareTo(o);
|
||||
}
|
||||
|
||||
private int getFactoryIndex() {
|
||||
BreakpointFactory[] breakpointFactories = BreakpointFactory.getBreakpointFactories();
|
||||
for (int i = 0; i < breakpointFactories.length; ++i) {
|
||||
if (breakpointFactories[i].getBreakpointCategory().equals(myCategory)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -389,6 +389,11 @@ public abstract class BreakpointPropertiesPanel {
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultBreakpoint() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupGenericRenderer(SimpleColoredComponent renderer, boolean plainView) {
|
||||
renderer.clear();
|
||||
@@ -434,6 +439,11 @@ public abstract class BreakpointPropertiesPanel {
|
||||
public void removed(Project project) {
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(BreakpointItem breakpointItem) {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
return items;
|
||||
}
|
||||
|
||||
@@ -133,4 +133,14 @@ class JavaBreakpointItem extends BreakpointItem {
|
||||
public void setEnabled(boolean state) {
|
||||
myBreakpoint.ENABLED = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultBreakpoint() {
|
||||
return myBreakpoint.getCategory().equals(AnyExceptionBreakpoint.CATEGORY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(BreakpointItem breakpointItem) {
|
||||
return getDisplayText().compareTo(breakpointItem.getDisplayText());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user