Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to access selected elements in Tree view #49511

Closed
sandy081 opened this issue May 9, 2018 · 8 comments
Closed

Ability to access selected elements in Tree view #49511

sandy081 opened this issue May 9, 2018 · 8 comments
Assignees
Labels
api tree-views Extension tree view issues verified Verification succeeded
Milestone

Comments

@sandy081
Copy link
Member

sandy081 commented May 9, 2018

Provide an API in Treeview to get selected elements

@sandy081 sandy081 self-assigned this May 9, 2018
@sandy081 sandy081 added this to the May 2018 milestone May 9, 2018
@sandy081 sandy081 added api tree-views Extension tree view issues labels May 9, 2018
@sandy081
Copy link
Member Author

@chrisdias It seems you are asking for this requirement. I would like to know what is the use case behind it and also is it enough to get access to selected elements or you also need a selection change event?

sandy081 added a commit that referenced this issue May 15, 2018
@chrisdias
Copy link
Member

The simple case would be something like this. i want to add a "delete" button to the Docker explorer which would delete/remove a single image. I need to be able to get the selected item in the tree when clicking on the "X" command in the explorer title bar area.

image

Selection change is not necessary in this scenario, but I could see how that might be interesting.

Another scenario is the Azure App Service/Functions extension where you want to be able to select an app service, then click on the "deploy" action and deploy to that service. That way, you don't have to ask the user a bunch of questions on where to deploy to.

//cc: @fiveisprime

@sandy081
Copy link
Member Author

sandy081 commented May 16, 2018

Thanks @chrisdias. Got it. I would expose getSelectedElements api for now. Change event will be added if needed.

@DanTup
Copy link
Contributor

DanTup commented May 16, 2018

@sandy081 If we can add icons to the toolbar(?) as shown in the screenshot above, a change event might address the issues I'd originally asked about dynamic context menus for - we could hook the change event and toggle some contexts, and apply those contexts to the actions on that toolbar? :)

@sandy081
Copy link
Member Author

@DanTup not sure what you mean... I remember about the dynamic context menu issue but do not understand your comment related to it.

Can you please add your comment in the issue related to dynamic context menu if it is nothing to do with this issue so that this will not get distracted.

Thanks

@sandy081
Copy link
Member Author

Added selections api to TreeView

/**
 * Currently selected elements.
*/
readonly selection: ReadonlyArray<T>;

@DanTup
Copy link
Contributor

DanTup commented May 17, 2018

@sandy081 Sorry for the confusion; you asked above whether a change event was required. My comment was that if you do add a change event, it may solve the issue I had that I wanted the dynamic context menu for in a better way.

So, my comment is basically a request for the change event :-)

@sandy081
Copy link
Member Author

Commented in the issue related to dynamic menus. Lets discuss over there.

@sandy081 sandy081 mentioned this issue May 28, 2018
2 tasks
@roblourens roblourens added the verified Verification succeeded label May 31, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api tree-views Extension tree view issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants