Browse Source

Merge pull request #5793 in DESIGN/design from release/10.0 to bugfix/10.0

* commit 'f5c607ac957fdcad1aa46c41b21bb8a8934de6cf':
  REPORT-57898 【权限编辑】进入权限编辑时打开frm/大屏模板/版本管理,再回到原模板,无法退出权限编辑状态
  REPORT-57898 【权限编辑】进入权限编辑时打开frm/大屏模板/版本管理,再回到原模板,无法退出权限编辑状态
  REPORT-57898 【权限编辑】进入权限编辑时打开frm/大屏模板/版本管理,再回到原模板,无法退出权限编辑状态
  REPORT-58207 系统原生文件选择器弹窗-mac插入图片弹窗时会出现文件选择器弹窗被遮盖的情况
  REPORT-58207 系统原生文件选择器弹窗-mac插入图片弹窗时会出现文件选择器弹窗被遮盖的情况
  REPORT-59063 CRM 内存里报表块缩略图占用内存太大了
bugfix/10.0
superman 3 years ago
parent
commit
6f2cd79881
  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. 7
      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. 13
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  6. 35
      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; private static DesignerMode mode = DesignerMode.NORMAL;
public static void switchTo(DesignerMode mode) { 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() { 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; package com.fr.design.base.mode;
import com.fr.design.mainframe.DesignerContext;
public enum DesignerMode { public enum DesignerMode {
NORMAL, NORMAL,
BAN_COPY_AND_CUT, BAN_COPY_AND_CUT,
VCS, VCS,
AUTHORITY, AUTHORITY {
DUCHAMP @Override
public void closeMode() {
DesignerContext.getDesignerFrame().closeAuthorityMode();
}
},
DUCHAMP;
public void openMode() {
}
public void closeMode() {
}
} }

7
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.base.io.BaseBook;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.base.mode.DesignerMode;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.file.filter.ClassFilter; import com.fr.design.file.filter.ClassFilter;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -69,7 +70,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
DesignTableDataManager.closeTemplate(selected); DesignTableDataManager.closeTemplate(selected);
//直接关闭模板的时候(当且仅当设计器tab上只剩一个模板)退出权限编辑 //直接关闭模板的时候(当且仅当设计器tab上只剩一个模板)退出权限编辑
if (DesignModeContext.isAuthorityEditing() && historyList.size() <= 1) { if (DesignModeContext.isAuthorityEditing() && historyList.size() <= 1) {
DesignerContext.getDesignerFrame().closeAuthorityEditing(); DesignModeContext.switchTo(DesignerMode.NORMAL);
} }
if (contains(selected) == -1) { if (contains(selected) == -1) {
return; return;
@ -430,13 +431,13 @@ public class HistoryTemplateListCache implements CallbackEvent {
*/ */
@Deprecated @Deprecated
public void reloadCurrentTemplate() { public void reloadCurrentTemplate() {
reloadAllEditingTemplate(); reloadAllEditingTemplate();
} }
/** /**
* 重绘当前模板 * 重绘当前模板
*/ */
public void repaintCurrentEditingTemplate(){ public void repaintCurrentEditingTemplate() {
UIUtil.invokeLaterIfNeeded(new Runnable() { UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override @Override
public void run() { public void run() {

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(); fileChooserParent = DesignerContext.getDesignerFrame();
} }
Stage stage = showCoverStage(fileChooserParent); Stage stage = showCoverStage(fileChooserParent);
if (stage != null) {
stage.setAlwaysOnTop(true);
}
try { try {
if (fileSelectionMode == FileSelectionMode.FILE || fileSelectionMode == FileSelectionMode.MULTIPLE_FILE) { if (fileSelectionMode == FileSelectionMode.FILE || fileSelectionMode == FileSelectionMode.MULTIPLE_FILE) {
FileChooser fileChooser = new FileChooser(); FileChooser fileChooser = new FileChooser();

13
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.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.base.mode.DesignerMode;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.TableDataTreePane;
@ -219,7 +220,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
@Override @Override
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
if (DesignModeContext.isAuthorityEditing()) { if (DesignModeContext.isAuthorityEditing()) {
closeAuthorityEditing(); DesignModeContext.switchTo(DesignerMode.NORMAL);
} }
} }
@ -299,8 +300,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().doResize(); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().doResize();
} }
@Deprecated
public void closeAuthorityEditing() { public void closeAuthorityEditing() {
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL); DesignModeContext.switchTo(DesignerMode.NORMAL);
}
public void closeAuthorityMode() {
WestRegionContainerPane.getInstance().replaceDownPane( WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
@ -312,6 +317,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
EventDispatcher.fire(DesignAuthorityEventType.StopEdit, DesignerFrame.this); EventDispatcher.fire(DesignAuthorityEventType.StopEdit, DesignerFrame.this);
} }
/** /**
* 注册app. * 注册app.
* *
@ -796,6 +802,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* @param jt 添加的模板. * @param jt 添加的模板.
*/ */
public void addAndActivateJTemplate(JTemplate<?, ?> jt) { public void addAndActivateJTemplate(JTemplate<?, ?> jt) {
DesignModeContext.switchTo(DesignerMode.NORMAL);
JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (currentEditingTemplate != null) { if (currentEditingTemplate != null) {
currentEditingTemplate.stopEditing(); currentEditingTemplate.stopEditing();
@ -1038,7 +1045,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt != null) { if (jt != null) {
DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath()); DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath());
} }

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

@ -18,21 +18,22 @@ import java.util.Map;
*/ */
public class RolesEditedSourceOP extends RoleSourceOP { public class RolesEditedSourceOP extends RoleSourceOP {
protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map<String, RoleDataWrapper> map) { protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map<String, RoleDataWrapper> map) {
List<ExpandMutableTreeNode> roleList = new ArrayList<ExpandMutableTreeNode>(); List<ExpandMutableTreeNode> roleList = new ArrayList<ExpandMutableTreeNode>();
Iterator<Map.Entry<String, RoleDataWrapper>> entryIt = map.entrySet().iterator(); Iterator<Map.Entry<String, RoleDataWrapper>> entryIt = map.entrySet().iterator();
while (entryIt.hasNext()) { while (entryIt.hasNext()) {
Map.Entry<String, RoleDataWrapper> entry = entryIt.next(); Map.Entry<String, RoleDataWrapper> entry = entryIt.next();
RoleDataWrapper t = entry.getValue(); RoleDataWrapper t = entry.getValue();
JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget(); if (jt.getTarget() instanceof PrivilegeEditedRoleProvider) {
PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget();
ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet())); ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet()));
for (ExpandMutableTreeNode expandMutableTreeNode : expand) { for (ExpandMutableTreeNode expandMutableTreeNode : expand) {
roleList.add(expandMutableTreeNode); roleList.add(expandMutableTreeNode);
} }
} }
return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); }
} 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.form.ui.container.WBorderLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; 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.Constants;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -90,13 +92,16 @@ class FormApp extends AbstractAppProvider {
@Nullable @Nullable
private Form getForm(FILE tplFile) { private Form getForm(FILE tplFile) {
ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN);
Form form = asIOFile(tplFile); Form form = asIOFile(tplFile);
ReadXmlTypeLocalManager.remove();
if (form != null) { if (form != null) {
DesignerAppUtils.dealWithTemplateIOError(tplFile.getPath()); DesignerAppUtils.dealWithTemplateIOError(tplFile.getPath());
} }
return form; return form;
} }
@Override @Override
public Form asIOFile(FILE file) { public Form asIOFile(FILE file) {

Loading…
Cancel
Save