question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow TreeItems to have optional checkboxes

See original GitHub issue

I’m all for trying to avoid webviews as much as possible, especially when tree views are hard to make work in a webview. This proposal allows for treeviews to have checkboxes:

image (but better styling of course 😄)

Scenarios

  • To-do list extensions
  • Applying filters where an ‘Edit’ button drops you into the experience above where checkboxes show up
  • Crafting .gitignore’s or other ‘ignores’ where you go down the filesystem and uncheck the files you want to ignore

Proposal

  • TreeItem has new optional property called checkboxState similar to collapsibleState which takes in a TreeItemCheckBoxState:
        export class TreeItem {
            // ...

            /**
             * [TreeItemCheckboxState](#TreeItemCheckboxState) of the tree item.
             */
            checkboxState?: TreeItemCheckboxState;

            // ...
        }

       /**
	 * Checkbox state of the tree item
	 */
        export enum TreeItemCheckboxState{
		/**
		 * Determines an item can be neither checked nor unchecked. Implies it has no checkbox.
		 */
		None = 0,
		/**
		 * Determines an item is checked
		 */
		Checked = 1,
		/**
		 * Determines an item is unchecked
		 */
		Unchecked = 2
	}

  • TreeDataProvider will have a new optional event onDidChangeTreeCheckbox which will fire when the checkbox of a TreeItem is checked or unchecked:
        /**
	 * A data provider that provides tree data
	 */
	export interface TreeDataProvider<T> {
                // ...

                /**
		 * An optional event to signal that an element or root has either been checked or unchecked.
		 */
		onDidChangeTreeCheckbox?: Event<ChangeTreeCheckboxEvent<T>>;

                // ...
        }

        export interface ChangeTreeCheckboxEvent {
                /**
		 * The item that was checked or unchecked.
		 */
		readonly item: <T>;

		/**
		 * Removed workspace folders.
		 */
		readonly newState: TreeItemCheckboxState;
        }

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:31
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jriekencommented, Sep 15, 2022

API-review: onDidChangeTreeCheckbox should become onDidChangeCheckboxState

2reactions
alexr00commented, Aug 2, 2022

You should see this appear on our August iteration plan 😃. We’ll start looking into it then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaFX: CheckBoxTreeItem item not selected when checked
1) Selecting the TreeItem does not change the selected state of the CheckBox. · 2) I have created a ChangeListener that listens to...
Read more >
How to only let the child nodes can be checked in UI for WPF
As we know, The treeview control enables check boxes for all nodes. Is it possible to show the check boxes for sepecific nodes?...
Read more >
ARIA: treeitem role - Accessibility - MDN Web Docs - Mozilla
A treeitem that is not a parent is an end node. Tree items that have children can be expanded or collapsed, showing and...
Read more >
Apex 18.1 using Checkboxes in a tree - Oracle Communities
I have a question about the new tree region (with Checkboxes) in Apex 18.1 : ... treeView("option","multiple", true) // make the tree support...
Read more >
Add Checkbox Selection to APEX Tree Region
Hopefully you have already converted to the APEX Tree implementation. ... The treeView widget has an option to enable multiple selection.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found