Skip to content

Commit

Permalink
解决高版本工具类丢失的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 7, 2020
1 parent 261ac9b commit d01e321
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/cn/olange/model/RuleTableCellRender.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.google.gson.JsonObject;
import com.intellij.ui.ColoredTableCellRenderer;
import com.intellij.ui.SimpleTextAttributes;
import groovy.json.StringEscapeUtils;

import javax.swing.*;

Expand All @@ -13,7 +12,7 @@ public class RuleTableCellRender extends ColoredTableCellRenderer {
protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
if (value instanceof JsonObject) {
JsonObject ruleObj = (JsonObject) value;
this.append(" " + StringEscapeUtils.escapeJava(ruleObj.get("rule").getAsString()), SimpleTextAttributes.SYNTHETIC_ATTRIBUTES);
this.append(" " + ruleObj.get("rule").getAsString(), SimpleTextAttributes.SYNTHETIC_ATTRIBUTES);
}

setBorder(null);
Expand Down
3 changes: 1 addition & 2 deletions src/cn/olange/ui/AnyRulePopupPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import com.intellij.ui.table.JBTable;
import com.intellij.util.Alarm;
import com.intellij.util.ui.*;
import groovy.json.StringEscapeUtils;
import net.miginfocom.swing.MigLayout;
import org.jdesktop.swingx.JXTextArea;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -431,7 +430,7 @@ public void insertRuleToDocument() {
WriteCommandAction.Builder builder = WriteCommandAction.writeCommandAction(AnyRulePopupPanel.this.project);
builder.run(() -> {
String rule = value.get("rule").getAsString();
editor.getDocument().insertString(offset, StringEscapeUtils.escapeJava(convertRule(rule)));
editor.getDocument().insertString(offset, convertRule(rule));
});
});
}
Expand Down
3 changes: 1 addition & 2 deletions src/cn/olange/ui/RulePreviewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.intellij.ui.components.JBScrollPane;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.JBUI;
import groovy.json.StringEscapeUtils;
import org.jdesktop.swingx.JXTextArea;

import java.awt.*;
Expand Down Expand Up @@ -46,7 +45,7 @@ public void updateLayoutLater(JsonObject row) {
String examples = row.get("examples").getAsString();
this.setBorder(IdeBorderFactory.createTitledBorder(title, false, new JBInsets(8, 0, 0, 0)).setShowLine(false));
this.setToolTipText(title);
this.textArea.setText(StringEscapeUtils.escapeJava(rule));
this.textArea.setText(rule);
this.examples.setText(examples);
}

Expand Down

0 comments on commit d01e321

Please sign in to comment.