Browse Source

修改一下写法

release/11.0
roger 2 years ago
parent
commit
716209f890
  1. 10
      designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java
  2. 2
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

10
designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java

@ -230,11 +230,13 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
} }
//确定目标目录并检查权限 //确定目标目录并检查权限
FileOperations selectedOperation = DesignerFrameFileDealerPane.getInstance().getSelectedOperation(); FileOperations selectedOperation = DesignerFrameFileDealerPane.getInstance().getSelectedOperation();
//没有选中目标目录时粘贴,允许超管往根目录粘贴 boolean rootAuthority = true;
if (selectedOperation.getFileNode() == null && WorkContext.getCurrent().isRoot()) { if (selectedOperation.getFileNode() == null && selectedOperation instanceof TemplateTreePane) {
return true; //没有选中文件节点时,默认粘贴到根目录下,所以直接检测根目录是否有权限
ExpandMutableTreeNode root = (ExpandMutableTreeNode) ((TemplateTreePane) selectedOperation).getTemplateFileTree().getModel().getRoot();
rootAuthority = root.hasFullAuthority();
} }
if (!selectedOperation.access()) { if (!rootAuthority && !selectedOperation.access()) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied"), Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied"),
Toolkit.i18nText("Fine-Design_Basic_Alert"), Toolkit.i18nText("Fine-Design_Basic_Alert"),

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

@ -311,7 +311,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
} }
reportletsTree.refreshParent(Objects.requireNonNull(reportletsTree.getSelectionPath())); reportletsTree.refreshParent(Objects.requireNonNull(reportletsTree.getSelectionPath()));
DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(null); DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(null);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_File_Tree_Refresh_Successfully") + "!"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_File_Tree_Refresh_Successfully"));
} }

Loading…
Cancel
Save