Browse Source

Merge pull request #5780 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit '172c8aa2939b041e1db85048aa130003883574fb':
  REPORT-58592 日语版设计器 引用css和JavaScript的选择文件按钮显示不出来了
  REPORT-58592 日语版设计器 引用css和JavaScript的选择文件按钮显示不出来了
  REPORT-58227 远程设计 设计器切换已经打开的模板卡顿
  REPORT-58136 远程设计无法新建决策报表
feature/10.0
superman 3 years ago
parent
commit
e5564ac75a
  1. 48
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
  2. 55
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java
  3. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  4. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  5. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  6. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  7. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  8. 3
      designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java
  9. 5
      designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

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

@ -25,6 +25,7 @@ import com.fr.design.gui.icombobox.UIComboBoxEditor;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -39,7 +40,16 @@ import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.connection.DBConnectAuth; import com.fr.workspace.server.connection.DBConnectAuth;
import javax.swing.*; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.Collections;
import java.util.concurrent.CancellationException;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.SwingWorker;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuEvent;
@ -50,7 +60,6 @@ import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeNode; import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.event.FocusAdapter; import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -70,6 +79,9 @@ import java.util.concurrent.FutureTask;
* @since 2012-7-11下午4:49:39 * @since 2012-7-11下午4:49:39
*/ */
public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refreshable, Previewable, Prepare4DataSourceChange { public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refreshable, Previewable, Prepare4DataSourceChange {
private static final List<String> PENDING_CONTENT = new ArrayList<>(Collections.singletonList(Toolkit.i18nText("Fine-Design_Basic_Loading") + "..."));
private static final double COLUMN_SIZE = 24; private static final double COLUMN_SIZE = 24;
/** /**
@ -91,6 +103,8 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
private SwingWorker populateWorker; private SwingWorker populateWorker;
private SwingWorker<List<String>, Void> initWorker;
private PopupMenuListener popupMenuListener = new PopupMenuListener() { private PopupMenuListener popupMenuListener = new PopupMenuListener() {
@Override @Override
@ -213,10 +227,34 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
protected void initDsNameComboBox() { protected void initDsNameComboBox() {
if (initWorker != null && !initWorker.isDone()) {
initWorker.cancel(true);
}
dsNameComboBox.setRefreshingModel(true); dsNameComboBox.setRefreshingModel(true);
FilterableComboBoxModel dsNameComboBoxModel = new FilterableComboBoxModel(getHasAuthConnections()); dsNameComboBox.setModel(new FilterableComboBoxModel(PENDING_CONTENT));
dsNameComboBox.setModel(dsNameComboBoxModel); initWorker = new SwingWorker<List<String>, Void>() {
dsNameComboBox.setRefreshingModel(false);
@Override
protected List<String> doInBackground() throws Exception {
return getHasAuthConnections();
}
@Override
protected void done() {
try {
FilterableComboBoxModel dsNameComboBoxModel = new FilterableComboBoxModel(get());
String selected = dsNameComboBox.getSelectedItem();
dsNameComboBox.setModel(dsNameComboBoxModel);
dsNameComboBox.setSelectedItem(selected);
dsNameComboBox.setRefreshingModel(false);
} catch (Exception e) {
if (!(e instanceof CancellationException)) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
};
initWorker.execute();
} }
protected void initComponentsLayout(PreviewLabel previewLabel, int labelSize) { protected void initComponentsLayout(PreviewLabel previewLabel, int labelSize) {

55
designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java

@ -3,12 +3,19 @@ package com.fr.design.data.datapane.connect;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.*; import com.fr.log.FineLoggerFactory;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.Iterator;
import java.util.concurrent.CancellationException;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
public abstract class ItemEditableComboBoxPanel extends JPanel { public abstract class ItemEditableComboBoxPanel extends JPanel {
/** /**
@ -16,6 +23,8 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final String PENDING = Toolkit.i18nText("Fine-Design_Basic_Loading") + "...";
protected static final Object EMPTY = new Object() { protected static final Object EMPTY = new Object() {
public String toString() { public String toString() {
return ""; return "";
@ -26,6 +35,8 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
protected UIButton editButton; protected UIButton editButton;
protected UIButton refreshButton; protected UIButton refreshButton;
private SwingWorker<Iterator<String>, Void> refreshWorker;
public ItemEditableComboBoxPanel() { public ItemEditableComboBoxPanel() {
super(); super();
@ -75,26 +86,42 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
* 刷新itemComboBox的内容 * 刷新itemComboBox的内容
*/ */
protected void refreshItems() { protected void refreshItems() {
// 记录原来选中的Item,重新加载后需要再次选中
Object lastSelectedItem = itemComboBox.getSelectedItem(); if (refreshWorker != null && !refreshWorker.isDone()) {
refreshWorker.cancel(true);
}
DefaultComboBoxModel model = ((DefaultComboBoxModel) itemComboBox.getModel()); DefaultComboBoxModel model = ((DefaultComboBoxModel) itemComboBox.getModel());
model.removeAllElements(); model.removeAllElements();
// 先加EMPTY,再加items // 先加EMPTY,再加items
model.addElement(EMPTY); model.addElement(EMPTY);
model.addElement(PENDING);
java.util.Iterator<String> itemIt = items(); refreshWorker = new SwingWorker<Iterator<String>, Void>() {
while(itemIt.hasNext()) { @Override
model.addElement(itemIt.next()); protected Iterator<String> doInBackground() throws Exception {
} return items();
}
// 再次选中之前选中的Item @Override
int idx = model.getIndexOf(lastSelectedItem); protected void done() {
if(idx < 0) { try {
idx = 0; Iterator<String> itemIt = get();
} model.removeElement(PENDING);
itemComboBox.setSelectedIndex(idx); while(itemIt.hasNext()) {
model.addElement(itemIt.next());
}
itemComboBox.setMaximumRowCount(itemComboBox.getMaximumRowCount() + 1);
} catch (Exception e) {
if (!(e instanceof CancellationException)) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
};
refreshWorker.execute();
} }
/* /*

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -7,3 +7,4 @@ com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=490*95 com.fr.design.version.check.dialog=490*95
com.fr.design.version.detail.label=750*30 com.fr.design.version.detail.label=750*30
com.fr.design.version.detail.dialog=900*500 com.fr.design.version.detail.dialog=900*500
com.fr.design.web.pane.text.field=450*20

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -6,3 +6,4 @@ com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=430*95 com.fr.design.version.check.dialog=430*95
com.fr.design.version.detail.label=650*30 com.fr.design.version.detail.label=650*30
com.fr.design.version.detail.dialog=800*500 com.fr.design.version.detail.dialog=800*500
com.fr.design.web.pane.text.field=400*20

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -6,3 +6,4 @@ com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=450*95 com.fr.design.version.check.dialog=450*95
com.fr.design.version.detail.label=700*30 com.fr.design.version.detail.label=700*30
com.fr.design.version.detail.dialog=850*500 com.fr.design.version.detail.dialog=850*500
com.fr.design.web.pane.text.field=450*20

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -7,3 +7,4 @@ com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95 com.fr.design.version.check.dialog=230*95
com.fr.design.version.detail.label=450*30 com.fr.design.version.detail.label=450*30
com.fr.design.version.detail.dialog=600*500 com.fr.design.version.detail.dialog=600*500
com.fr.design.web.pane.text.field=450*20

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -6,3 +6,4 @@ com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95 com.fr.design.version.check.dialog=230*95
com.fr.design.version.detail.label=450*30 com.fr.design.version.detail.label=450*30
com.fr.design.version.detail.dialog=600*500 com.fr.design.version.detail.dialog=600*500
com.fr.design.web.pane.text.field=450*20

3
designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java

@ -5,6 +5,7 @@ import com.fr.design.gui.frpane.EditingStringListPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.file.FILE; import com.fr.file.FILE;
@ -38,7 +39,7 @@ public class WebCssPane extends BasicPane {
JPanel outnorth = new JPanel(new BorderLayout(0, 5)); JPanel outnorth = new JPanel(new BorderLayout(0, 5));
JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT,8,0)); JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT,8,0));
localText = new UITextField(); localText = new UITextField();
localText.setPreferredSize(new Dimension(450, 20)); localText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field"));
localText.setEditable(false); localText.setEditable(false);
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection")); chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection"));
chooseFile.setPreferredSize(new Dimension(75, 23)); chooseFile.setPreferredSize(new Dimension(75, 23));

5
designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

@ -7,6 +7,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.file.FILE; import com.fr.file.FILE;
@ -66,8 +67,8 @@ public class WebJsPane extends BasicPane {
localText = new UITextField(); localText = new UITextField();
localText.setEditable(false); localText.setEditable(false);
urlText = new UITextField(); urlText = new UITextField();
localText.setPreferredSize(new Dimension(450, 20)); localText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field"));
urlText.setPreferredSize(new Dimension(450, 20)); urlText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field"));
urlText.addKeyListener(urlTextListener); urlText.addKeyListener(urlTextListener);
urlText.setEnabled(false); urlText.setEnabled(false);
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection")); chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection"));

Loading…
Cancel
Save