From ad8e082c3921624f6bf681ebcad22a8f24b50666 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 12 Mar 2021 14:22:39 +0800 Subject: [PATCH 01/25] =?UTF-8?q?REPORT-45944=20=20ui=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrameFileDealerPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 39ef20658..fb8f9a2da 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -598,7 +598,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt }); // 重名提示 warnLabel = new UILabel(); - warnLabel.setPreferredSize(new Dimension(300, 30)); + warnLabel.setPreferredSize(new Dimension(300, 50)); warnLabel.setHorizontalAlignment(SwingConstants.LEFT); warnLabel.setVerticalAlignment(SwingConstants.TOP); warnLabel.setForeground(Color.RED); @@ -641,7 +641,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt new Component[]{midPanel}, new Component[]{buttonsPane} }, - new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.PREFERRED}, + new double[]{TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED}, new double[]{TableLayout.FILL} ), BorderLayout.CENTER); @@ -803,7 +803,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt }); // 重名提示 warnLabel = new UILabel(); - warnLabel.setPreferredSize(new Dimension(300, 30)); + warnLabel.setPreferredSize(new Dimension(300, 50)); warnLabel.setHorizontalAlignment(SwingConstants.LEFT); warnLabel.setVerticalAlignment(SwingConstants.TOP); warnLabel.setForeground(Color.RED); @@ -848,7 +848,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt new Component[]{midPanel}, new Component[]{bottomPanel} }, - new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.PREFERRED}, + new double[]{TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED}, new double[]{TableLayout.FILL} ), BorderLayout.CENTER); From 434f4a0f5622140dab6dd1c2d5d50335ecf0011c Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Mon, 15 Mar 2021 16:37:32 +0800 Subject: [PATCH 02/25] =?UTF-8?q?CHART-18080=20=E4=BF=AE=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E8=BE=93=E5=85=A5=E6=A1=86=E8=BE=93=E5=85=A5=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E6=97=B6=E8=87=AA=E5=8A=A8=E5=88=A0=E9=99=A4=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/itextfield/UINumberField.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java index f4437a9c4..8176905fe 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java @@ -5,11 +5,15 @@ import com.fr.general.ComparatorUtils; import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.PlainDocument; import java.awt.Dimension; import java.awt.Toolkit; +import java.awt.event.InputMethodEvent; +import java.awt.event.InputMethodListener; /** * Number Field. @@ -35,6 +39,8 @@ public class UINumberField extends UITextField { private boolean isContentChanged = false; private boolean fillNegativeNumber = true; + private boolean isInputMethodChange = false; + private int insertOffset = 0; public UINumberField() { this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH); @@ -55,6 +61,7 @@ public class UINumberField extends UITextField { this.minValue = minValue; this.maxValue = maxValue; setFieldDocument(); + initFieldListener(); } public void setFieldDocument() { @@ -62,6 +69,31 @@ public class UINumberField extends UITextField { initListener(); } + private void initFieldListener() { + addInputMethodListener(new InputMethodListener() { + @Override + public void inputMethodTextChanged(InputMethodEvent event) { + isInputMethodChange = true; + } + + @Override + public void caretPositionChanged(InputMethodEvent event) { + } + }); + + addCaretListener(new CaretListener() { + @Override + public void caretUpdate(CaretEvent e) { + if (isInputMethodChange) { + isInputMethodChange = false; + setCaretPosition(insertOffset); + } else { + insertOffset = e.getDot(); + } + } + }); + } + public void canFillNegativeNumber(boolean fillNegativeNumber) { this.fillNegativeNumber = fillNegativeNumber; } @@ -186,6 +218,13 @@ public class UINumberField extends UITextField { super.insertString(offset, s, a); } + public void remove(int offs, int len) throws BadLocationException { + if (isInputMethodChange) { + return; + } + super.remove(offs, len); + } + // kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100. // 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难.. private boolean notChange(String strNew) { From f462925487d4fbb7a3914b90fb3f9edac3c9976c Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 16 Mar 2021 10:42:02 +0800 Subject: [PATCH 03/25] =?UTF-8?q?REPORT-48965=20=E5=87=BA=E7=8E=B0concurre?= =?UTF-8?q?ntModification=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/core/ActionFactory.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index 574195470..6c7d6408a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -14,11 +14,12 @@ import java.awt.event.KeyEvent; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedHashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.CopyOnWriteArraySet; /** * 插入单元格元素和插入悬浮元素的一些集合方法 @@ -27,8 +28,8 @@ import java.util.concurrent.ConcurrentMap; * @version 2017年11月17日14点39分 */ public class ActionFactory { - private static LinkedHashSet> actionClasses = new LinkedHashSet<>(); - private static LinkedHashSet> floatActionClasses = new LinkedHashSet<>(); + private static Set> actionClasses = new CopyOnWriteArraySet<>(); + private static Set> floatActionClasses = new CopyOnWriteArraySet<>(); private static Class chartCollectionClass = null; /** * 无需每次实例化的悬浮元素编辑器 From 6daaa9f4f9b0bd2ea5f0a4d67b62660895bb5c6c Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 16 Mar 2021 10:56:36 +0800 Subject: [PATCH 04/25] =?UTF-8?q?REPORT-48965=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=B7=BB=E5=8A=A0=20=E5=87=8F=E5=B0=91?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E5=A4=8D=E5=88=B6=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/core/ActionFactory.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index 6c7d6408a..f19c962f8 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -13,6 +13,7 @@ import javax.swing.KeyStroke; import java.awt.event.KeyEvent; import java.lang.reflect.Constructor; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; @@ -257,14 +258,14 @@ public class ActionFactory { */ public static void registerCellInsertActionClass(Class[] cls) { if (cls != null) { - Collections.addAll(actionClasses, cls); + actionClasses.addAll(Arrays.asList(cls)); } } public static void referCellInsertActionClass(Class[] cls) { if (cls != null) { actionClasses.clear(); - Collections.addAll(actionClasses, cls); + actionClasses.addAll(Arrays.asList(cls)); } } @@ -322,14 +323,14 @@ public class ActionFactory { */ public static void registerFloatInsertActionClass(Class[] cls) { if (cls != null) { - Collections.addAll(floatActionClasses, cls); + floatActionClasses.addAll(Arrays.asList(cls)); } } public static void referFloatInsertActionClass(Class[] cls) { if (cls != null) { floatActionClasses.clear(); - Collections.addAll(floatActionClasses, cls); + floatActionClasses.addAll(Arrays.asList(cls)); } } From 8e2f877e495472979d464a32cc59ab80dca2a414 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 17 Mar 2021 11:39:15 +0800 Subject: [PATCH 05/25] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=8B=E5=9B=A0=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81=E8=A2=AB=E5=88=A0=E9=99=A4=E7=9A=84svg=E5=9B=BE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/images/buttonicon/prewidget_normal.svg | 8 ++++++++ .../fr/design/images/buttonicon/refresh_normal.svg | 7 +++++++ .../images/buttonicon/widget/files_up_normal.svg | 7 +++++++ .../com/fr/design/images/control/edit_disable.svg | 8 ++++++++ .../com/fr/design/images/control/edit_normal.svg | 8 ++++++++ .../com/fr/design/images/control/remove_disable.svg | 11 +++++++++++ .../com/fr/design/images/control/remove_normal.svg | 9 +++++++++ .../com/fr/design/images/m_file/preview_disable.svg | 11 +++++++++++ .../com/fr/design/images/m_file/preview_normal.svg | 7 +++++++ 9 files changed, 76 insertions(+) create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/prewidget_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/refresh_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/files_up_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/control/edit_disable.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/control/edit_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/control/remove_disable.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/control/remove_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/preview_disable.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/preview_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/prewidget_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/prewidget_normal.svg new file mode 100644 index 000000000..542c02c26 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/prewidget_normal.svg @@ -0,0 +1,8 @@ + + + icon_控件管理 有小箭头_normal + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/refresh_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/refresh_normal.svg new file mode 100644 index 000000000..4e3fd9c14 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/refresh_normal.svg @@ -0,0 +1,7 @@ + + + icon_刷新_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/files_up_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/files_up_normal.svg new file mode 100644 index 000000000..34cd6083a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/files_up_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_文件控件_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/control/edit_disable.svg b/designer-base/src/main/resources/com/fr/design/images/control/edit_disable.svg new file mode 100644 index 000000000..9b001cfc5 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/control/edit_disable.svg @@ -0,0 +1,8 @@ + + + icon_编辑_disable + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/control/edit_normal.svg b/designer-base/src/main/resources/com/fr/design/images/control/edit_normal.svg new file mode 100644 index 000000000..291719452 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/control/edit_normal.svg @@ -0,0 +1,8 @@ + + + icon_编辑_normal + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/control/remove_disable.svg b/designer-base/src/main/resources/com/fr/design/images/control/remove_disable.svg new file mode 100644 index 000000000..b57f9a853 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/control/remove_disable.svg @@ -0,0 +1,11 @@ + + + icon_删除_normal + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/control/remove_normal.svg b/designer-base/src/main/resources/com/fr/design/images/control/remove_normal.svg new file mode 100644 index 000000000..b09268f45 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/control/remove_normal.svg @@ -0,0 +1,9 @@ + + + icon_删除_normal备份 + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/preview_disable.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/preview_disable.svg new file mode 100644 index 000000000..2d64f68f7 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/preview_disable.svg @@ -0,0 +1,11 @@ + + + icon_报表web属性_打印预览_normal + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/preview_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/preview_normal.svg new file mode 100644 index 000000000..7b0ea197d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/preview_normal.svg @@ -0,0 +1,7 @@ + + + icon_预览_normal + + + + \ No newline at end of file From be0850e46a6bd224fade40fed6f5ba853f9e8093 Mon Sep 17 00:00:00 2001 From: vito Date: Mon, 22 Mar 2021 18:34:09 +0800 Subject: [PATCH 06/25] =?UTF-8?q?KERNEL-6368=E3=80=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E3=80=91XML=E6=B3=A8=E5=85=A5(XML=20External?= =?UTF-8?q?=20Entity=20Injection)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DefaultCompletionProvider.java | 676 +++++++++--------- .../ui/rsyntaxtextarea/SyntaxScheme.java | 4 + .../gui/syntax/ui/rsyntaxtextarea/Theme.java | 9 +- .../design/gui/syntax/ui/rtextarea/Macro.java | 8 + .../server/FineEmbedServerActivator.java | 5 + 5 files changed, 369 insertions(+), 333 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/autocomplete/DefaultCompletionProvider.java b/designer-base/src/main/java/com/fr/design/gui/autocomplete/DefaultCompletionProvider.java index 4a002cf01..df36add40 100644 --- a/designer-base/src/main/java/com/fr/design/gui/autocomplete/DefaultCompletionProvider.java +++ b/designer-base/src/main/java/com/fr/design/gui/autocomplete/DefaultCompletionProvider.java @@ -2,7 +2,7 @@ * 12/21/2008 * * DefaultCompletionProvider.java - A basic completion provider implementation. - * + * * This library is distributed under a modified BSD license. See the included * RSyntaxTextArea.License.txt file for details. */ @@ -24,7 +24,11 @@ import javax.swing.text.Segment; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; + +import com.fr.log.FineLoggerFactory; import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; /** @@ -38,337 +42,345 @@ import org.xml.sax.SAXException; */ public class DefaultCompletionProvider extends AbstractCompletionProvider { - protected Segment seg; - - /** - * Used to speed up {@link #getCompletionsAt(JTextComponent, Point)}. - */ - private String lastCompletionsAtText; - - /** - * Used to speed up {@link #getCompletionsAt(JTextComponent, Point)}, - * since this may be called multiple times in succession (this is usually - * called by JTextComponent.getToolTipText(), and if the user - * wiggles the mouse while a tool tip is displayed, this method gets - * repeatedly called. It can be costly so we try to speed it up a tad). - */ - private List lastParameterizedCompletionsAt; - - /** - * Constructor. The returned provider will not be aware of any completions. - * - * @see #addCompletion(Completion) - */ - public DefaultCompletionProvider() { - init(); - } - - - /** - * Creates a completion provider that provides completion for a simple - * list of words. - * - * @param words The words to offer as completion suggestions. If this is - * null, no completions will be known. - * @see BasicCompletion - */ - public DefaultCompletionProvider(String[] words) { - init(); - addWordCompletions(words); - } - - - /** - * Returns the text just before the current caret position that could be - * the start of something auto-completable.

