Browse Source
Merge in DESIGN/design from ~STARRYI/design:feature/x to feature/x * commit '7b9663bcb761f55af191ed37a970a4c561a5f816': REPORT-64406 直接通过点击模板文件启动设计器feature/x
starryi
3 years ago
3 changed files with 51 additions and 1 deletions
@ -0,0 +1,29 @@ |
|||||||
|
package com.fr.design.deeplink; |
||||||
|
|
||||||
|
import com.fr.design.mainframe.DesignerContext; |
||||||
|
import com.fr.file.FileFILE; |
||||||
|
import com.fr.stable.StringUtils; |
||||||
|
import com.fr.stable.os.OperatingSystem; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Starryi |
||||||
|
* @version 1.0 |
||||||
|
* Created by Starryi on 2022/1/13 |
||||||
|
*/ |
||||||
|
public class FileOpen4MacDeepLink extends DeepLink { |
||||||
|
@Override |
||||||
|
public boolean accept(String url, String host, String path, Map<String, Object> params) { |
||||||
|
return OperatingSystem.isMacos() && StringUtils.isEmpty(host) && StringUtils.isEmpty(path) && params.isEmpty(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void run(String url, String host, String path, Map<String, Object> params) { |
||||||
|
File file = new File(url); |
||||||
|
if (file.exists()) { |
||||||
|
DesignerContext.getDesignerFrame().openTemplate(new FileFILE(file)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue