Browse Source

Merge pull request #4362 in DESIGN/design from feature/10.0 to feature/x

* commit 'e789462075380e6987e0375b11ea49efd7da7c13':
  REPORT-52824 10.0.16 模板另存不会生成新的模板id
  REPORT-52264 修改弹窗的父窗口为DesignerContext.getDesignerFrame()
  REPORT-52629 组件展示排序逻辑的保存
  REPORT-52512 共享组件删除后删除对应的数据集
  REPORT-52539 组件生成面板出现横向滚动条
  REPORT-52264 模版权限编辑警告弹窗不在页面中间
research/11.0
superman 4 years ago
parent
commit
ab77e0de52
  1. 2
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  2. 6
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 40
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  4. 5
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java
  5. 2
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java
  6. 2
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java

2
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -967,7 +967,7 @@ public class MutilTempalteTabPane extends JComponent {
//如果在权限编辑情况下,不允许切换到表单类型的工作簿
if (DesignerMode.isAuthorityEditing() && !openedTemplate.get(selectedIndex).isJWorkBook()) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate(openedTemplate.get(tempSelectedIndex));
FineJOptionPane.showMessageDialog(MutilTempalteTabPane.this, Toolkit.i18nText("Fine-Design_Basic_Form_Authority_Edited_Cannot_Be_Supported")
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Form_Authority_Edited_Cannot_Be_Supported")
+ "!", Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE);
MutilTempalteTabPane.this.repaint();
return;

6
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -1481,10 +1481,8 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
editingFILE = fileChooser.getSelectedFILE();
}
// 在保存之前,初始化 templateID
if (StringUtils.isEmpty(this.template.getTemplateID())) {
generateTemplateId();
}
//收集和生成templateID 因为是另存为操作 无论怎么样都需要重新生成templateID
initForCollect();
FILE finalEditingFILE = editingFILE;
CallbackSaveWorker worker = new CallbackSaveWorker(new Callable<Boolean>() {

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.Parameter;
import com.fr.base.extension.FileExtension;
import com.fr.base.iofile.attr.ExtendSharableAttrMark;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
@ -64,6 +65,11 @@ import com.fr.file.filter.ChooseFileFilter;
import com.fr.form.FormElementCaseContainerProvider;
import com.fr.form.FormElementCaseProvider;
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.container.WBorderLayout;
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.Constants;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.web.controller.ViewRequestConstants;
@ -96,6 +103,7 @@ import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
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) {
// 在 delete 之前,会先 select 父组件。这里直接传入 lastAffectedCreator 就好了
setPropertyPaneChange(lastAffectedCreator);
refreshSharableWidgetTableDataTree((XCreator) lastAffectedCreator);
} else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) {
lastAffectedCreator = evt.getAffectedCreator();
setPropertyPaneChange(lastAffectedCreator);
@ -1038,4 +1047,35 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
// richer:form文件 daniel 改成三个字
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.mainframe.DesignerContext;
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.ui.base.PopupMenuItem;
import com.fr.design.mainframe.share.ui.widgetfilter.LocalWidgetFilter;
@ -49,6 +50,7 @@ class GroupPane extends JPanel {
//是否展开
private boolean expendStatus;
private SharableWidgetProvider[] elCaseBindInfoList;
private SortType sortType = WidgetSortType.INSTALL_TIME;
private GroupPane(Group group) {
this(group, DEFAULT_HEIGHT, group.isDefaultExpend());
@ -133,11 +135,12 @@ class GroupPane extends JPanel {
if (widgetProviders == null) {
widgetProviders = new SharableWidgetProvider[0];
}
WidgetSortType.INSTALL_TIME.sort(widgetProviders);
sortType.sort(widgetProviders);
return widgetProviders;
}
public void sortWidget(WidgetSortType sortType) {
this.sortType = sortType;
sortType.sort(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 {
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 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 {
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_HEIGHT = 21;
private static final int NAME_MAX_LENGTH = 50;

Loading…
Cancel
Save