Browse Source

Merge remote-tracking branch 'origin/release/11.0' into release/11.0

newui
Destiny.Lin 1 year ago
parent
commit
0dce97988c
  1. 13
      designer-base/src/main/java/com/fr/design/mainframe/widget/editors/DataBindingEditor.java
  2. 20
      designer-base/src/main/java/com/fr/design/mainframe/widget/editors/WidgetValueEditor.java
  3. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java

13
designer-base/src/main/java/com/fr/design/mainframe/widget/editors/DataBindingEditor.java

@ -29,8 +29,8 @@ public class DataBindingEditor extends Editor<DataBinding> {
private final static int HORI_GAP = 1;
private final static int VER_GAP = 7;
private TableDataComboBox tableDataComboBox;
private LazyComboBox columnNameComboBox;
protected TableDataComboBox tableDataComboBox;
protected LazyComboBox columnNameComboBox;
private ItemListener tableDataComboBoxListener = new ItemListener() {
public void itemStateChanged(ItemEvent evt) {
boolean isInit = columnNameComboBox.getSelectedIndex() == -1;
@ -87,9 +87,16 @@ public class DataBindingEditor extends Editor<DataBinding> {
}
});
columnNameComboBox.setEditable(true);
addComboBoxesAndSetPosition();
columnNameComboBox.addItemListener(columnNameComboboxListener);
}
/**
* 根据需求不同调整下拉框的位置
*/
protected void addComboBoxesAndSetPosition() {
this.add(tableDataComboBox, BorderLayout.NORTH);
this.add(columnNameComboBox, BorderLayout.CENTER);
columnNameComboBox.addItemListener(columnNameComboboxListener);
}
protected TableDataSource getTableDataSource() {

20
designer-base/src/main/java/com/fr/design/mainframe/widget/editors/WidgetValueEditor.java

@ -5,6 +5,7 @@
package com.fr.design.mainframe.widget.editors;
import java.awt.Component;
import java.awt.BorderLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@ -30,6 +31,7 @@ public class WidgetValueEditor extends AbstractPropertyEditor {
/**
* 根据类型创建
* 服务器 - 控件管理
* @param type 类型
* @param onlyServer 是否是服务器
* @return 编辑器
@ -41,7 +43,7 @@ public class WidgetValueEditor extends AbstractPropertyEditor {
case DataControl.TYPE_FORMULA:
return new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Parameter_Formula"));
case DataControl.TYPE_DATABINDING:
return onlyServer ? new ServerDataBindingEditor() : new DataBindingEditor();
return onlyServer ? new WidgetValueServerDataBindingEditor() : new WidgetValueDataBindingEditor();
case DataControl.TYPE_STRING:
return new TextEditor();
case DataControl.TYPE_BOOLEAN:
@ -70,6 +72,22 @@ public class WidgetValueEditor extends AbstractPropertyEditor {
}
return editor;
}
private static class WidgetValueDataBindingEditor extends DataBindingEditor {
@Override
protected void addComboBoxesAndSetPosition() {
this.add(tableDataComboBox, BorderLayout.CENTER);
this.add(columnNameComboBox, BorderLayout.EAST);
}
}
private static class WidgetValueServerDataBindingEditor extends ServerDataBindingEditor {
@Override
protected void addComboBoxesAndSetPosition() {
this.add(tableDataComboBox, BorderLayout.CENTER);
this.add(columnNameComboBox, BorderLayout.EAST);
}
}
public WidgetValueEditor(Object o) {
this(o, false);

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java

@ -63,7 +63,7 @@ public class FormWidgetValuePane extends JPanel {
/**
* 根据类型创建
*
* 设计器右侧控件设置 - 属性
* @param type 类型
* @param onlyServer 是否是服务器
* @return 编辑器

Loading…
Cancel
Save