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.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.dialog.DialogActionAdapter; 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.gui.iprogressbar.AutoProgressBar;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; 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监听器 * @param l ChangeListener监听器
*/ */
public static void addDsChangeListener(ChangeListener l) { private static void addDsChangeListener(ChangeListener l, JTemplate<?, ?> template) {
JTemplate<?, ?> template = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
String key = StringUtils.EMPTY; String key = StringUtils.EMPTY;
if (template != null) { if (template != null) {
key = template.getPath(); key = template.getPath();
@ -178,7 +185,6 @@ public abstract class DesignTableDataManager {
} }
dsListeners.add(l); dsListeners.add(l);
} }
/** /**
* 获取数据源source中dsName的所有字段 * 获取数据源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 static final long serialVersionUID = 1L;
private boolean refresModel = false; private boolean refresModel = false;
private String treeName; //树数据集本身的名字 private String treeName; //树数据集本身的名字
private ChangeListener changeListener;
public TableDataComboBox(TableDataSource source){ public TableDataComboBox(TableDataSource source){
this(source,StringUtils.EMPTY); this(source,StringUtils.EMPTY);
@ -136,15 +137,22 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
} }
} }
/** /**
*注册listener,相应数据集改变 *注册listener,相应数据集改变
*/ */
public void registerDSChangeListener() { @Override
DesignTableDataManager.addDsChangeListener(new ChangeListener() { public void registerDSChangeListener() {
public void stateChanged(ChangeEvent e) { changeListener = new ChangeListener() {
TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource()); @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.base.present.DictPresent;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
@ -13,7 +14,7 @@ import com.fr.design.present.dict.DictionaryPane;
* @author zhou * @author zhou
* @since 2012-5-31上午10:54:20 * @since 2012-5-31上午10:54:20
*/ */
public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> { public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> implements Prepare4DataSourceChange {
private DictionaryPane dictionaryPane; private DictionaryPane dictionaryPane;
public DictPresentPane() { public DictPresentPane() {
@ -50,4 +51,8 @@ public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> {
dictionaryPane.reset(); 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.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DataCreatorUI; 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.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -20,7 +21,7 @@ import java.util.List;
* @author zhou * @author zhou
* @since 2012-5-31下午12:20:41 * @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; private TableDataDictPane tableDataDictPane;
@Override @Override
@ -77,4 +78,9 @@ public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCr
paneList.add(new FormulaDictPane()); paneList.add(new FormulaDictPane());
return paneList; 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.TableDataTreePane;
import com.fr.design.data.datapane.preview.PreviewLabel; import com.fr.design.data.datapane.preview.PreviewLabel;
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; 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.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.editor.DoubleDeckValueEditorPane; import com.fr.design.editor.DoubleDeckValueEditorPane;
@ -48,7 +49,7 @@ import java.util.List;
* @editor zhou * @editor zhou
* @since 2012-3-29下午1:49:24 * @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 BEGIN = 1;
private static final int END = 10; private static final int END = 10;
private static final int VGAP = 24; private static final int VGAP = 24;
@ -368,4 +369,9 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return true; 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()); displays.add(none.title4PopupWindow());
dictPresentPane = new DictPresentPane(); dictPresentPane = new DictPresentPane();
dictPresentPane.registerDSChangeListener();
paneList.add(dictPresentPane); paneList.add(dictPresentPane);
keys.add(DictPresent.class.getName()); keys.add(DictPresent.class.getName());
displays.add(dictPresentPane.title4PopupWindow()); displays.add(dictPresentPane.title4PopupWindow());

Loading…
Cancel
Save