Browse Source

REPORT-61048 远程服务器文件没有权限处理

bugfix/11.0
kuangshuai 3 years ago
parent
commit
324db838df
  1. 15
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java
  2. 7
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java
  3. 5
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java
  4. 11
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java

15
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java

@ -163,7 +163,11 @@ public class GuideCreateUtils {
InputStream inputStream = GuideCreateUtils.class.getResourceAsStream(StableUtils.pathJoin(sourcePath, fileName + suffix));
byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream);
WorkContext.getWorkResource().write(fileWorkPath, data);
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(fileWorkPath, false)));
FileNodeFILE fileNodeFILE= new FileNodeFILE(new FileNode(fileWorkPath, false));
if (!fileNodeFILE.exists()) {
return null;
}
DesignerContext.getDesignerFrame().openTemplate(fileNodeFILE);
return fileWorkPath;
}
@ -200,6 +204,15 @@ public class GuideCreateUtils {
JOptionPane.WARNING_MESSAGE);
}
public static void showNoFileAuthAlert() {
FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Warning_Template_Do_Not_Exsit"),
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
JOptionPane.INFORMATION_MESSAGE
);
}
public static JDialog showConfirmDialog(Window parent, Object message,
String title, int optionType) {
JOptionPane pane = new JOptionPane(message, JOptionPane.QUESTION_MESSAGE, optionType, null, FineJOptionPane.OPTION_OK_CANCEL, FineJOptionPane.OPTION_OK_CANCEL[0]);

7
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java

@ -11,6 +11,7 @@ import com.fr.design.mainframe.guide.GuideIds;
import com.fr.design.mainframe.guide.base.Guide;
import com.fr.design.mainframe.guide.base.GuideBuilder;
import com.fr.design.mainframe.guide.base.GuideLifecycleAdaptor;
import com.fr.design.mainframe.guide.base.GuideManager;
import com.fr.design.mainframe.guide.creator.GuideCreateUtils;
import com.fr.design.mainframe.guide.creator.GuideSceneHelper;
import com.fr.design.mainframe.guide.scene.ClickScene;
@ -21,7 +22,6 @@ import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
import com.fr.design.mainframe.guide.tip.GuideTip;
import com.fr.design.utils.ComponentUtils;
import javax.swing.SwingUtilities;
import java.awt.Point;
import java.awt.Rectangle;
@ -50,6 +50,11 @@ public class ChangeLayoutComponentGuide {
@Override
public boolean prepared() {
filePath = GuideCreateUtils.openGuideFile("/com/fr/report/guide/template", "layout_recommend", ".frm");
if (filePath == null) {
GuideCreateUtils.showNoFileAuthAlert();
GuideManager.getInstance().getCurrentGuide().terminate();
return false;
}
return true;
}

5
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java

@ -94,6 +94,11 @@ public class DownloadComponentPackageGuide {
boolean loadWidgetSuccess = OnlineWidgetRepoPane.loadWidgets();
if (loadWidgetSuccess) {
filePath = GuideCreateUtils.openGuideFile("/com/fr/report/guide/template", "layout_recommend", ".frm");
if (filePath == null) {
GuideCreateUtils.showNoFileAuthAlert();
GuideManager.getInstance().getCurrentGuide().terminate();
return false;
}
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
OnlineWidgetRepoPane onlineWidgetRepoPane = OnlineWidgetRepoPane.getInstance();
OnlineWidgetTabPane tabPane = (OnlineWidgetTabPane) ComponentUtils.findComponentByClass(onlineWidgetRepoPane, OnlineWidgetTabPane.class);

11
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java

@ -78,9 +78,14 @@ public class ThemeToggleGuide {
themeLoadCount--;
if (themeLoadCount == 0) {
filePath = GuideCreateUtils.openGuideFile("/com/fr/report/guide/template", "toggle_theme", ".frm");
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
asyncThemeFetcher.shutdown();
GuideManager.getInstance().getCurrentGuide().start();
if (filePath == null) {
GuideCreateUtils.showNoFileAuthAlert();
GuideManager.getInstance().getCurrentGuide().terminate();
} else {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
asyncThemeFetcher.shutdown();
GuideManager.getInstance().getCurrentGuide().start();
}
}
}
});

Loading…
Cancel
Save