Browse Source

修改

master
zack 8 years ago
parent
commit
f1b68a1798
  1. 8
      designer_base/src/com/fr/design/data/BasicTableDataTreePane.java
  2. 19
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  3. 9
      designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java

8
designer_base/src/com/fr/design/data/BasicTableDataTreePane.java

@ -424,7 +424,13 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_CONNECTION_ICON_PATH)); this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_CONNECTION_ICON_PATH));
} }
} }
public void addTableData(TableDataSource tableDataSource){
/**
* 合并数据集
* @param srcName 数据集来源(比如报表块就是报表块的名称)
* @param tableDataSource 数据集
*/
public void addTableData(String srcName, TableDataSource tableDataSource) {
} }
} }

19
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -270,18 +270,27 @@ public class TableDataTreePane extends BasicTableDataTreePane {
return dataTree; return dataTree;
} }
public void addTableData(TableDataSource tableDataSource) { /**
* 合并数据集
* @param srcName 数据集来源(比如报表块就是报表块的名称)
* @param tableDataSource 数据集
*/
public void addTableData(String srcName, TableDataSource tableDataSource) {
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
TableDataSource tds = tc.getBook(); TableDataSource tds = tc.getBook();
Iterator tdIterator = tableDataSource.getTableDataNameIterator(); Iterator tdIterator = tableDataSource.getTableDataNameIterator();
while (tdIterator.hasNext()) { while (tdIterator.hasNext()) {
String tdName = (String) tdIterator.next(); String tdName = (String) tdIterator.next();
TableData td = tableDataSource.getTableData(tdName); TableData td = tableDataSource.getTableData(tdName);
if (tds.getTableData(tdName) != null) { if (tds.getTableData(tdName) != null) {//如果有同名的就拼上来源名称
tds.putTableData(tdName + "-fr-el", td); tdName = srcName + tdName;
} else { }
tds.putTableData(tdName, td); int i = 0;
while (tds.getTableData(tdName) != null) {
i++;//如果拼上名字后依然已经存在就加编号
tdName += i;
} }
tds.putTableData(tdName, td);
} }
tc.fireTargetModified(); tc.fireTargetModified();
tc.parameterChanged(); tc.parameterChanged();

9
designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java

@ -14,6 +14,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.icon.IconPathConstants; import com.fr.design.icon.IconPathConstants;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.ElCaseBindInfo;
import com.fr.form.ui.SharableElementCaseEditor; import com.fr.form.ui.SharableElementCaseEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -83,9 +84,11 @@ public class FormCreatorDropTarget extends DropTarget {
//tab布局添加的时候是初始化了XWCardLayout,实际上最顶层的布局是XWCardMainBorderLayout //tab布局添加的时候是初始化了XWCardLayout,实际上最顶层的布局是XWCardMainBorderLayout
XCreator addingXCreator = addingModel.getXCreator(); XCreator addingXCreator = addingModel.getXCreator();
if (addingXCreator.isShared()) { if (addingXCreator.isShared()) {
SharableElementCaseEditor sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(addingXCreator.getShareId()); String shareId = addingXCreator.getShareId();
if (sharableEditor != null) { SharableElementCaseEditor sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(shareId);
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(sharableEditor.getTableDataSource()); ElCaseBindInfo bindInfo = ShareLoader.getLoader().getElCaseBindInfoById(shareId);
if (sharableEditor != null && bindInfo != null) {
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(),sharableEditor.getTableDataSource());
} }
} }
Widget widget = (addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); Widget widget = (addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData();

Loading…
Cancel
Save