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

Give React tab toolbar items access to the current widget instance #6220

Merged
merged 1 commit into from
Sep 21, 2019
Merged

Give React tab toolbar items access to the current widget instance #6220

merged 1 commit into from
Sep 21, 2019

Conversation

mcgordonite
Copy link
Contributor

What it does

This PR passes the current widget to the render method of React tab bar toolbar items.

This allows extension authors to create toolbar items that show content specific to the current widget instance. This is useful when there can be more instance of a Widget class at a time. For example, a toolbar item for the terminal could show a message specific to the currently displayed terminal tab.

This change brings the signature for render in to line with isVisible: https://github.com/eclipse-theia/theia/blob/master/packages/core/src/browser/shell/tab-bar-toolbar.tsx#L297.

How to test

Add a tab toolbar item with a render method that uses the input widget. Test that the item content changes appropriately as different widgets are selected.

See https://github.com/mcgordonite/theia/commit/d713b49d977a5835ca55c00acd489e449100881b.

Review checklist

Reminder for reviewers

Copy link
Contributor

@svenefftinge svenefftinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

packages/core/src/browser/shell/tab-bar-toolbar.tsx Outdated Show resolved Hide resolved
@akosyakov akosyakov added the toolbar issues related to the toolbar label Sep 20, 2019
This allows toolbar items to show content specific to the current
widget. For example, a toolbar item for the terminal could show
a message specific to the currently displayed terminal tab.

Signed-off-by: Matthew Gordon <[email protected]>
@mcgordonite
Copy link
Contributor Author

@svenefftinge thanks for the review, I've updated as you suggested.

@akosyakov akosyakov merged commit 7ac9925 into eclipse-theia:master Sep 21, 2019
@mcgordonite mcgordonite deleted the per-widget-toolbar-items branch September 26, 2019 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolbar issues related to the toolbar
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants