IDEA-59487

This commit is contained in:
Alexey Kudravtsev
2010-10-08 10:13:26 +04:00
parent 64ad1fa52f
commit f43854de7a
3 changed files with 17 additions and 7 deletions
@@ -589,7 +589,7 @@ public class BreakpointManager implements JDOMExternalizable {
}
}
catch (InvalidDataException e) {
catch (InvalidDataException ignored) {
}
final Element rulesGroup = parentNode.getChild(RULES_GROUP_NAME);
@@ -827,7 +827,7 @@ public class BreakpointManager implements JDOMExternalizable {
//interaction with RequestManagerImpl
public void disableBreakpoints(final DebugProcessImpl debugProcess) {
final List<Breakpoint> breakpoints = getBreakpoints();
if (breakpoints.size() > 0) {
if (!breakpoints.isEmpty()) {
final RequestManagerImpl requestManager = debugProcess.getRequestsManager();
for (Breakpoint breakpoint : breakpoints) {
breakpoint.markVerified(requestManager.isVerified(breakpoint));
@@ -843,7 +843,7 @@ public class BreakpointManager implements JDOMExternalizable {
public void enableBreakpoints(final DebugProcessImpl debugProcess) {
final List<Breakpoint> breakpoints = getBreakpoints();
if (breakpoints.size() > 0) {
if (!breakpoints.isEmpty()) {
for (Breakpoint breakpoint : breakpoints) {
breakpoint.markVerified(false); // clean cached state
breakpoint.createRequest(debugProcess);
@@ -415,7 +415,8 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
}
private void setupGutterRenderer() {
getHighlighter().setGutterIconRenderer(new MyGutterIconRenderer());
MyGutterIconRenderer renderer = new MyGutterIconRenderer(getIcon(), getDescription());
getHighlighter().setGutterIconRenderer(renderer);
}
public abstract Key<? extends BreakpointWithHighlighter> getCategory();
@@ -623,13 +624,21 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
}
private class MyGutterIconRenderer extends GutterIconRenderer {
private final Icon myIcon;
private final String myDescription;
public MyGutterIconRenderer(Icon icon, String description) {
myIcon = icon;
myDescription = description;
}
@NotNull
public Icon getIcon() {
return BreakpointWithHighlighter.this.getIcon();
return myIcon;
}
public String getTooltipText() {
return getDescription();
return myDescription;
}
public AnAction getClickAction() {
@@ -539,7 +539,8 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
private void paintIconRow(int line, ArrayList<GutterIconRenderer> row, final Graphics g) {
processIconsRow(line, row, new LineGutterIconRendererProcessor() {
public void process(int x, int y, GutterIconRenderer renderer) {
renderer.getIcon().paintIcon(EditorGutterComponentImpl.this, g, x, y);
Icon icon = renderer.getIcon();
icon.paintIcon(EditorGutterComponentImpl.this, g, x, y);
}
});
}