Browse Source

Merge pull request #7002 in DESIGN/design from release/11.0 to feature/x

* commit 'd58018f922fc036e0f49fe5ef24fec46a5ba3fd6':
  REPORT-63675
  REPORT-63675 自动构建的下拉树数据字典点击后数据集字段会变化
feature/x
superman 3 years ago
parent
commit
fa62be832b
  1. 16
      designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
  2. 7
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  3. 20
      designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java

16
designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java

@ -36,8 +36,6 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import java.util.HashSet;
import java.util.Set;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.DefaultCellEditor; import javax.swing.DefaultCellEditor;
@ -55,8 +53,10 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.util.EventObject; import java.util.EventObject;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Set;
/** /**
* Coder: zack * Coder: zack
@ -83,6 +83,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
protected String[] allDSNames; protected String[] allDSNames;
protected ConnectionTableAction connectionTableAction; protected ConnectionTableAction connectionTableAction;
protected ToolBarDef toolbarDef; protected ToolBarDef toolbarDef;
protected TableDataTreePaneListener listener = null;
private String type = ""; private String type = "";
@ -142,6 +143,17 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
public abstract void dgEdit(final AbstractTableDataPane<?> uPanel, String originalName, boolean isUpdate); public abstract void dgEdit(final AbstractTableDataPane<?> uPanel, String originalName, boolean isUpdate);
public void showEditPane(final AbstractTableDataPane<?> tableDataPane, String originalName, TableDataTreePaneListener listener) {
this.listener = listener;
dgEdit(tableDataPane, originalName);
}
public interface TableDataTreePaneListener {
void doOk();
void doCancel();
}
protected void doPropertyChange(BasicDialog dg, BasicPane.NamePane nPanel, final String oldName) { protected void doPropertyChange(BasicDialog dg, BasicPane.NamePane nPanel, final String oldName) {
type = dg.getTitle(); type = dg.getTitle();
nPanel.setShowText(StringUtils.BLANK); nPanel.setShowText(StringUtils.BLANK);

7
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -361,11 +361,18 @@ public class TableDataTreePane extends BasicTableDataTreePane {
//单独编辑数据集关闭,修改缓存配置状态,刷新下一键开启/关闭按钮 //单独编辑数据集关闭,修改缓存配置状态,刷新下一键开启/关闭按钮
checkButtonEnabled(); checkButtonEnabled();
if (listener != null) {
listener.doOk();
}
} }
@Override @Override
public void doCancel() { public void doCancel() {
super.doCancel(); super.doCancel();
if (listener != null) {
listener.doCancel();
}
} }
}); });
tdNamePanel.addPropertyChangeListener(new PropertyChangeAdapter() { tdNamePanel.addPropertyChangeListener(new PropertyChangeAdapter() {

20
designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java

@ -242,12 +242,22 @@ public class JTreeAutoBuildPane extends BasicPane implements PreviewLabel.Previe
rtd = treeTableDataComboBox.getSelcetedTableData(); rtd = treeTableDataComboBox.getSelcetedTableData();
name = treeTableDataComboBox.getSelectedItem().getTableDataName(); name = treeTableDataComboBox.getSelectedItem().getTableDataName();
} }
final String tableDataName = name;
AbstractTableDataWrapper atdw = new TemplateTableDataWrapper(rtd, ""); AbstractTableDataWrapper atdw = new TemplateTableDataWrapper(rtd, "");
tdtp.dgEdit(atdw.creatTableDataPane(), name); tdtp.showEditPane(atdw.creatTableDataPane(), name, new BasicTableDataTreePane.TableDataTreePaneListener() {
treeTableDataComboBox.refresh(); @Override
treeTableDataComboBox.setSelectedTableDataByName(name); public void doOk() {
textPane.populate(1); // 去除缓存列,后面刷新会重新选中
valuePane.populate(1); DesignTableDataManager.removeSelectedColumnNames(tableDataName);
treeTableDataComboBox.refresh();
treeTableDataComboBox.setSelectedTableDataByName(tableDataName);
}
@Override
public void doCancel() {
}
});
} }
} }

Loading…
Cancel
Save