From 33d55e89c8792729da78eda81e3f32125d79a831 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 6 Apr 2021 18:26:33 +0800 Subject: [PATCH 01/11] =?UTF-8?q?REPORT-50096=20FR=E8=BF=9C=E7=A8=8BBI?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E6=94=B9=E5=8A=A8=E9=85=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E4=BF=9D=E5=AD=98=E5=90=8E=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/connect/JDBCDefPane.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 4bf6bf190..0e11c2629 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -99,6 +99,8 @@ public class JDBCDefPane extends JPanel { private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor(); private IntegerEditor DBCP_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor(); + private JDBCDatabaseConnection jdbcDatabase; + public JDBCDefPane() { this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); @@ -202,6 +204,7 @@ public class JDBCDefPane extends JPanel { if (jdbcDatabase == null) { jdbcDatabase = new JDBCDatabaseConnection(); } + this.jdbcDatabase = jdbcDatabase; if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver") && jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) { this.dbtypeComboBox.setSelectedItem("Access"); @@ -235,6 +238,7 @@ public class JDBCDefPane extends JPanel { if (dbcpAttr == null) { dbcpAttr = new DBCPConnectionPoolAttr(); jdbcDatabase.setDbcpAttr(dbcpAttr); + this.jdbcDatabase.setDbcpAttr(dbcpAttr); } this.DBCP_INITIAL_SIZE.setValue(dbcpAttr.getInitialSize()); this.DBCP_MAX_ACTIVE.setValue(dbcpAttr.getMaxActive()); @@ -251,7 +255,6 @@ public class JDBCDefPane extends JPanel { } public JDBCDatabaseConnection update() { - JDBCDatabaseConnection jdbcDatabase = new JDBCDatabaseConnection(); Object driveItem = this.driverComboBox.getSelectedItem(); jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString()); jdbcDatabase.setURL(this.urlTextField.getText().trim()); From cc5c4753c9fc73d916ba182007e1fff75873f769 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 6 Apr 2021 18:28:56 +0800 Subject: [PATCH 02/11] =?UTF-8?q?REPORT-50096=20fix=20=E9=A2=84=E9=98=B2np?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 0e11c2629..4d2003144 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -255,6 +255,9 @@ public class JDBCDefPane extends JPanel { } public JDBCDatabaseConnection update() { + if (jdbcDatabase == null) { + jdbcDatabase = new JDBCDatabaseConnection(); + } Object driveItem = this.driverComboBox.getSelectedItem(); jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString()); jdbcDatabase.setURL(this.urlTextField.getText().trim()); From 82fa6142d1235ef52dd8d0b9c6abc3e695caa81b Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 7 Apr 2021 17:36:21 +0800 Subject: [PATCH 03/11] =?UTF-8?q?REPORT-50096=20=E5=9C=A8=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E4=B8=AD=E6=9B=B4=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E7=B1=BB=E5=9E=8B=E5=90=8E=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=90=8D=E7=A7=B0=E5=AD=97=E6=AE=B5=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=92=8C=E4=B9=8B=E5=89=8D=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 4d2003144..20187bd50 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -303,6 +303,8 @@ public class JDBCDefPane extends JPanel { urlTextField.setText(dus[i].getURL()); } } + // 更改数据库类型后 数据库名称置空和之前逻辑保持一致 + jdbcDatabase.setDatabase(StringUtils.EMPTY); } }; From 2d4a7c8bcb1d6455048e3f9b7b182fac8e49e5f6 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 8 Apr 2021 16:59:39 +0800 Subject: [PATCH 04/11] =?UTF-8?q?REPORT-50096=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A1=AB=E5=85=85=E6=97=B6=E4=B8=8D=E9=9C=80=E8=A6=81=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 20187bd50..94a612b66 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -205,6 +205,7 @@ public class JDBCDefPane extends JPanel { jdbcDatabase = new JDBCDatabaseConnection(); } this.jdbcDatabase = jdbcDatabase; + this.dbtypeComboBox.removeActionListener(dbtypeActionListener); if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver") && jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) { this.dbtypeComboBox.setSelectedItem("Access"); @@ -229,6 +230,7 @@ public class JDBCDefPane extends JPanel { this.dbtypeComboBox.setSelectedItem(OTHER_DB); } } + this.dbtypeComboBox.addActionListener(dbtypeActionListener); this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver()); this.urlTextField.setText(jdbcDatabase.getURL()); this.userNameTextField.setText(jdbcDatabase.getUser()); From 5f0d39ecb9c8560aa879639088ba682a655c0ef6 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 13 Apr 2021 17:16:59 +0800 Subject: [PATCH 05/11] =?UTF-8?q?REPORT-49686=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E6=97=A0=E6=B3=95=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=EF=BC=8C=E5=8F=8D=E8=80=8C=E7=BB=84=E4=BB=B6=E7=9A=84backupBou?= =?UTF-8?q?nd=E4=BC=9A=E5=A4=9A=E4=BA=86=E4=B8=AA=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E9=AB=98=E5=BA=A6=EF=BC=8C=E8=BF=99=E6=A0=B7?= =?UTF-8?q?=E4=BC=9A=E9=80=A0=E6=88=90=E6=AF=8F=E6=AC=A1=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E9=83=BD=E5=8A=A0=E4=B8=8A=E8=BF=99=E4=B8=AA=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=EF=BC=8C=E5=B0=B1=E5=87=BA=E7=8E=B0=E4=BA=86bug=E7=8E=B0?= =?UTF-8?q?=E8=B1=A1=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF?= =?UTF-8?q?=E3=80=91=E6=8A=8A=E5=88=A4=E6=96=AD=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=98=AF=E5=90=A6=E6=BC=8F=E7=AE=97=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=94=BE=E5=88=B0FormSelection#fixCreator()=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapters/layout/FRFitLayoutAdapter.java | 10 +--------- .../com/fr/design/mainframe/FormSelection.java | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index c0eb39297..22d74d774 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -347,15 +347,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { //拖拽组件原大小、位置 Rectangle backupBound = creator.getBackupBound(); backupBound.x -= container.getX(); - // REPORT-34739 对绝对画布块的backupBound.y的调整还需要考虑一下参数面板块的高度造成的偏移 - int paraHeight = 0; - if (creator.acceptType(XWAbsoluteLayout.class)) { - JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jTemplate instanceof JForm) { - paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight(); - } - } - backupBound.y -= (container.getY() - paraHeight); + backupBound.y -= container.getY(); //当前拖拽组件的位置 int x = creator.getX(); int y = creator.getY(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java index cbebbcba1..97228209a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java @@ -12,6 +12,7 @@ import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; @@ -270,7 +271,9 @@ public class FormSelection { LayoutAdapter layoutAdapter = AdapterBus.searchLayoutAdapter(designer, creator); if (layoutAdapter != null) { if (creator.acceptType(XWAbsoluteLayout.class) && recs.size() > i) { - creator.setBackupBound(recs.get(i)); + Rectangle rectangle = recs.get(i); + check4ParaPane(rectangle); + creator.setBackupBound(rectangle); } else { creator.setBackupBound(backupBounds); } @@ -280,6 +283,19 @@ public class FormSelection { } } + /** + * 检查下有没有参数面板,如果存在,处理下参数面板造成的偏移量 + * @param rectangle + */ + private void check4ParaPane(Rectangle rectangle) { + int paraHeight = 0; + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jTemplate instanceof JForm) { + paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight(); + } + rectangle.y += paraHeight; + } + private void removeCreatorFromContainer(XCreator creator) { XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(creator); if (parent == null) { From 9dcb81b4a8317cd69139b5ec234411ab741a04da Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 14 Apr 2021 17:10:18 +0800 Subject: [PATCH 06/11] =?UTF-8?q?REPORT-50096=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=B8=8B=E5=88=87=E6=8D=A2=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/connect/JDBCDefPane.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 94a612b66..c47a0d75c 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -100,6 +100,7 @@ public class JDBCDefPane extends JPanel { private IntegerEditor DBCP_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor(); private JDBCDatabaseConnection jdbcDatabase; + private boolean needRefresh = true; public JDBCDefPane() { this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); @@ -201,11 +202,11 @@ public class JDBCDefPane extends JPanel { } public void populate(JDBCDatabaseConnection jdbcDatabase) { + needRefresh = false; if (jdbcDatabase == null) { jdbcDatabase = new JDBCDatabaseConnection(); } this.jdbcDatabase = jdbcDatabase; - this.dbtypeComboBox.removeActionListener(dbtypeActionListener); if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver") && jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) { this.dbtypeComboBox.setSelectedItem("Access"); @@ -230,7 +231,6 @@ public class JDBCDefPane extends JPanel { this.dbtypeComboBox.setSelectedItem(OTHER_DB); } } - this.dbtypeComboBox.addActionListener(dbtypeActionListener); this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver()); this.urlTextField.setText(jdbcDatabase.getURL()); this.userNameTextField.setText(jdbcDatabase.getUser()); @@ -254,6 +254,7 @@ public class JDBCDefPane extends JPanel { this.DBCP_MINEVICTABLEIDLETIMEMILLIS.setValue(dbcpAttr.getMinEvictableIdleTimeMillis() / TIME_MULTIPLE); this.DBCP_NUMTESTSPEREVICTIONRUN.setValue(dbcpAttr.getNumTestsPerEvictionRun()); this.DBCP_TIMEBETWEENEVICTIONRUNSMILLS.setValue(dbcpAttr.getTimeBetweenEvictionRunsMillis()); + needRefresh = true; } public JDBCDatabaseConnection update() { @@ -306,7 +307,9 @@ public class JDBCDefPane extends JPanel { } } // 更改数据库类型后 数据库名称置空和之前逻辑保持一致 - jdbcDatabase.setDatabase(StringUtils.EMPTY); + if (needRefresh) { + jdbcDatabase.setDatabase(StringUtils.EMPTY); + } } }; From 887bd33a2f16e79ab432786d65a851b3a75e7114 Mon Sep 17 00:00:00 2001 From: lucian Date: Thu, 15 Apr 2021 09:58:18 +0800 Subject: [PATCH 07/11] =?UTF-8?q?REPORT-50908=20=E5=A1=AB=E6=8A=A5-?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE-?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7=E4=B8=AD=E5=AF=B9=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=AE=9A=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/ChoosePane.java | 21 ++++-- .../design/gui/icombobox/FRTreeComboBox.java | 13 +++- .../icombobox/SearchPreTaskTreeComboBox.java | 73 +++++++++++++++++++ 3 files changed, 100 insertions(+), 7 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index fce7832ac..38801ec90 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -1,6 +1,7 @@ package com.fr.design.data.datapane; import com.fr.base.TableData; +import com.fr.concurrent.NamedThreadFactory; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.DBUtils; import com.fr.data.core.db.TableProcedure; @@ -17,7 +18,7 @@ import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.dialog.FineJOptionPane; -import com.fr.design.gui.icombobox.FRTreeComboBox; +import com.fr.design.gui.icombobox.SearchPreTaskTreeComboBox; import com.fr.design.gui.icombobox.FilterableComboBoxModel; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxEditor; @@ -59,6 +60,10 @@ import java.util.Collection; import java.util.Enumeration; import java.util.List; import java.util.Set; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.FutureTask; /** * @author zhou @@ -80,21 +85,25 @@ public class ChoosePane extends BasicBeanPane implements Refresha /** * 表名 */ - protected FRTreeComboBox tableNameComboBox; + protected SearchPreTaskTreeComboBox tableNameComboBox; private SwingWorker populateWorker; + private ExecutorService service = Executors.newSingleThreadExecutor(new NamedThreadFactory("ChoosePaneThread")); private PopupMenuListener popupMenuListener = new PopupMenuListener() { @Override public void popupMenuWillBecomeVisible(PopupMenuEvent e) { - new Thread() { + FutureTask task = new FutureTask(new Callable() { @Override - public void run() { + public Object call() { calculateTableDataNames(); + return null; } - }.start(); + }); + service.submit(task); + tableNameComboBox.setPreSearchTask(task); } @Override @@ -158,7 +167,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha schemaBox = new StringUIComboBox(); schemaBox.setEditor(new ComboBoxEditor()); - tableNameComboBox = new FRTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false); + tableNameComboBox = new SearchPreTaskTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false); tableNameComboBox.setEditable(true); tableNameComboBox.setRenderer(listCellRenderer); registerDSChangeListener(); diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java index a7a913335..f0c60d2e8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java @@ -597,6 +597,10 @@ public class FRTreeComboBox extends UIComboBox { return this.item; } + public boolean isSetting() { + return setting; + } + public void insertUpdate(DocumentEvent e) { changeHandler(); } @@ -614,11 +618,18 @@ public class FRTreeComboBox extends UIComboBox { return; } setPopupVisible(true); + search(); + } + + /** + * 模糊搜索,选中首个匹配项 + */ + protected void search() { this.item = textField.getText(); TreeNode root = (TreeNode) tree.getModel().getRoot(); TreePath parent = new TreePath(root); TreeNode node = (TreeNode) parent.getLastPathComponent(); - dealSamePath(parent,node,textField); + dealSamePath(parent, node, textField); this.getEditorComponent().requestFocus(); } diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java new file mode 100644 index 000000000..9e453471e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java @@ -0,0 +1,73 @@ +package com.fr.design.gui.icombobox; + +import com.fr.log.FineLoggerFactory; + +import javax.swing.JTree; +import javax.swing.SwingWorker; +import javax.swing.tree.TreeCellRenderer; +import java.util.concurrent.FutureTask; + +/** + * 模糊搜索前需执行完前置任务的TreeComboBox + * @author Lucian.Chen + * @version 10.0 + * Created by Lucian.Chen on 2021/4/14 + */ +public class SearchPreTaskTreeComboBox extends FRTreeComboBox { + + /** + * 模糊搜索前任务 + */ + private FutureTask preSearchTask; + + public SearchPreTaskTreeComboBox(JTree tree, TreeCellRenderer renderer, boolean editable) { + super(tree, renderer, editable); + } + + public FutureTask getPreSearchTask() { + return preSearchTask; + } + + public void setPreSearchTask(FutureTask preSearchTask) { + this.preSearchTask = preSearchTask; + } + + protected UIComboBoxEditor createEditor() { + return new SearchPreTaskComboBoxEditor(this); + } + + private class SearchPreTaskComboBoxEditor extends FrTreeSearchComboBoxEditor { + + public SearchPreTaskComboBoxEditor(FRTreeComboBox comboBox) { + super(comboBox); + } + + protected void changeHandler() { + if (isSetting()) { + return; + } + setPopupVisible(true); + // 模糊搜索异步 + new SwingWorker() { + @Override + protected Void doInBackground() { + FutureTask task = getPreSearchTask(); + try { + // 确保模糊搜索前任务执行完成后,再进行模糊搜索 + if (task != null) { + task.get(); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + if (task != null) { + // 任务执行后置空,否则会被别的操作重复触发 + setPreSearchTask(null); + } + search(); + return null; + } + }.execute(); + } + } +} From 85cfe2f9a1895f26a5ad9faf890beea726c4d399 Mon Sep 17 00:00:00 2001 From: lucian Date: Fri, 16 Apr 2021 09:52:03 +0800 Subject: [PATCH 08/11] =?UTF-8?q?REPORT-50908=20=E5=A1=AB=E6=8A=A5-?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE-?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7=E4=B8=AD=E5=AF=B9=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=AE=9A=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/data/datapane/ChoosePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 38801ec90..6460cadb9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -89,7 +89,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha private SwingWorker populateWorker; - private ExecutorService service = Executors.newSingleThreadExecutor(new NamedThreadFactory("ChoosePaneThread")); + private static final ExecutorService SERVICE = Executors.newSingleThreadExecutor(new NamedThreadFactory("ChoosePaneThread")); private PopupMenuListener popupMenuListener = new PopupMenuListener() { @@ -102,7 +102,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha return null; } }); - service.submit(task); + SERVICE.submit(task); tableNameComboBox.setPreSearchTask(task); } From c763dc04a6c4a9b796caf18ad0830e48963ee520 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 31 Mar 2021 18:27:19 +0800 Subject: [PATCH 09/11] =?UTF-8?q?REPORT-49034=20=E5=BC=95=E7=94=A8JS?= =?UTF-8?q?=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/file/FILEChooserPane.java | 4 ++-- designer-base/src/main/java/com/fr/file/FILEFactory.java | 4 ++-- designer-base/src/main/java/com/fr/file/FileNodeFILE.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 43c3f43ad..1f4f331d8 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -1158,7 +1158,7 @@ public class FILEChooserPane extends BasicPane { }; } if (FILEChooserPane.this.showWebReport) { - webReportFILE = new FileNodeFILE(FRContext.getCommonOperator().getWebRootPath()); + webReportFILE = new FileNodeFILE(FileNodeFILE.webRootPath); } if (FILEChooserPane.this.showLoc) { processSystemFile(); @@ -1219,7 +1219,7 @@ public class FILEChooserPane extends BasicPane { } if (FILEChooserPane.this.showWebReport) { - webReportFILE = new FileNodeFILE(FRContext.getCommonOperator().getWebRootPath()); + webReportFILE = new FileNodeFILE(FileNodeFILE.webRootPath); } if (FILEChooserPane.this.showLoc) { processSystemFile(); diff --git a/designer-base/src/main/java/com/fr/file/FILEFactory.java b/designer-base/src/main/java/com/fr/file/FILEFactory.java index 5a19108ee..3d48bab34 100644 --- a/designer-base/src/main/java/com/fr/file/FILEFactory.java +++ b/designer-base/src/main/java/com/fr/file/FILEFactory.java @@ -32,7 +32,7 @@ public class FILEFactory { return new FileNodeFILE(new FileNode(path.substring(envPath.length() + 1), false)); } else if (path.startsWith(WEBREPORT_PREFIX)) { return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), false), - FRContext.getCommonOperator().getWebRootPath()); + FileNodeFILE.webRootPath); } else if (path.startsWith(FILE_PREFIX)) { return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length()))); } else { @@ -50,7 +50,7 @@ public class FILEFactory { fixFILENodeAuth(new FileNode(path.substring(ENV_PREFIX.length()), true)); } else if (path.startsWith(WEBREPORT_PREFIX)) { return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), true), - FRContext.getCommonOperator().getWebRootPath()); + FileNodeFILE.webRootPath); } else if (path.startsWith(FILE_PREFIX)) { return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length()))); } else { diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index d096faf8a..bcf1ff768 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -32,7 +32,7 @@ import java.util.Arrays; public class FileNodeFILE implements FILE { - private static String webRootPath = FRContext.getCommonOperator().getWebRootPath(); + public static String webRootPath = FRContext.getCommonOperator().getWebRootPath(); private static String[] supportTypes = FRContext.getFileNodes().getSupportedTypes(); static { From c7592920dd5c6699f187c0ae11f0232c0f1aa669 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 19 Apr 2021 17:22:18 +0800 Subject: [PATCH 10/11] =?UTF-8?q?REPORT-51199=20=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E5=81=8F=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/com/fr/design/images/m_file/preview_disabled.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg index 2d64f68f7..217f23e15 100644 --- a/designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg @@ -1,5 +1,5 @@ - + icon_报表web属性_打印预览_normal From 9a8d4a66d71e28df762d47f43634175eab1d2377 Mon Sep 17 00:00:00 2001 From: lucian Date: Tue, 20 Apr 2021 18:16:19 +0800 Subject: [PATCH 11/11] =?UTF-8?q?REPORT-50908=20=E5=A1=AB=E6=8A=A5-?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE-?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7=E4=B8=AD=E5=AF=B9=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=AE=9A=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/icombobox/SearchPreTaskTreeComboBox.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java index 9e453471e..9ee2a5949 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java @@ -1,5 +1,6 @@ package com.fr.design.gui.icombobox; +import com.fr.design.ui.util.UIUtil; import com.fr.log.FineLoggerFactory; import javax.swing.JTree; @@ -64,7 +65,12 @@ public class SearchPreTaskTreeComboBox extends FRTreeComboBox { // 任务执行后置空,否则会被别的操作重复触发 setPreSearchTask(null); } - search(); + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + search(); + } + }); return null; } }.execute();