Skip to content

Commit

Permalink
fix issue #37: command open server.xml shows when no server
Browse files Browse the repository at this point in the history
  • Loading branch information
Qingqing Sun committed Jan 5, 2018
1 parent f391403 commit 66b9a61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"view/item/context": [
{
"command": "tomcat.start",
"when": "view == tomcatServerExplorer && viewItem == tomcatserver"
"when": "view == tomcatServerExplorer && viewItem == idleserver"
},
{
"command": "tomcat.stop",
Expand All @@ -119,11 +119,15 @@
},
{
"command": "tomcat.delete",
"when": "view == tomcatServerExplorer && viewItem == tomcatserver"
"when": "view == tomcatServerExplorer && viewItem == idleserver"
},
{
"command": "tomcat.openconfig",
"when": "view == tomcatServerExplorer"
"when": "view == tomcatServerExplorer && viewItem == idleserver"
},
{
"command": "tomcat.openconfig",
"when": "view == tomcatServerExplorer && viewItem == runningserver"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/TomcatServerTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Tomcat } from "./Tomcat/Tomcat";
import { TomcatServer } from "./Tomcat/TomcatServer";

export class TomcatTreeItem implements vscode.TreeItem {
private static readonly SERVER: string = 'tomcatserver';
private static readonly IDLE: string = 'idleserver';
private static readonly RUNNING: string = 'runningserver';
public readonly _tomcatServer: TomcatServer;
private _context: vscode.ExtensionContext;
Expand All @@ -27,7 +27,7 @@ export class TomcatTreeItem implements vscode.TreeItem {
if (this._tomcatServer.isStarted()) {
return TomcatTreeItem.RUNNING;
} else {
return TomcatTreeItem.SERVER;
return TomcatTreeItem.IDLE;
}
}

Expand Down

0 comments on commit 66b9a61

Please sign in to comment.