Browse Source

Merge pull request #5795 in DESIGN/design from release/10.0 to release/11.0

* commit 'f5c607ac957fdcad1aa46c41b21bb8a8934de6cf':
  REPORT-57898 【权限编辑】进入权限编辑时打开frm/大屏模板/版本管理,再回到原模板,无法退出权限编辑状态
  REPORT-57898 【权限编辑】进入权限编辑时打开frm/大屏模板/版本管理,再回到原模板,无法退出权限编辑状态
  REPORT-57898 【权限编辑】进入权限编辑时打开frm/大屏模板/版本管理,再回到原模板,无法退出权限编辑状态
  REPORT-58207 系统原生文件选择器弹窗-mac插入图片弹窗时会出现文件选择器弹窗被遮盖的情况
  REPORT-58207 系统原生文件选择器弹窗-mac插入图片弹窗时会出现文件选择器弹窗被遮盖的情况
  REPORT-59063 CRM 内存里报表块缩略图占用内存太大了
persist/11.0
superman 3 years ago
parent
commit
9244cdb266
  1. 10
      designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java
  2. 20
      designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java
  3. 3
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  4. 3
      designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java
  5. 11
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  6. 3
      designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java
  7. 5
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

10
designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java

@ -10,7 +10,15 @@ public class DesignModeContext {
private static DesignerMode mode = DesignerMode.NORMAL;
public static void switchTo(DesignerMode mode) {
DesignModeContext.mode = mode;
changeMode(DesignModeContext.mode, mode);
}
private static void changeMode(DesignerMode oldMode, DesignerMode newMode) {
if (oldMode != newMode) {
DesignModeContext.mode = newMode;
oldMode.closeMode();
newMode.openMode();
}
}
public static DesignerMode getMode() {

20
designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java

@ -1,9 +1,25 @@
package com.fr.design.base.mode;
import com.fr.design.mainframe.DesignerContext;
public enum DesignerMode {
NORMAL,
BAN_COPY_AND_CUT,
VCS,
AUTHORITY,
DUCHAMP
AUTHORITY {
@Override
public void closeMode() {
DesignerContext.getDesignerFrame().closeAuthorityMode();
}
},
DUCHAMP;
public void openMode() {
}
public void closeMode() {
}
}

3
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -4,6 +4,7 @@ import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.base.io.BaseBook;
import com.fr.design.DesignerEnvManager;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.base.mode.DesignerMode;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.file.filter.ClassFilter;
import com.fr.design.i18n.Toolkit;
@ -69,7 +70,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
DesignTableDataManager.closeTemplate(selected);
//直接关闭模板的时候(当且仅当设计器tab上只剩一个模板)退出权限编辑
if (DesignModeContext.isAuthorityEditing() && historyList.size() <= 1) {
DesignerContext.getDesignerFrame().closeAuthorityEditing();
DesignModeContext.switchTo(DesignerMode.NORMAL);
}
if (contains(selected) == -1) {
return;

3
designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java

@ -67,6 +67,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
fileChooserParent = DesignerContext.getDesignerFrame();
}
Stage stage = showCoverStage(fileChooserParent);
if (stage != null) {
stage.setAlwaysOnTop(true);
}
try {
if (fileSelectionMode == FileSelectionMode.FILE || fileSelectionMode == FileSelectionMode.MULTIPLE_FILE) {
FileChooser fileChooser = new FileChooser();

11
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -9,6 +9,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.base.mode.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
@ -221,7 +222,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
@Override
public void mouseReleased(MouseEvent e) {
if (DesignModeContext.isAuthorityEditing()) {
closeAuthorityEditing();
DesignModeContext.switchTo(DesignerMode.NORMAL);
}
}
@ -301,8 +302,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().doResize();
}
@Deprecated
public void closeAuthorityEditing() {
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL);
DesignModeContext.switchTo(DesignerMode.NORMAL);
}
public void closeAuthorityMode() {
WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
@ -314,6 +319,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
EventDispatcher.fire(DesignAuthorityEventType.StopEdit, DesignerFrame.this);
}
/**
* 注册app.
*
@ -793,6 +799,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* @param jt 添加的模板.
*/
public void addAndActivateJTemplate(JTemplate<?, ?> jt) {
DesignModeContext.switchTo(DesignerMode.NORMAL);
JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (currentEditingTemplate != null) {
currentEditingTemplate.stopEditing();

3
designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java

@ -26,13 +26,14 @@ public class RolesEditedSourceOP extends RoleSourceOP {
RoleDataWrapper t = entry.getValue();
JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt.getTarget() instanceof PrivilegeEditedRoleProvider) {
PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget();
ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet()));
for (ExpandMutableTreeNode expandMutableTreeNode : expand) {
roleList.add(expandMutableTreeNode);
}
}
}
return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]);
}
}

5
designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

@ -21,6 +21,8 @@ import com.fr.form.main.Form;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.report.util.ReadXmlType;
import com.fr.report.util.ReadXmlTypeLocalManager;
import com.fr.stable.Constants;
import com.fr.stable.bridge.StableFactory;
import org.jetbrains.annotations.Nullable;
@ -90,13 +92,16 @@ class FormApp extends AbstractAppProvider {
@Nullable
private Form getForm(FILE tplFile) {
ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN);
Form form = asIOFile(tplFile);
ReadXmlTypeLocalManager.remove();
if (form != null) {
DesignerAppUtils.dealWithTemplateIOError(tplFile.getPath());
}
return form;
}
@Override
public Form asIOFile(FILE file) {

Loading…
Cancel
Save