Browse Source

REPORT-3348 修改后触发保存

master
yaoh.wu 7 years ago
parent
commit
17ae107b76
  1. 2
      designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java
  2. 74
      designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
  3. 4
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

2
designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java

@ -14,7 +14,7 @@ import java.util.Iterator;
public class SelectedConfirmedDataColumnPane extends SelectedDataColumnPane { public class SelectedConfirmedDataColumnPane extends SelectedDataColumnPane {
public SelectedConfirmedDataColumnPane() { public SelectedConfirmedDataColumnPane() {
super(false, false); super(false);
} }
protected void initTableNameComboBox() { protected void initTableNameComboBox() {

74
designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -17,6 +17,7 @@ import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.data.TableDataColumn; import com.fr.general.data.TableDataColumn;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
@ -54,12 +55,17 @@ public class SelectedDataColumnPane extends BasicPane {
private UIButton paramButton; private UIButton paramButton;
public SelectedDataColumnPane() { public SelectedDataColumnPane() {
this(true, false); this(true, false, null);
} }
public SelectedDataColumnPane(boolean showParameterButton, boolean verticalLayout) {
public SelectedDataColumnPane(boolean showParameterButton) {
this(showParameterButton, false, null);
}
public SelectedDataColumnPane(boolean showParameterButton, boolean verticalLayout, ElementCasePane casePane) {
if (verticalLayout) { if (verticalLayout) {
initComponentVerticalLayout(true); initComponentVerticalLayout(casePane);
} else { } else {
initComponent(showParameterButton); initComponent(showParameterButton);
} }
@ -111,15 +117,11 @@ public class SelectedDataColumnPane extends BasicPane {
/** /**
* 初始化组件 * 初始化竖直布局的组件
*
* @param showParameterButton 是否显示参数按钮
*/ */
public void initComponentVerticalLayout(boolean showParameterButton) { public void initComponentVerticalLayout(ElementCasePane casePane) {
initTableNameComboBox(); initTableNameComboBox();
if (showParameterButton) { initWithParameterButton(casePane);
initWithParameterButton();
}
columnNameComboBox = new LazyComboBox() { columnNameComboBox = new LazyComboBox() {
@Override @Override
public Object[] load() { public Object[] load() {
@ -132,27 +134,17 @@ public class SelectedDataColumnPane extends BasicPane {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
UILabel label1 = new UILabel(Inter.getLocText("TableData")); UILabel label1 = new UILabel(Inter.getLocText("TableData"));
UILabel label3 = new UILabel(Inter.getLocText("DataColumn")); UILabel label3 = new UILabel(Inter.getLocText("DataColumn"));
if (showParameterButton) {
//todo 国际化 //todo 国际化
UILabel label2 = new UILabel("param"); UILabel label2 = new UILabel("param");
Component[][] components = { Component[][] components = {
{label1, tableNameComboBox}, {label1, tableNameComboBox},
{label2, paramButton}, {label2, paramButton},
{label3, columnNameComboBox} {label3, columnNameComboBox}
}; };
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f})); this.add(TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f}));
} else {
double[] columnSize = {p, f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{label1, tableNameComboBox},
new Component[]{label3, columnNameComboBox}
};
JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(jPanel, BorderLayout.CENTER);
}
} }
@ -286,6 +278,26 @@ public class SelectedDataColumnPane extends BasicPane {
}); });
} }
private void initWithParameterButton(ElementCasePane casePane) {
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel());
paramButton = new UIButton(Inter.getLocText("TableData_Dynamic_Parameter_Setting"));
paramButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
BasicDialog paramDialog = editorPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
List<ParameterProvider> parameterList = editorPane.update();
ps = parameterList.toArray(new Parameter[parameterList.size()]);
editorPane.update();
casePane.fireTargetModified();
}
});
editorPane.populate(ps == null ? new Parameter[0] : ps);
paramDialog.setVisible(true);
}
});
}
private boolean isColumnName(String columnExp) { private boolean isColumnName(String columnExp) {
return StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#"); return StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#");

4
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -53,7 +53,7 @@ import java.util.ArrayList;
*/ */
public class CellDSColumnEditor extends CellQuickEditor { public class CellDSColumnEditor extends CellQuickEditor {
private static double P = TableLayout.PREFERRED, F = TableLayout.FILL; private static final double P = TableLayout.PREFERRED, F = TableLayout.FILL;
private enum FilterType { private enum FilterType {
//前N个 后N个 奇数 偶数 自定义 未定义 //前N个 后N个 奇数 偶数 自定义 未定义
@ -204,7 +204,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
DSColumnBasicEditorPane() { DSColumnBasicEditorPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
dataPane = new SelectedDataColumnPane(true, true); dataPane = new SelectedDataColumnPane(true, true, tc);
groupPane = new ResultSetGroupDockingPane(tc); groupPane = new ResultSetGroupDockingPane(tc);
dataPane.addListener(dataListener); dataPane.addListener(dataListener);
groupPane.addListener(groupListener); groupPane.addListener(groupListener);

Loading…
Cancel
Save