Browse Source

Pull request #12386: REPORT-99850 公式面板 在参数后按任意字母都会变成$符号 & REPORT-97036 数据集名称太长的显示优化 & REPORT-97298 【FR国际化】显示不全

Merge in DESIGN/design from ~OBO/design1:bugfix/11.0 to bugfix/11.0

* commit 'd649b8abf06fa9905aa9c2474451bbde8d1e0ad7':
  REPORT-97298 【FR国际化】显示不全,优化下变量名和注释
  REPORT-97298 【FR国际化】显示不全
  REPORT-97298 【FR国际化】显示不全
  REPORT-97036 设计器关联数据集,数据集名称太长的显示优化
  REPORT-97036 回退一下
  REPORT-97036 设计器关联数据集,数据集名称太长的显示优化
  REPORT-99850 公式面板 在参数后按任意字母都会变成$符号
  REPORT-99850 公式面板 在参数后按任意字母都会变成$符号
bugfix/11.0
Obo-王学仁 1 year ago
parent
commit
36643c5f12
  1. 1
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java
  2. 8
      designer-base/src/main/java/com/fr/design/gui/autocomplete/AbstractCompletionProvider.java
  3. 19
      designer-base/src/main/java/com/fr/design/gui/autocomplete/FormulaPaneAutoCompletion.java
  4. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java
  5. 9
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java

1
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java

@ -294,6 +294,7 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
tmp = tmp + "..."; tmp = tmp + "...";
tabledataName = new UILabel(tmp); tabledataName = new UILabel(tmp);
} }
tabledataName.setToolTipText(name);
UILabel iconLabel = new UILabel(icon); UILabel iconLabel = new UILabel(icon);
chekbox.addActionListener(tableDataCheckboxListener); chekbox.addActionListener(tableDataCheckboxListener);
iconLabel.addMouseListener(chooseTableDataListener); iconLabel.addMouseListener(chooseTableDataListener);

8
designer-base/src/main/java/com/fr/design/gui/autocomplete/AbstractCompletionProvider.java

@ -8,12 +8,14 @@
*/ */
package com.fr.design.gui.autocomplete; package com.fr.design.gui.autocomplete;
import com.fr.stable.StringUtils;
import javax.swing.text.JTextComponent;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import javax.swing.text.JTextComponent;
/** /**
@ -186,7 +188,9 @@ public abstract class AbstractCompletionProvider
while (index<completions.size()) { while (index<completions.size()) {
Completion c = completions.get(index); Completion c = completions.get(index);
if (Util.startsWithIgnoreCase(c.getInputText(), text)) { String inputText = c.getInputText();
//当输入文本和补全项相等时,不再添加到补全项到窗口中
if (Util.startsWithIgnoreCase(inputText, text) && !StringUtils.equals(inputText, text)) {
retVal.add(c); retVal.add(c);
index++; index++;
} }

19
designer-base/src/main/java/com/fr/design/gui/autocomplete/FormulaPaneAutoCompletion.java

@ -1,12 +1,10 @@
package com.fr.design.gui.autocomplete; package com.fr.design.gui.autocomplete;
import com.fr.design.formula.FormulaPane; import com.fr.design.formula.FormulaPane;
import com.fr.stable.StringUtils;
import javax.swing.KeyStroke;
import javax.swing.ListCellRenderer;
import javax.swing.text.Caret; import javax.swing.text.Caret;
import javax.swing.text.JTextComponent; import javax.swing.text.JTextComponent;
import java.awt.Window;
/** /**
* @author Hoky * @author Hoky
@ -70,9 +68,18 @@ public class FormulaPaneAutoCompletion extends AutoCompletionWithExtraRefresh {
caret.setDot(start); caret.setDot(start);
caret.moveDot(dot); caret.moveDot(dot);
if (FormulaPane.containsParam(replacement)) { if (FormulaPane.containsParam(replacement)) {
textComp.replaceSelection(FormulaPane.getParamPrefix(replacement) + replacement); String selectedText = textComp.getSelectedText();
int caretPosition = textComp.getCaretPosition(); //找到选择文本(光标输入位置dot)进行补全
textComp.setCaretPosition(caretPosition); String text = textComp.getText().substring(0, dot);
int index = text.lastIndexOf(selectedText);
//获取replacement的前缀,replacement是不带前缀的,例如变量$$page_number,获取到的replacement是page_number
String paramPrefix = FormulaPane.getParamPrefix(replacement);
//当选择文本之前有和param前缀相同大小的字符串时,截取对比一下,如果内容相同,则前缀已经存在,不用再拼接了
String prefix = (index >= paramPrefix.length()) ? text.substring(index - paramPrefix.length(), index) : StringUtils.EMPTY;
if (!FormulaPane.getParamPrefix(replacement).equals(prefix)) {
replacement = paramPrefix + replacement;
}
textComp.replaceSelection(replacement);
} else { } else {
textComp.replaceSelection(replacement + "()"); textComp.replaceSelection(replacement + "()");
int caretPosition = textComp.getCaretPosition(); int caretPosition = textComp.getCaretPosition();

8
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java

@ -29,11 +29,11 @@ public abstract class AbstractChartStylePane extends BasicPane {
protected void initPane() { protected void initPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
double e1 = 75; double labelWidth = 90;
double e = 155; double totalWidth = 155;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] columnSize = {e1, e}; double[] columnSize = {labelWidth, totalWidth};
JPanel gapTableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getComponent(), getRows(p), columnSize, 20, LayoutConstants.VGAP_LARGE); JPanel gapTableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getComponent(), getRows(p), columnSize, 5, LayoutConstants.VGAP_LARGE);
gapTableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); gapTableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
UIScrollPane rightTopPane = new UIScrollPane(gapTableLayoutPane); UIScrollPane rightTopPane = new UIScrollPane(gapTableLayoutPane);
rightTopPane.setBorder(BorderFactory.createEmptyBorder()); rightTopPane.setBorder(BorderFactory.createEmptyBorder());

9
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java

@ -2,7 +2,6 @@ package com.fr.design.mainframe.theme.edit.chart;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -79,11 +78,11 @@ public class ChartFontPane extends BasicPane {
} }
protected JPanel getContentPane(JPanel buttonPane) { protected JPanel getContentPane(JPanel buttonPane) {
double e1 = 75; double labelWidth = 90;
double e = 155; double totalWidth = 155;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rows = {p, p, p}; double[] rows = {p, p, p};
double[] columnSize = {e1, e}; double[] columnSize = {labelWidth, totalWidth};
UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT); UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT);
Component[][] components = { Component[][] components = {
new Component[]{null, null}, new Component[]{null, null},
@ -91,7 +90,7 @@ public class ChartFontPane extends BasicPane {
new Component[]{null, buttonPane} new Component[]{null, buttonPane}
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rows, columnSize, 20, LayoutConstants.VGAP_LARGE); return TableLayoutHelper.createGapTableLayoutPane(components, rows, columnSize, 5, LayoutConstants.VGAP_LARGE);
} }
public String getUILabelText() { public String getUILabelText() {

Loading…
Cancel
Save