2018-05-31 11:51:59 +02:00
|
|
|
# Views & View Containers
|
|
|
|
|
|
2018-10-25 18:28:48 +02:00
|
|
|
This sample demonstrates how to implement and contribute a tree view in VS Code. This includes:
|
|
|
|
|
|
|
|
|
|
- Contributing views and view containers.
|
|
|
|
|
- Contributing actions in various location of the view.
|
|
|
|
|
- Implementing the tree data provider for the view.
|
|
|
|
|
- Creating and working with the view.
|
|
|
|
|
|
|
|
|
|
This sample provides following views
|
2016-11-16 09:33:20 -08:00
|
|
|
|
2017-06-02 10:46:57 +02:00
|
|
|
- Node dependencies view
|
|
|
|
|
- Ftp file explorer view
|
2016-11-16 09:33:20 -08:00
|
|
|
|
2018-10-25 18:28:48 +02:00
|
|
|
Following example shows Node dependencies view in Package Explorer View container.
|
2018-05-31 11:51:59 +02:00
|
|
|
|
|
|
|
|

|
|
|
|
|
|
2018-10-25 18:28:48 +02:00
|
|
|
## VS Code API
|
|
|
|
|
|
|
|
|
|
This sample uses following contribution points, activation events and APIs
|
|
|
|
|
|
|
|
|
|
### Contribution Points
|
|
|
|
|
|
|
|
|
|
- `views`
|
2020-05-23 08:49:12 +01:00
|
|
|
- `viewsContainers`
|
2018-10-25 18:28:48 +02:00
|
|
|
- `menu`
|
2020-05-23 08:49:12 +01:00
|
|
|
- `view/title`
|
|
|
|
|
- `view/item/context`
|
2018-10-25 18:28:48 +02:00
|
|
|
|
|
|
|
|
### Activation Events
|
|
|
|
|
|
|
|
|
|
- `onView:${viewId}`
|
|
|
|
|
|
|
|
|
|
### APIs
|
|
|
|
|
|
|
|
|
|
- `window.createTreeView`
|
|
|
|
|
- `window.registerTreeDataProvider`
|
|
|
|
|
- `TreeView`
|
|
|
|
|
- `TreeDataProvider`
|
|
|
|
|
|
|
|
|
|
Refer to [Usage](./USAGE.md) document for more details.
|
|
|
|
|
|
|
|
|
|
## Running the Sample
|
2016-11-16 09:33:20 -08:00
|
|
|
|
2018-03-20 07:49:39 +00:00
|
|
|
- Open this example in VS Code Insiders
|
2016-11-16 09:33:20 -08:00
|
|
|
- `npm install`
|
2018-07-24 17:15:39 +02:00
|
|
|
- `npm run watch`
|
2016-11-18 10:05:32 -08:00
|
|
|
- `F5` to start debugging
|
2018-05-31 11:51:59 +02:00
|
|
|
- Node dependencies view is shown in Package explorer view container in Activity bar.
|
2020-05-23 08:49:12 +01:00
|
|
|
- FTP file explorer view should be shown in Explorer
|