-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
087359b
commit aaca245
Showing
15 changed files
with
443 additions
and
55 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as vscode from "vscode"; | ||
|
||
import { DirectoryController } from "./directoryController"; | ||
import { AddonTreeDataProvider, AddonTreeItem } from "../model/sidebarTreeDataProvider"; | ||
|
||
export class SidebarController { | ||
public refresh: () => void; | ||
public treeView: vscode.TreeView<vscode.TreeItem>; | ||
|
||
constructor(public id: string, rootFolderPath: string) { | ||
const treeProvider = new AddonTreeDataProvider(rootFolderPath); | ||
|
||
this.refresh = () => { | ||
treeProvider.refresh(); | ||
}; | ||
|
||
this.treeView = vscode.window.createTreeView(this.id, { | ||
treeDataProvider: treeProvider, | ||
canSelectMany: true, | ||
}); | ||
} | ||
|
||
/** | ||
* Deletes the selected uris and refreshes the sidebar. | ||
* @param treeItem The specific AddonTreeItem the user opened the context menu on. | ||
* @param list Selected AddonTreeItems | ||
* @returns whether all were successfully deleted. | ||
*/ | ||
async delete(treeItem: AddonTreeItem, list: AddonTreeItem[] | undefined) { | ||
list = list || [treeItem]; | ||
const result = await DirectoryController.deleteUri(list); | ||
this.refresh(); | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.