Browse Source

REPORT-24176 设计器 数据字典问题

feature/big-screen
hades 5 years ago
parent
commit
7c5e9cc3cc
  1. 14
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  2. 28
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java
  3. 7
      designer-base/src/main/java/com/fr/design/present/DictPresentPane.java
  4. 8
      designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java
  5. 8
      designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java
  6. 1
      designer-realize/src/main/java/com/fr/design/present/PresentPane.java

14
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -20,7 +20,7 @@ import com.fr.design.data.tabledata.wrapper.TableDataFactory;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
@ -160,13 +160,20 @@ public abstract class DesignTableDataManager {
}
}
public static void addDsChangeListener(ChangeListener l) {
addDsChangeListener(l, HistoryTemplateListCache.getInstance().getCurrentEditingTemplate());
}
public static void addGlobalDsChangeListener(ChangeListener l) {
addDsChangeListener(l, null);
}
/**
* 添加模板数据集改变 监听事件.
*
* @param l ChangeListener监听器
*/
public static void addDsChangeListener(ChangeListener l) {
JTemplate<?, ?> template = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
private static void addDsChangeListener(ChangeListener l, JTemplate<?, ?> template) {
String key = StringUtils.EMPTY;
if (template != null) {
key = template.getPath();
@ -178,7 +185,6 @@ public abstract class DesignTableDataManager {
}
dsListeners.add(l);
}
/**
* 获取数据源source中dsName的所有字段
*

28
designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java

@ -34,6 +34,7 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
private static final long serialVersionUID = 1L;
private boolean refresModel = false;
private String treeName; //树数据集本身的名字
private ChangeListener changeListener;
public TableDataComboBox(TableDataSource source){
this(source,StringUtils.EMPTY);
@ -136,15 +137,22 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
}
}
/**
*注册listener,相应数据集改变
*/
public void registerDSChangeListener() {
DesignTableDataManager.addDsChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource());
}
});
}
/**
*注册listener,相应数据集改变
*/
@Override
public void registerDSChangeListener() {
changeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource());
}
};
DesignTableDataManager.addDsChangeListener(changeListener);
}
public void registerGlobalDSChangeListener() {
DesignTableDataManager.addGlobalDsChangeListener(changeListener);
}
}

7
designer-base/src/main/java/com/fr/design/present/DictPresentPane.java

@ -5,6 +5,7 @@ import java.awt.event.ItemListener;
import com.fr.base.present.DictPresent;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.present.dict.DictionaryPane;
@ -13,7 +14,7 @@ import com.fr.design.present.dict.DictionaryPane;
* @author zhou
* @since 2012-5-31上午10:54:20
*/
public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> {
public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> implements Prepare4DataSourceChange {
private DictionaryPane dictionaryPane;
public DictPresentPane() {
@ -50,4 +51,8 @@ public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> {
dictionaryPane.reset();
}
@Override
public void registerDSChangeListener() {
dictionaryPane.registerDSChangeListener();
}
}

8
designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java

@ -5,6 +5,7 @@ import com.fr.data.impl.DynamicSQLDict;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
@ -20,7 +21,7 @@ import java.util.List;
* @author zhou
* @since 2012-5-31下午12:20:41
*/
public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCreatorUI {
public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCreatorUI, Prepare4DataSourceChange {
private TableDataDictPane tableDataDictPane;
@Override
@ -77,4 +78,9 @@ public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCr
paneList.add(new FormulaDictPane());
return paneList;
}
@Override
public void registerDSChangeListener() {
tableDataDictPane.registerDSChangeListener();
}
}

8
designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java

@ -16,6 +16,7 @@ import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.data.datapane.preview.PreviewLabel;
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.editor.DoubleDeckValueEditorPane;
@ -48,7 +49,7 @@ import java.util.List;
* @editor zhou
* @since 2012-3-29下午1:49:24
*/
public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary> implements Previewable, UIObserver {
public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary> implements Previewable, UIObserver, Prepare4DataSourceChange {
private static final int BEGIN = 1;
private static final int END = 10;
private static final int VGAP = 24;
@ -368,4 +369,9 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
public boolean shouldResponseChangeListener() {
return true;
}
@Override
public void registerDSChangeListener() {
tableDataNameComboBox.registerGlobalDSChangeListener();
}
}

1
designer-realize/src/main/java/com/fr/design/present/PresentPane.java

@ -75,6 +75,7 @@ public class PresentPane extends UIComboBoxPane<Present> {
displays.add(none.title4PopupWindow());
dictPresentPane = new DictPresentPane();
dictPresentPane.registerDSChangeListener();
paneList.add(dictPresentPane);
keys.add(DictPresent.class.getName());
displays.add(dictPresentPane.title4PopupWindow());

Loading…
Cancel
Save