- * - * This method returns all characters before the caret that are matched - * by {@link #isValidChar(char)}. - * - * {@inheritDoc} - */ - public String getAlreadyEnteredText(JTextComponent comp) { - - Document doc = comp.getDocument(); - - int dot = comp.getCaretPosition(); - Element root = doc.getDefaultRootElement(); - int index = root.getElementIndex(dot); - Element elem = root.getElement(index); - int start = elem.getStartOffset(); - int len = dot-start; - try { - doc.getText(start, len, seg); - } catch (BadLocationException ble) { - - return EMPTY_STRING; - } - - int segEnd = seg.offset + len; - start = segEnd - 1; - while (start>=seg.offset && isValidChar(seg.array[start])) { - start--; - } - start++; - - len = segEnd - start; - return len==0 ? EMPTY_STRING : new String(seg.array, start, len); - - } - - - /** - * {@inheritDoc} - */ - public List getCompletionsAt(JTextComponent tc, Point p) { - - int offset = tc.viewToModel(p); - if (offset<0 || offset>=tc.getDocument().getLength()) { - lastCompletionsAtText = null; - return lastParameterizedCompletionsAt = null; - } - - Segment s = new Segment(); - Document doc = tc.getDocument(); - Element root = doc.getDefaultRootElement(); - int line = root.getElementIndex(offset); - Element elem = root.getElement(line); - int start = elem.getStartOffset(); - int end = elem.getEndOffset() - 1; - - try { - - doc.getText(start, end-start, s); - - // Get the valid chars before the specified offset. - int startOffs = s.offset + (offset-start) - 1; - while (startOffs>=s.offset && isValidChar(s.array[startOffs])) { - startOffs--; - } - - // Get the valid chars at and after the specified offset. - int endOffs = s.offset + (offset-start); - while (endOffs list = getCompletionByInputText(text); - lastCompletionsAtText = text; - return lastParameterizedCompletionsAt = list; - - } catch (BadLocationException ble) { - // Never happens - } - - lastCompletionsAtText = null; - return lastParameterizedCompletionsAt = null; - - } - - - /** - * {@inheritDoc} - */ - public List getParameterizedCompletions( - JTextComponent tc) { - - List list = null; - - // If this provider doesn't support parameterized completions, - // bail out now. - char paramListStart = getParameterListStart(); - if (paramListStart==0) { - return list; // null - } - - int dot = tc.getCaretPosition(); - Segment s = new Segment(); - Document doc = tc.getDocument(); - Element root = doc.getDefaultRootElement(); - int line = root.getElementIndex(dot); - Element elem = root.getElement(line); - int offs = elem.getStartOffset(); - int len = dot - offs - 1/*paramListStart.length()*/; - if (len<=0) { // Not enough chars on line for a method. - return list; // null - } - - try { - - doc.getText(offs, len, s); - - // Get the identifier preceding the '(', ignoring any whitespace - // between them. - offs = s.offset + len - 1; - while (offs>=s.offset && Character.isWhitespace(s.array[offs])) { - offs--; - } - int end = offs; - while (offs>=s.offset && isValidChar(s.array[offs])) { - offs--; - } - - String text = new String(s.array, offs+1, end-offs); - - // Get a list of all Completions matching the text, but then - // narrow it down to just the ParameterizedCompletions. - List l = getCompletionByInputText(text); - if (l!=null && !l.isEmpty()) { - for (int i=0; i(1); - } - list.add((ParameterizedCompletion)o); - } - } - } - - } catch (BadLocationException ble) { - // Never happens - } - - return list; - - } - - - /** - * Initializes this completion provider. - */ - protected void init() { - completions = new ArrayList(); - seg = new Segment(); - } - - - /** - * Returns whether the specified character is valid in an auto-completion. - * The default implementation is equivalent to - * "Character.isLetterOrDigit(ch) || ch=='_'". Subclasses - * can override this method to change what characters are matched. - * - * @param ch The character. - * @return Whether the character is valid. - */ - protected boolean isValidChar(char ch) { - return Character.isLetterOrDigit(ch) || ch=='_'; - } - - - /** - * Loads completions from an XML file. The XML should validate against - * CompletionXml.dtd. - * - * @param file An XML file to load from. - * @throws IOException If an IO error occurs. - */ - public void loadFromXML(File file) throws IOException { - BufferedInputStream bin = new BufferedInputStream( - new FileInputStream(file)); - try { - loadFromXML(bin); - } finally { - bin.close(); - } - } - - - /** - * Loads completions from an XML input stream. The XML should validate - * against CompletionXml.dtd. - * - * @param in The input stream to read from. - * @throws IOException If an IO error occurs. - */ - public void loadFromXML(InputStream in) throws IOException { - loadFromXML(in, null); - } - - - /** - * Loads completions from an XML input stream. The XML should validate - * against CompletionXml.dtd. - * - * @param in The input stream to read from. - * @param cl The class loader to use when loading any extra classes defined - * in the XML, such as custom {@link FunctionCompletion}s. This - * may be null if the default is to be used, or if no - * custom completions are defined in the XML. - * @throws IOException If an IO error occurs. - */ - public void loadFromXML(InputStream in, ClassLoader cl) throws IOException { - - //long start = System.currentTimeMillis(); - - SAXParserFactory factory = SAXParserFactory.newInstance(); - factory.setValidating(true); - CompletionXMLParser handler = new CompletionXMLParser(this, cl); - BufferedInputStream bin = new BufferedInputStream(in); - try { - SAXParser saxParser = factory.newSAXParser(); - saxParser.parse(bin, handler); - List completions = handler.getCompletions(); - addCompletions(completions); - char startChar = handler.getParamStartChar(); - if (startChar!=0) { - char endChar = handler.getParamEndChar(); - String sep = handler.getParamSeparator(); - if (endChar!=0 && sep!=null && sep.length()>0) { // Sanity - setParameterizedCompletionParams(startChar, sep, endChar); - } - } - } catch (SAXException se) { - throw new IOException(se.toString()); - } catch (ParserConfigurationException pce) { - throw new IOException(pce.toString()); - } finally { - //long time = System.currentTimeMillis() - start; - //System.out.println("XML loaded in: " + time + "ms"); - bin.close(); - } - - } - - - /** - * Loads completions from an XML file. The XML should validate against - * CompletionXml.dtd. - * - * @param resource A resource the current ClassLoader can get to. - * @throws IOException If an IO error occurs. - */ - public void loadFromXML(String resource) throws IOException { - ClassLoader cl = getClass().getClassLoader(); - InputStream in = cl.getResourceAsStream(resource); - if (in==null) { - File file = new File(resource); - if (file.isFile()) { - in = new FileInputStream(file); - } - else { - throw new IOException("No such resource: " + resource); - } - } - BufferedInputStream bin = new BufferedInputStream(in); - try { - loadFromXML(bin); - } finally { - bin.close(); - } - } + protected Segment seg; + + /** + * Used to speed up {@link #getCompletionsAt(JTextComponent, Point)}. + */ + private String lastCompletionsAtText; + + /** + * Used to speed up {@link #getCompletionsAt(JTextComponent, Point)}, + * since this may be called multiple times in succession (this is usually + * called by JTextComponent.getToolTipText(), and if the user + * wiggles the mouse while a tool tip is displayed, this method gets + * repeatedly called. It can be costly so we try to speed it up a tad). + */ + private List lastParameterizedCompletionsAt; + + /** + * Constructor. The returned provider will not be aware of any completions. + * + * @see #addCompletion(Completion) + */ + public DefaultCompletionProvider() { + init(); + } + + + /** + * Creates a completion provider that provides completion for a simple + * list of words. + * + * @param words The words to offer as completion suggestions. If this is + * null, no completions will be known. + * @see BasicCompletion + */ + public DefaultCompletionProvider(String[] words) { + init(); + addWordCompletions(words); + } + + + /** + * Returns the text just before the current caret position that could be + * the start of something auto-completable.

+ *

+ * This method returns all characters before the caret that are matched + * by {@link #isValidChar(char)}. + *

+ * {@inheritDoc} + */ + public String getAlreadyEnteredText(JTextComponent comp) { + + Document doc = comp.getDocument(); + + int dot = comp.getCaretPosition(); + Element root = doc.getDefaultRootElement(); + int index = root.getElementIndex(dot); + Element elem = root.getElement(index); + int start = elem.getStartOffset(); + int len = dot - start; + try { + doc.getText(start, len, seg); + } catch (BadLocationException ble) { + + return EMPTY_STRING; + } + + int segEnd = seg.offset + len; + start = segEnd - 1; + while (start >= seg.offset && isValidChar(seg.array[start])) { + start--; + } + start++; + + len = segEnd - start; + return len == 0 ? EMPTY_STRING : new String(seg.array, start, len); + + } + + + /** + * {@inheritDoc} + */ + public List getCompletionsAt(JTextComponent tc, Point p) { + + int offset = tc.viewToModel(p); + if (offset < 0 || offset >= tc.getDocument().getLength()) { + lastCompletionsAtText = null; + return lastParameterizedCompletionsAt = null; + } + + Segment s = new Segment(); + Document doc = tc.getDocument(); + Element root = doc.getDefaultRootElement(); + int line = root.getElementIndex(offset); + Element elem = root.getElement(line); + int start = elem.getStartOffset(); + int end = elem.getEndOffset() - 1; + + try { + + doc.getText(start, end - start, s); + + // Get the valid chars before the specified offset. + int startOffs = s.offset + (offset - start) - 1; + while (startOffs >= s.offset && isValidChar(s.array[startOffs])) { + startOffs--; + } + + // Get the valid chars at and after the specified offset. + int endOffs = s.offset + (offset - start); + while (endOffs < s.offset + s.count && isValidChar(s.array[endOffs])) { + endOffs++; + } + + int len = endOffs - startOffs - 1; + if (len <= 0) { + return lastParameterizedCompletionsAt = null; + } + String text = new String(s.array, startOffs + 1, len); + + if (text.equals(lastCompletionsAtText)) { + return lastParameterizedCompletionsAt; + } + + // Get a list of all Completions matching the text. + List list = getCompletionByInputText(text); + lastCompletionsAtText = text; + return lastParameterizedCompletionsAt = list; + + } catch (BadLocationException ble) { + // Never happens + } + + lastCompletionsAtText = null; + return lastParameterizedCompletionsAt = null; + + } + + + /** + * {@inheritDoc} + */ + public List getParameterizedCompletions( + JTextComponent tc) { + + List list = null; + + // If this provider doesn't support parameterized completions, + // bail out now. + char paramListStart = getParameterListStart(); + if (paramListStart == 0) { + return list; // null + } + + int dot = tc.getCaretPosition(); + Segment s = new Segment(); + Document doc = tc.getDocument(); + Element root = doc.getDefaultRootElement(); + int line = root.getElementIndex(dot); + Element elem = root.getElement(line); + int offs = elem.getStartOffset(); + int len = dot - offs - 1/*paramListStart.length()*/; + if (len <= 0) { // Not enough chars on line for a method. + return list; // null + } + + try { + + doc.getText(offs, len, s); + + // Get the identifier preceding the '(', ignoring any whitespace + // between them. + offs = s.offset + len - 1; + while (offs >= s.offset && Character.isWhitespace(s.array[offs])) { + offs--; + } + int end = offs; + while (offs >= s.offset && isValidChar(s.array[offs])) { + offs--; + } + + String text = new String(s.array, offs + 1, end - offs); + + // Get a list of all Completions matching the text, but then + // narrow it down to just the ParameterizedCompletions. + List l = getCompletionByInputText(text); + if (l != null && !l.isEmpty()) { + for (int i = 0; i < l.size(); i++) { + Object o = l.get(i); + if (o instanceof ParameterizedCompletion) { + if (list == null) { + list = new ArrayList(1); + } + list.add((ParameterizedCompletion) o); + } + } + } + + } catch (BadLocationException ble) { + // Never happens + } + + return list; + + } + + + /** + * Initializes this completion provider. + */ + protected void init() { + completions = new ArrayList(); + seg = new Segment(); + } + + + /** + * Returns whether the specified character is valid in an auto-completion. + * The default implementation is equivalent to + * "Character.isLetterOrDigit(ch) || ch=='_'". Subclasses + * can override this method to change what characters are matched. + * + * @param ch The character. + * @return Whether the character is valid. + */ + protected boolean isValidChar(char ch) { + return Character.isLetterOrDigit(ch) || ch == '_'; + } + + + /** + * Loads completions from an XML file. The XML should validate against + * CompletionXml.dtd. + * + * @param file An XML file to load from. + * @throws IOException If an IO error occurs. + */ + public void loadFromXML(File file) throws IOException { + BufferedInputStream bin = new BufferedInputStream( + new FileInputStream(file)); + try { + loadFromXML(bin); + } finally { + bin.close(); + } + } + + + /** + * Loads completions from an XML input stream. The XML should validate + * against CompletionXml.dtd. + * + * @param in The input stream to read from. + * @throws IOException If an IO error occurs. + */ + public void loadFromXML(InputStream in) throws IOException { + loadFromXML(in, null); + } + + + /** + * Loads completions from an XML input stream. The XML should validate + * against CompletionXml.dtd. + * + * @param in The input stream to read from. + * @param cl The class loader to use when loading any extra classes defined + * in the XML, such as custom {@link FunctionCompletion}s. This + * may be null if the default is to be used, or if no + * custom completions are defined in the XML. + * @throws IOException If an IO error occurs. + */ + public void loadFromXML(InputStream in, ClassLoader cl) throws IOException { + + //long start = System.currentTimeMillis(); + + SAXParserFactory factory = SAXParserFactory.newInstance(); + try { + factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + factory.setFeature("http://xml.org/sax/features/external-general-entities", false); + factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + } catch (ParserConfigurationException | SAXNotSupportedException | SAXNotRecognizedException e) { + FineLoggerFactory.getLogger().warn(e.getMessage(), e); + } + + factory.setValidating(true); + CompletionXMLParser handler = new CompletionXMLParser(this, cl); + BufferedInputStream bin = new BufferedInputStream(in); + try { + SAXParser saxParser = factory.newSAXParser(); + saxParser.parse(bin, handler); + List completions = handler.getCompletions(); + addCompletions(completions); + char startChar = handler.getParamStartChar(); + if (startChar != 0) { + char endChar = handler.getParamEndChar(); + String sep = handler.getParamSeparator(); + if (endChar != 0 && sep != null && sep.length() > 0) { // Sanity + setParameterizedCompletionParams(startChar, sep, endChar); + } + } + } catch (SAXException se) { + throw new IOException(se.toString()); + } catch (ParserConfigurationException pce) { + throw new IOException(pce.toString()); + } finally { + //long time = System.currentTimeMillis() - start; + //System.out.println("XML loaded in: " + time + "ms"); + bin.close(); + } + + } + + + /** + * Loads completions from an XML file. The XML should validate against + * CompletionXml.dtd. + * + * @param resource A resource the current ClassLoader can get to. + * @throws IOException If an IO error occurs. + */ + public void loadFromXML(String resource) throws IOException { + ClassLoader cl = getClass().getClassLoader(); + InputStream in = cl.getResourceAsStream(resource); + if (in == null) { + File file = new File(resource); + if (file.isFile()) { + in = new FileInputStream(file); + } else { + throw new IOException("No such resource: " + resource); + } + } + BufferedInputStream bin = new BufferedInputStream(in); + try { + loadFromXML(bin); + } finally { + bin.close(); + } + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxScheme.java b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxScheme.java index dbaaf4c6f..8bbedf0be 100644 --- a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxScheme.java +++ b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxScheme.java @@ -624,6 +624,10 @@ public class SyntaxScheme implements Cloneable, TokenTypes { SyntaxSchemeLoader parser = null; try { XMLReader reader = XMLReaderFactory.createXMLReader(); + reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + reader.setFeature("http://xml.org/sax/features/external-general-entities", false); + reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); parser = new SyntaxSchemeLoader(baseFont); parser.baseFont = baseFont; reader.setContentHandler(parser); diff --git a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/Theme.java b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/Theme.java index 3b422f574..896a5eec4 100644 --- a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/Theme.java +++ b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/Theme.java @@ -22,6 +22,7 @@ import java.lang.reflect.Field; import javax.swing.UIManager; import javax.swing.plaf.ColorUIResource; import javax.swing.text.StyleContext; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.SAXParser; @@ -493,6 +494,8 @@ public class Theme { StreamResult result = new StreamResult(new PrintWriter( new UnicodeWriter(bout, "UTF-8"))); TransformerFactory transFac = TransformerFactory.newInstance(); + transFac.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + transFac.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transFac.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); @@ -580,8 +583,12 @@ public class Theme { public static void load(Theme theme, InputStream in) throws IOException { SAXParserFactory spf = SAXParserFactory.newInstance(); - spf.setValidating(true); try { + spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + spf.setFeature("http://xml.org/sax/features/external-general-entities", false); + spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + spf.setValidating(true); SAXParser parser = spf.newSAXParser(); XMLReader reader = parser.getXMLReader(); XmlHandler handler = new XmlHandler(); diff --git a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/Macro.java b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/Macro.java index 8a0ba741c..2558eafe0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/Macro.java +++ b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/Macro.java @@ -14,6 +14,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import javax.xml.XMLConstants; import javax.xml.parsers.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; @@ -94,6 +95,11 @@ public class Macro { DocumentBuilder db = null; Document doc = null; try { + dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); + dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + dbf.setXIncludeAware(false); db = dbf.newDocumentBuilder(); //InputSource is = new InputSource(new FileReader(file)); InputSource is = new InputSource(new UnicodeReader( @@ -374,6 +380,8 @@ public class Macro { StreamResult result = new StreamResult(new File(fileName)); DOMSource source = new DOMSource(doc); TransformerFactory transFac = TransformerFactory.newInstance(); + transFac.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + transFac.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transFac.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, FILE_ENCODING); diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index 36b86cb89..5fa8173d4 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -12,6 +12,7 @@ import com.fr.third.springframework.web.context.support.AnnotationConfigWebAppli import com.fr.workspace.WorkContext; import org.apache.catalina.Context; import org.apache.catalina.LifecycleException; +import org.apache.catalina.Wrapper; import org.apache.catalina.loader.WebappLoader; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.webresources.StandardRoot; @@ -73,6 +74,10 @@ public class FineEmbedServerActivator extends Activator { String contextPath = "/" + ProductConstants.getAppFolderName(); final Context context = tomcat.addContext(contextPath, docBase); context.setResources(new StandardRoot(context)); + Wrapper servlet = Tomcat.addServlet(context, "DruidStatView", "com.fr.third.alibaba.druid.support.http.StatViewServlet"); + context.addServletMappingDecoded("/druid/*", "DruidStatView"); + servlet.setLoadOnStartup(1); + servlet.setOverridable(true); Tomcat.initWebappDefaults(context); //覆盖tomcat的WebAppClassLoader context.setLoader(new FRTomcatLoader()); From 7c4c873078a48f9e0cf2afe3679e86d7260e669a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 23 Mar 2021 15:45:40 +0800 Subject: [PATCH 07/25] =?UTF-8?q?CHART-18348=20=E8=B0=83=E6=95=B4=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BB=84=E4=BB=B6=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/com/fr/design/editor/script/editor.js | 4 ++-- .../resources/com/fr/design/editor/script/editor.model.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index 3786e47ef..ec4de690d 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -74,10 +74,10 @@ }], layouts: [{ type: "bi.left", - rgap: 5 + rgap: 2 }], value: this.model.mode, - width: 125 + width: 170 }, this._getToolBar()], height: 24 }, { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js index e1ee49645..06f7bf2bf 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js @@ -18,7 +18,7 @@ return [{ type: "bi.single_select_radio_item", text: BI.i18nText("BI-Basic_Auto"), - width: 50, + width: 70, logic: { dynamic: true }, @@ -27,7 +27,7 @@ }, { type: "bi.single_select_radio_item", text: BI.i18nText("BI-Basic_Custom"), - width: 60, + width: 80, logic: { dynamic: true }, From 6ce46d57e2132851d49dec173c26bdfdbbf58450 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 23 Mar 2021 16:50:45 +0800 Subject: [PATCH 08/25] =?UTF-8?q?REPORT-50030=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=A4=96=E8=BE=B9=E6=A1=86=E8=AE=BE=E7=BD=AE=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E9=A2=9C=E8=89=B2=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=86=85?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8E=E9=BB=91=E8=89=B2=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 选中表格中区域后,设置边框颜色为黑色,勾选右侧外边框,表格中选中区域的 单元格都出现右边框,正确的效果是只有选中区域右侧的单元格有右边框。 目前代码中更新单元格边框的逻辑是 1. 首先将边框面板的单元格样式直接写入每个单元格中(此时单元格边样式对象值是不对的,需要进行修正) 2. 根据选中区域的单元格样式(旧样式)和边框面板中的样式(新样式)进行比较 3. 决定指定单元格边框是否使用新样式 问题出现在: 1. 无法获取当前选中区域的单元格样式(旧样式),因为已经被污染了. 2. 获取到的边框面板样式不对,导致比较结果出错 3. 只在单元格边框使用新样式时,才重写单元格边框样式对象,不使用新样式时,会继续使用被污染的值. 问题 【改动思路】 1. 在更新边框前,获取选中区域的单元格样式 2. 修改边框面板样式对象的创建逻辑 3. 不使用新样式时,重写单元格边框为旧样式 --- .../com/fr/design/gui/style/BorderPane.java | 30 +++++++++++++++---- .../cell/settingpane/CellStylePane.java | 5 +++- .../settingpane/style/CustomStylePane.java | 4 +-- .../cell/settingpane/style/StylePane.java | 5 ++-- .../java/com/fr/design/style/BorderUtils.java | 23 +++++++++++++- 5 files changed, 54 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index 0dcfe4c21..9f948e7a1 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -217,18 +217,36 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse int lineStyle = currentLineCombo.getSelectedLineStyle(); Color lineColor = currentLineColorPane.getSelectObject(); CellBorderStyle cellBorderStyle = new CellBorderStyle(); - cellBorderStyle.setTopColor(lineColor); + if (topToggleButton.isSelected()) { + cellBorderStyle.setTopColor(lineColor); + } cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setBottomColor(lineColor); + + if (bottomToggleButton.isSelected()) { + cellBorderStyle.setBottomColor(lineColor); + } cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setLeftColor(lineColor); + + if (leftToggleButton.isSelected()) { + cellBorderStyle.setLeftColor(lineColor); + } cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setRightColor(lineColor); + + if (rightToggleButton.isSelected()) { + cellBorderStyle.setRightColor(lineColor); + } cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setVerticalColor(lineColor); + + if (verticalToggleButton.isSelected()) { + cellBorderStyle.setVerticalColor(lineColor); + } cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setHorizontalColor(lineColor); + + if (horizontalToggleButton.isSelected()) { + cellBorderStyle.setHorizontalColor(lineColor); + } cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); + if (leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()) { outerToggleButton.setSelected(true); } else { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index 370677860..4bfd9fa46 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.base.Style; import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.cell.settingpane.style.StylePane; +import com.fr.design.style.BorderUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.report.cell.DefaultTemplateCellElement; @@ -67,6 +68,7 @@ public class CellStylePane extends AbstractCellAttrPane { @Override public void updateBeans() { + Object[] selectionCellBorderObjects = BorderUtils.createCellBorderObject(elementCasePane); if (stylePane.getSelectedIndex() == 1) { Style s = stylePane.updateBean(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); @@ -110,7 +112,8 @@ public class CellStylePane extends AbstractCellAttrPane { } } } - stylePane.updateBorder();// border必须特别处理 + // border必须特别处理 + stylePane.updateBorder(selectionCellBorderObjects); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java index 2d7277239..268dbebe6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java @@ -136,8 +136,8 @@ public class CustomStylePane extends MultiTabPane