Browse Source

Pull request #11328: REPORT-87542 复制模板,点击刷新按钮,触发粘贴,会提示没有权限

Merge in DESIGN/design from ~ROGER.CHEN/design:release/11.0 to release/11.0

* commit '3d1f91ff08cc5ee2c87def249d46f0fdff3af20a':
  修改一下写法
  REPORT-87542 复制模板,点击刷新按钮,触发粘贴,会提示没有权限
release/11.0
Roger.Chen-陈旺 2 years ago
parent
commit
d20c1ae205
  1. 9
      designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java
  2. 3
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

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

@ -28,6 +28,7 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.CollectionUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
@ -229,7 +230,13 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
}
//确定目标目录并检查权限
FileOperations selectedOperation = DesignerFrameFileDealerPane.getInstance().getSelectedOperation();
if (!selectedOperation.access()) {
boolean rootAuthority = true;
if (selectedOperation.getFileNode() == null && selectedOperation instanceof TemplateTreePane) {
//没有选中文件节点时,默认粘贴到根目录下,所以直接检测根目录是否有权限
ExpandMutableTreeNode root = (ExpandMutableTreeNode) ((TemplateTreePane) selectedOperation).getTemplateFileTree().getModel().getRoot();
rootAuthority = root.hasFullAuthority();
}
if (!rootAuthority && !selectedOperation.access()) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied"),
Toolkit.i18nText("Fine-Design_Basic_Alert"),

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

@ -307,10 +307,11 @@ public class TemplateTreePane extends JPanel implements FileOperations {
if (reportletsTree.getSelectionCount() == 0) {
//没选中文件刷新根目录
reportletsTree.refresh();
return;
}
reportletsTree.refreshParent(Objects.requireNonNull(reportletsTree.getSelectionPath()));
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