Browse Source

REPORT-45095 修复代码质量&优化传递

feature/big-screen
vito 4 years ago
parent
commit
8c138328e2
  1. 45
      designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java
  2. 2
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

45
designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java

@ -697,7 +697,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(2);
//设置Column 2的Editor
column2.setCellEditor(new ColumnValueEditor(DBManipulationPane.this));
column2.setCellEditor(new ColumnValueEditor());
}
@Override
@ -864,43 +864,19 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
*/
private final UILabel textLabel;
private final ValuePane vPane;
private final BasicDialog vPaneDLG;
private Component parent;
/**
* 列值编辑器
*
* @param parent 父组件通过指定父组件启动下一级子窗口
*/
protected ColumnValueEditor(Component parent) {
this(v_Types, parent);
}
@Deprecated
protected ColumnValueEditor() {
this(v_Types, null);
this(v_Types);
}
/**
* 列值编辑器
*
* @param types 编辑器类型
* @param parent 父组件通过指定父组件启动下一级子窗口
* @param types 编辑器类型
*/
protected ColumnValueEditor(Editor<?>[] types, Component parent) {
protected ColumnValueEditor(Editor<?>[] types) {
textLabel = new UILabel();
textLabel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
vPaneDLG.setVisible(true);
}
});
vPane = new ValuePane(types);
Window window = parent == null
? DesignerContext.getDesignerFrame()
: SwingUtilities.getWindowAncestor(parent);
vPaneDLG = vPane.showSmallWindow(window, new DialogActionAdapter() {
DialogActionAdapter adapter = new DialogActionAdapter() {
@Override
public void doOk() {
fireEditingStopped(); // Make the renderer
@ -912,7 +888,18 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
public void doCancel() {
fireEditingCanceled();
}
};
textLabel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
Window window = e.getComponent() == null
? DesignerContext.getDesignerFrame()
: SwingUtilities.getWindowAncestor(e.getComponent());
vPane.showSmallWindow(window, adapter)
.setVisible(true);
}
});
vPane = new ValuePane(types);
}
/*

2
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -356,7 +356,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (isCellGroup) {
column2.setCellRenderer(new ColumnRowGroupCellRenderer2());
column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor(), this));
column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor()));
} else {
column2.setCellRenderer(new SelectedColumnValueTableCellRenderer());
}

Loading…
Cancel
Save