Browse Source

Merge branch 'feature/10.0' of ssh://cloud.finedevelop.com:7999/~zheng/C-design into feature/10.0

feature/10.0
shine 4 years ago
parent
commit
160c0bd9ef
  1. 3
      designer-base/src/main/java/com/fr/design/DesignModelAdapter.java
  2. 22
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
  3. 14
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  4. 8
      designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java
  5. 12
      designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg

3
designer-base/src/main/java/com/fr/design/DesignModelAdapter.java

@ -300,6 +300,9 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
Map<String, ParameterProvider> map,
Filter<ParameterProvider> filter) {
// 兼容下通过老数据集参数获取
tableDataParameters = getLatestTableDataParameters();
// 处理初始化添加
if (tableDataParametersMap.isEmpty()) {
addTableDataParameters(map, filter);

22
designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java

@ -1,7 +1,6 @@
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;
@ -18,7 +17,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.SearchPreTaskTreeComboBox;
import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.icombobox.FilterableComboBoxModel;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxEditor;
@ -60,10 +59,6 @@ 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
@ -85,25 +80,20 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
/**
* 表名
*/
protected SearchPreTaskTreeComboBox tableNameComboBox;
protected FRTreeComboBox tableNameComboBox;
private SwingWorker populateWorker;
private static final ExecutorService SERVICE = Executors.newSingleThreadExecutor(new NamedThreadFactory("ChoosePaneThread"));
private PopupMenuListener popupMenuListener = new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
FutureTask<Void> task = new FutureTask<Void>(new Callable() {
new Thread() {
@Override
public Object call() {
public void run() {
calculateTableDataNames();
return null;
}
});
SERVICE.submit(task);
tableNameComboBox.setPreSearchTask(task);
}.start();
}
@Override
@ -167,7 +157,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
schemaBox = new StringUIComboBox();
schemaBox.setEditor(new ComboBoxEditor());
tableNameComboBox = new SearchPreTaskTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false);
tableNameComboBox = new FRTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false);
tableNameComboBox.setEditable(true);
tableNameComboBox.setRenderer(listCellRenderer);
registerDSChangeListener();

14
designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java

@ -73,6 +73,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
private UIComboBox charSetComboBox;
private String originalCharSet = null;
private JPanel mainPanel;
// Database pane
public DatabaseConnectionPane() {
this.initComponents();
@ -248,7 +249,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
@Override
public void populateBean(com.fr.data.impl.Connection ob) {
populateSubDatabaseConnectionBean((E) ob);
if (mainPanel() instanceof JDBCDefPane) {
if (mainPanel instanceof JDBCDefPane) {
return;
}
this.originalCharSet = ob.getOriginalCharsetName();
@ -264,7 +265,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
@Override
public com.fr.data.impl.Connection updateBean() {
E ob = updateSubDatabaseConnectionBean();
if (mainPanel() instanceof JDBCDefPane) {
if (mainPanel instanceof JDBCDefPane) {
return ob;
}
ob.setOriginalCharsetName(this.originalCharSet);
@ -306,13 +307,14 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
testPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 4));
// Center
northPane.add(mainPanel(), BorderLayout.CENTER);
mainPanel = mainPanel();
northPane.add(mainPanel, BorderLayout.CENTER);
JPanel advancedPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
advancedPanel.setBorder(BorderFactory.createTitledBorder(
new ModLineBorder(ModLineBorder.TOP),
Toolkit.i18nText("Fine-Design_Basic_Advanced")
));
if (mainPanel() instanceof JDBCDefPane) {
if (mainPanel instanceof JDBCDefPane) {
ActionLabel actionLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Basic_ConnectionPool_Attr"));
actionLabel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
@ -340,7 +342,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
}
private JDialog createJDialog() {
return JDBC.getAdvancedAttrPane() != null ? JDBC.getAdvancedAttrPane().showWindow(SwingUtilities.getWindowAncestor(mainPanel())) : null;
return JDBC.getAdvancedAttrPane() != null ? JDBC.getAdvancedAttrPane().showWindow(SwingUtilities.getWindowAncestor(mainPanel)) : null;
}
private void initDialogPane() {
@ -420,7 +422,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
private static JNDIDefPane jndiDefPane = new JNDIDefPane();
@Override
protected JPanel mainPanel() {
protected JPanel mainPanel() {
return jndiDefPane;
}

8
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();

12
designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 12 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_报表web属性_打印预览_normal</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<g id="工具栏/导入数据集" transform="translate(-116.000000, -7.000000)" fill="#333334">
<g id="icon_报表web属性_打印预览_normal" transform="translate(114.000000, 6.000000)">
<path d="M9.5,7 C11.432875,7 13,8.567125 13,10.5 C13,11.1075915 12.845147,11.679042 12.5727578,12.1770349 C12.6203353,12.2075319 12.6650188,12.2450114 12.7069,12.287 L13.7129,13.293 C14.1039,13.684 14.1039,14.316 13.7129,14.707 C13.5179,14.902 13.2619,15 13.0059,15 C12.7499,15 12.4939,14.902 12.2989,14.707 L11.2929,13.701 C11.251507,13.6597129 11.2144961,13.6157024 11.1818672,13.5695439 C10.6844106,13.8436886 10.110446,14 9.5,14 C7.567125,14 6,12.432875 6,10.5 C6,8.567125 7.567125,7 9.5,7 Z M10,1 L14,5 L14,8 L13,8 L13,6 L9,6 L9,2 L3,2 L3,14 L7,14 L7,15 L2,15 L2,1 L10,1 Z M9.5,8 C10.8783333,8 12,9.12166667 12,10.5 C12,11.8783333 10.8783333,13 9.5,13 C8.12166667,13 7,11.8783333 7,10.5 C7,9.12166667 8.12166667,8 9.5,8 Z M12.587,5 L10,2.414 L10,5 L12.587,5 Z" id="Combined-Shape"></path>
</g>
</g>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_预览_disabled</title>
<g id="icon_预览_disabled" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<path d="M9.5,7 C11.432875,7 13,8.567125 13,10.5 C13,11.1075915 12.845147,11.679042 12.5727578,12.1770349 C12.6203353,12.2075319 12.6650188,12.2450114 12.7069,12.287 L13.7129,13.293 C14.1039,13.684 14.1039,14.316 13.7129,14.707 C13.5179,14.902 13.2619,15 13.0059,15 C12.7499,15 12.4939,14.902 12.2989,14.707 L11.2929,13.701 C11.251507,13.6597129 11.2144961,13.6157024 11.1818672,13.5695439 C10.6844106,13.8436886 10.110446,14 9.5,14 C7.567125,14 6,12.432875 6,10.5 C6,8.567125 7.567125,7 9.5,7 Z M10,1 L14,5 L14,8 L13,8 L13,6 L9,6 L9,2 L3,2 L3,14 L7,14 L7,15 L2,15 L2,1 L10,1 Z M9.5,8 C10.8783333,8 12,9.12166667 12,10.5 C12,11.8783333 10.8783333,13 9.5,13 C8.12166667,13 7,11.8783333 7,10.5 C7,9.12166667 8.12166667,8 9.5,8 Z M12.587,5 L10,2.414 L10,5 L12.587,5 Z" id="Combined-Shape" fill="#333334"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Loading…
Cancel
Save