SetApkPathAction.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:Dependency-Injection-Graph 作者:
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
    Project project = anActionEvent.getProject();
    if (project != null) {
        String currentApkPath = PropertiesManager.getData(project, PropertyKeys.APK_PATH);

        VirtualFile fileToSelectOnCreate =
                TextUtils.isEmpty(currentApkPath)
                        ? project.getBaseDir()
                        : LocalFileSystem.getInstance().findFileByPath(currentApkPath);

        VirtualFile apkFile = new FileChooserDialogManager.Builder(project, fileToSelectOnCreate)
                .setFileTypes(FileTypes.FILE)
                .setTitle(Strings.TITLE_ASK_APK_FILE)
                .setDescription(Strings.MESSAGE_ASK_APK_FILE)
                .withFileFilter("apk")
                .create()
                .getSelectedFile();

        if (apkFile != null) {
            PropertiesManager.putData(project, PropertyKeys.APK_PATH, apkFile.getPath());
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号