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));
}
}
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;
}
public void addTableData(TableDataSource tableDataSource) {
/**
* 合并数据集
* @param srcName 数据集来源(比如报表块就是报表块的名称)
* @param tableDataSource 数据集
*/
public void addTableData(String srcName, TableDataSource tableDataSource) {
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
TableDataSource tds = tc.getBook();
Iterator tdIterator = tableDataSource.getTableDataNameIterator();
while (tdIterator.hasNext()) {
String tdName = (String) tdIterator.next();
TableData td = tableDataSource.getTableData(tdName);
if (tds.getTableData(tdName) != null) {
tds.putTableData(tdName + "-fr-el", td);
} else {
tds.putTableData(tdName, td);
if (tds.getTableData(tdName) != null) {//如果有同名的就拼上来源名称
tdName = srcName + tdName;
}
int i = 0;
while (tds.getTableData(tdName) != null) {
i++;//如果拼上名字后依然已经存在就加编号
tdName += i;
}
tds.putTableData(tdName, td);
}
tc.fireTargetModified();
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.utils.ComponentUtils;
import com.fr.form.share.ShareLoader;
import com.fr.form.ui.ElCaseBindInfo;
import com.fr.form.ui.SharableElementCaseEditor;
import com.fr.form.ui.Widget;
import com.fr.general.Inter;
@ -83,9 +84,11 @@ public class FormCreatorDropTarget extends DropTarget {
//tab布局添加的时候是初始化了XWCardLayout,实际上最顶层的布局是XWCardMainBorderLayout
XCreator addingXCreator = addingModel.getXCreator();
if (addingXCreator.isShared()) {
SharableElementCaseEditor sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(addingXCreator.getShareId());
if (sharableEditor != null) {
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(sharableEditor.getTableDataSource());
String shareId = addingXCreator.getShareId();
SharableElementCaseEditor sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(shareId);
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();

Loading…
Cancel
Save