Skip to content

Commit

Permalink
UI Support for add/remove libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Vigilans committed Nov 19, 2019
1 parent 4bcf012 commit 55cd56c
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 5 deletions.
3 changes: 3 additions & 0 deletions images/dark/icon-add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/dark/icon-remove.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/light/icon-add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/light/icon-remove.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 50 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@
"title": "%contributes.commands.java.project.create%",
"category": "Java"
},
{
"command": "java.project.addLibraries",
"title": "%contributes.commands.java.project.addLibraries%",
"category": "Java",
"icon": {
"dark": "images/dark/icon-add.svg",
"light": "images/light/icon-add.svg"
}
},
{
"command": "java.project.removeLibrary",
"title": "%contributes.commands.java.project.removeLibrary%",
"category": "Java",
"icon": {
"dark": "images/dark/icon-remove.svg",
"light": "images/light/icon-remove.svg"
}
},
{
"command": "java.view.package.refresh",
"title": "%contributes.commands.java.view.package.refresh%",
Expand Down Expand Up @@ -117,10 +135,27 @@
],
"description": "%configuration.java.dependency.packagePresentation%",
"default": "flat"
},
"java.dependency.referencedLibraries": {
"type": [
"array",
"object"
],
"default": [
"lib/*.jar"
],
"description": "%configuration.java.dependency.referencedLibraries%",
"scope": "window"
}
}
},
"menus": {
"commandPalette": [
{
"command": "java.project.removeLibrary",
"when": "never"
}
],
"view/title": [
{
"command": "java.view.package.refresh",
Expand All @@ -147,6 +182,18 @@
"when": "view == javaDependencyExplorer && config.java.dependency.syncWithFolderExplorer == true",
"group": "navigation@0"
}
],
"view/item/context": [
{
"command": "java.project.addLibraries",
"when": "view == javaDependencyExplorer",
"group": "inline"
},
{
"command": "java.project.removeLibrary",
"when": "view == javaDependencyExplorer",
"group": "inline"
}
]
},
"views": {
Expand Down Expand Up @@ -178,11 +225,11 @@
"@types/vscode": "1.30.0",
"@types/xml2js": "^0.4.3",
"cross-env": "^5.2.0",
"glob": "^7.1.4",
"gulp": "^4.0.0",
"gulp-copy": "^4.0.1",
"gulp-tslint": "^8.1.3",
"mocha": "^5.2.0",
"native-ext-loader": "^2.3.0",
"shelljs": "^0.8.3",
"ts-loader": "^5.3.1",
"tslint": "^5.11.0",
Expand All @@ -192,8 +239,10 @@
"webpack-cli": "^3.3.9"
},
"dependencies": {
"chokidar": "^3.3.0",
"find-java-home": "^0.2.0",
"fs-extra": "^7.0.1",
"glob": "^7.1.4",
"lodash": "^4.17.15",
"vscode-extension-telemetry-wrapper": "^0.4.0",
"xml2js": "^0.4.19"
Expand Down
7 changes: 5 additions & 2 deletions package.nls.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"description": "Manage Java Dependencies in VSCode",
"contributes.commands.java.project.create": "Create Java Project",
"contributes.commands.java.project.addLibraries": "Add a jar file or a folder to project library reference",
"contributes.commands.java.project.removeLibrary": "Remove jar file from project library reference",
"contributes.commands.java.view.package.refresh": "Refresh",
"contributes.commands.java.view.package.changeRepresentation": "Change package representation",
"contributes.commands.java.view.package.changeToFlatPackageView":"Change to flat package representation",
Expand All @@ -11,6 +13,7 @@
"configuration.java.dependency.showOutline": "Enable show outline in the Java Dependency explorer",
"configuration.java.dependency.syncWithFolderExplorer": "Synchronize dependency viewer selection with folder explorer",
"configuration.java.dependency.autoRefresh": "Synchronize dependency viewer with changes",
"configuration.java.dependency.refreshDelay": "The delay time (ms) the auto refresh is invoked when changes are detected.",
"configuration.java.dependency.packagePresentation": "Package presentation mode: flat or hierarchical"
"configuration.java.dependency.refreshDelay": "The delay time (ms) the auto refresh is invoked when changes are detected",
"configuration.java.dependency.packagePresentation": "Package presentation mode: flat or hierarchical",
"configuration.java.dependency.referencedLibraries": "Specify the local libraries referenced by Java project"
}
5 changes: 4 additions & 1 deletion package.nls.zh.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"description": "在 VSCode 中管理 Java 依赖项",
"contributes.commands.java.project.create": "创建 Java 项目",
"contributes.commands.java.project.addLibraries": "将一个 Jar 文件或一个目录添加到 Java 项目引用库",
"contributes.commands.java.project.removeLibrary": "将 Jar 文件从 Java 项目引用库移除",
"contributes.commands.java.view.package.refresh": "刷新",
"contributes.commands.java.view.package.changeRepresentation": "更改包展示形式",
"contributes.commands.java.view.package.changeToFlatPackageView":"将 Java 包显示方式切换为平行显示",
Expand All @@ -12,5 +14,6 @@
"configuration.java.dependency.syncWithFolderExplorer": "在 Java 依赖项资源管理器中同步关联当前打开的文件",
"configuration.java.dependency.autoRefresh": "在 Java 依赖项资源管理器中自动同步修改",
"configuration.java.dependency.refreshDelay": "控制Java 依赖项资源管理器刷新的延迟时间 (毫秒)。",
"configuration.java.dependency.packagePresentation": "Java 包显示方式: 平行显示或者分层显示"
"configuration.java.dependency.packagePresentation": "Java 包显示方式: 平行显示或者分层显示",
"configuration.java.dependency.referencedLibraries": "指定 Java 项目所使用的本地依赖库。"
}
5 changes: 4 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ const config = {
use: [{
loader: 'ts-loader',
}]
}, {
test: /\.node$/,
loader: 'native-ext-loader',
}]
},
}
module.exports = config;
module.exports = config;

0 comments on commit 55cd56c

Please sign in to comment.