Browse Source

无jira任务,sonar问题修复

research/11.0
Bruce.Deng 5 years ago
parent
commit
f48ab9ba6d
  1. 5
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/WrappedSyntaxView.java
  2. 5
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/parser/TaskTagParser.java
  3. 8
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/LineNumberList.java
  4. 3
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextArea.java

5
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/WrappedSyntaxView.java

@ -1351,6 +1351,11 @@ System.err.println(">>> >>> calculated number of lines for this view (line " + l
// Start at alloc.x since this chunk starts // Start at alloc.x since this chunk starts
// at the beginning of a physical line. // at the beginning of a physical line.
if (tlist == null) {
p0 = (p == p0) ? p1 : p;
alloc.y += alloc.height;
continue;
}
int n = tlist.getListOffset(textArea, int n = tlist.getListOffset(textArea,
WrappedSyntaxView.this, WrappedSyntaxView.this,
alloc.x, x); alloc.x, x);

5
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/parser/TaskTagParser.java

@ -18,6 +18,7 @@ import com.fr.design.gui.syntax.ui.rsyntaxtextarea.ErrorStrip;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxDocument; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxDocument;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.Token; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.Token;
import com.fr.stable.StringUtils;
/** /**
@ -60,6 +61,7 @@ public class TaskTagParser extends AbstractParser {
} }
@SuppressWarnings("squid:S2259")
public ParseResult parse(RSyntaxDocument doc, String style) { public ParseResult parse(RSyntaxDocument doc, String style) {
Element root = doc.getDefaultRootElement(); Element root = doc.getDefaultRootElement();
@ -101,6 +103,9 @@ public class TaskTagParser extends AbstractParser {
} }
if (start>-1) { if (start>-1) {
if (StringUtils.isEmpty(text)) {
continue;
}
text = text.substring(start); text = text.substring(start);
// TODO: Strip off end of MLC's if they're there. // TODO: Strip off end of MLC's if they're there.
int len = text.length(); int len = text.length();

8
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/LineNumberList.java

@ -349,6 +349,10 @@ public class LineNumberList extends AbstractGutterComponent
int width = metrics.stringWidth(number); int width = metrics.stringWidth(number);
g.drawString(number, rhs-width,y); g.drawString(number, rhs-width,y);
y += cellHeight; y += cellHeight;
if (fm == null) {
line++;
continue;
}
Fold fold = fm.getFoldForLine(line-1); Fold fold = fm.getFoldForLine(line-1);
// Skip to next line to paint, taking extra care for lines with // Skip to next line to paint, taking extra care for lines with
// block ends and begins together, e.g. "} else {" // block ends and begins together, e.g. "} else {"
@ -371,6 +375,10 @@ public class LineNumberList extends AbstractGutterComponent
String number = Integer.toString(line + getLineNumberingStartIndex() - 1); String number = Integer.toString(line + getLineNumberingStartIndex() - 1);
g.drawString(number, RHS_BORDER_WIDTH, y); g.drawString(number, RHS_BORDER_WIDTH, y);
y += cellHeight; y += cellHeight;
if (fm == null) {
line++;
continue;
}
Fold fold = fm.getFoldForLine(line-1); Fold fold = fm.getFoldForLine(line-1);
// Skip to next line to paint, taking extra care for lines with // Skip to next line to paint, taking extra care for lines with
// block ends and begins together, e.g. "} else {" // block ends and begins together, e.g. "} else {"

3
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextArea.java

@ -635,6 +635,9 @@ public class RTextArea extends RTextAreaBase implements Printable {
parent = parent.getParent(); parent = parent.getParent();
} }
KeyStroke backspace = KeyStroke.getKeyStroke("BACK_SPACE"); KeyStroke backspace = KeyStroke.getKeyStroke("BACK_SPACE");
if (inputMap == null) {
return;
}
inputMap.put(backspace, DefaultEditorKit.deletePrevCharAction); inputMap.put(backspace, DefaultEditorKit.deletePrevCharAction);
} }

Loading…
Cancel
Save