Browse Source

Pull request #4348: EPORT-52539 REPORT-52512 bug fixed

Merge in DESIGN/design from ~TOMMY/design:feature/10.0 to feature/10.0

* commit 'b53cbb1fed9b463987e05ea83a18bb53c97e070f':
  REPORT-52629 组件展示排序逻辑的保存
  REPORT-52512 共享组件删除后删除对应的数据集
  REPORT-52539 组件生成面板出现横向滚动条
feature/10.0
Tommy 4 years ago
parent
commit
9c7d5e5422
  1. 40
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  2. 5
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java
  3. 2
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java
  4. 2
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java

40
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.PaperSize; import com.fr.base.PaperSize;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.base.iofile.attr.ExtendSharableAttrMark;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState; import com.fr.design.DesignState;
@ -64,6 +65,11 @@ import com.fr.file.filter.ChooseFileFilter;
import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseContainerProvider;
import com.fr.form.FormElementCaseProvider; import com.fr.form.FormElementCaseProvider;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.form.main.WidgetGatherAdapter;
import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.editor.SharableEditorProvider;
import com.fr.form.share.utils.ShareUtils;
import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
@ -77,6 +83,7 @@ import com.fr.report.worksheet.FormElementCase;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import com.fr.web.controller.ViewRequestConstants; import com.fr.web.controller.ViewRequestConstants;
@ -96,6 +103,7 @@ import java.awt.event.ActionListener;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
@ -305,6 +313,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
} else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) {
// 在 delete 之前,会先 select 父组件。这里直接传入 lastAffectedCreator 就好了 // 在 delete 之前,会先 select 父组件。这里直接传入 lastAffectedCreator 就好了
setPropertyPaneChange(lastAffectedCreator); setPropertyPaneChange(lastAffectedCreator);
refreshSharableWidgetTableDataTree((XCreator) lastAffectedCreator);
} else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) {
lastAffectedCreator = evt.getAffectedCreator(); lastAffectedCreator = evt.getAffectedCreator();
setPropertyPaneChange(lastAffectedCreator); setPropertyPaneChange(lastAffectedCreator);
@ -1038,4 +1047,35 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
// richer:form文件 daniel 改成三个字 // richer:form文件 daniel 改成三个字
fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File")));
} }
private void refreshSharableWidgetTableDataTree(XCreator lastAffectedCreator) {
String lastAffectedCreatorShareID = lastAffectedCreator.getShareId();
if (StringUtils.isNotEmpty(lastAffectedCreatorShareID)) {
final boolean[] needDeleteTableData = {true};
Form.traversalWidget(template.getContainer(), new WidgetGatherAdapter() {
@Override
public void dealWith(Widget widget) {
AbstractBorderStyleWidget borderStyleWidget = (AbstractBorderStyleWidget) widget;
ExtendSharableAttrMark attrMark = borderStyleWidget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG);
if (attrMark != null) {
needDeleteTableData[0] = needDeleteTableData[0] && !ComparatorUtils.equals(lastAffectedCreatorShareID, attrMark.getShareId());
}
}
}, AbstractBorderStyleWidget.class);
if (!needDeleteTableData[0]) {
return;
}
SharableWidgetProvider bindInfo = ShareUtils.getElCaseBindInfoById(lastAffectedCreatorShareID);
SharableEditorProvider sharableEditor = ShareUtils.getSharedElCaseEditorById(lastAffectedCreatorShareID);
if (sharableEditor == null || bindInfo == null) {
return;
}
Iterator tdIterator = sharableEditor.getTableDataSource().getTableDataNameIterator();
while (tdIterator.hasNext()) {
String tdName = bindInfo.getName() + "-" + tdIterator.next();
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).removeTableData(tdName);
}
}
}
} }

5
designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java

@ -9,6 +9,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.share.group.ui.GroupFileDialog; import com.fr.design.mainframe.share.group.ui.GroupFileDialog;
import com.fr.design.mainframe.share.sort.SortType;
import com.fr.design.mainframe.share.sort.WidgetSortType; import com.fr.design.mainframe.share.sort.WidgetSortType;
import com.fr.design.mainframe.share.ui.base.PopupMenuItem; import com.fr.design.mainframe.share.ui.base.PopupMenuItem;
import com.fr.design.mainframe.share.ui.widgetfilter.LocalWidgetFilter; import com.fr.design.mainframe.share.ui.widgetfilter.LocalWidgetFilter;
@ -49,6 +50,7 @@ class GroupPane extends JPanel {
//是否展开 //是否展开
private boolean expendStatus; private boolean expendStatus;
private SharableWidgetProvider[] elCaseBindInfoList; private SharableWidgetProvider[] elCaseBindInfoList;
private SortType sortType = WidgetSortType.INSTALL_TIME;
private GroupPane(Group group) { private GroupPane(Group group) {
this(group, DEFAULT_HEIGHT, group.isDefaultExpend()); this(group, DEFAULT_HEIGHT, group.isDefaultExpend());
@ -133,11 +135,12 @@ class GroupPane extends JPanel {
if (widgetProviders == null) { if (widgetProviders == null) {
widgetProviders = new SharableWidgetProvider[0]; widgetProviders = new SharableWidgetProvider[0];
} }
WidgetSortType.INSTALL_TIME.sort(widgetProviders); sortType.sort(widgetProviders);
return widgetProviders; return widgetProviders;
} }
public void sortWidget(WidgetSortType sortType) { public void sortWidget(WidgetSortType sortType) {
this.sortType = sortType;
sortType.sort(elCaseBindInfoList); sortType.sort(elCaseBindInfoList);
reCreateShowPane(elCaseBindInfoList); reCreateShowPane(elCaseBindInfoList);
} }

2
designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java

@ -57,7 +57,7 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE;
public class ShareGeneratePane extends BasicPane { public class ShareGeneratePane extends BasicPane {
private static final Dimension DIALOG_SIZE = new Dimension(670, 740); private static final Dimension DIALOG_SIZE = new Dimension(670, 740);
private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(660, 610); private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610);
private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6); private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6);
private JPanel mainPane = null; private JPanel mainPane = null;

2
designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java

@ -85,7 +85,7 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE;
public class ShareMainPane extends JPanel { public class ShareMainPane extends JPanel {
private static final int COLUMN_ITEM_SIZE = 60; private static final int COLUMN_ITEM_SIZE = 60;
private static final int COLUMN_FIELD_WIDTH = 560; private static final int COLUMN_FIELD_WIDTH = 555;
private static final int TEXT_FIELD_WIDTH = 160; private static final int TEXT_FIELD_WIDTH = 160;
private static final int TEXT_FIELD_HEIGHT = 21; private static final int TEXT_FIELD_HEIGHT = 21;
private static final int NAME_MAX_LENGTH = 50; private static final int NAME_MAX_LENGTH = 50;

Loading…
Cancel
Save