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

Jtable and JTabbedPane tooltips does not have "weblaf style" #202

Closed
Sorceror opened this issue Nov 15, 2014 · 11 comments
Closed

Jtable and JTabbedPane tooltips does not have "weblaf style" #202

Sorceror opened this issue Nov 15, 2014 · 11 comments
Assignees
Projects

Comments

@Sorceror
Copy link
Contributor

Tooltips for JTable headers/cells and JTabbedPane tabs does not look like as other WebLaF tooltips. Is that feature or issue? (maybe same problem as in #180 ??)
2014-11-15_23-03-47
2014-11-15_23-05-59

@mgarin
Copy link
Owner

mgarin commented Nov 15, 2014

It not that "does not look like as other WebLaF tooltips" - its more like "those common Swing tooltip look differently from custom WebLaF tooltips". But that is a limitation of common Swing tooltips styling and this is why I have introduced custom tooltips manager into WebLaF.

Unfortunately, custom tooltips cannot be set for those cases yet and for some others (tree/table/list renderers and such), but it will be possible with later updates. Some of those improvements are coming with v1.29.

@mgarin mgarin added this to the v1.30 milestone Nov 15, 2014
@mgarin mgarin self-assigned this Nov 15, 2014
@Sorceror
Copy link
Contributor Author

Thanks again for clarification and thumbs up for future updates! 👍

@mgarin
Copy link
Owner

mgarin commented Nov 15, 2014

Thanks :)
I was hoping to release v1.29 a week ago, but simply don't have any time at all. Hopefully will be able to work with it soon enough to complete last few features and improvements.

@Sciss
Copy link
Contributor

Sciss commented Nov 15, 2014

If I may comment, the white on black tool-tips are one of my favourite looks in web-laf, I think they look pretty slick.

@Sorceror
Copy link
Contributor Author

Sure, depends on project. Those ones particular are pure Swing ones..

@mgarin
Copy link
Owner

mgarin commented Aug 10, 2019

Possibly linked with #471

@mgarin mgarin removed this from Planned in v1.9.0 Aug 10, 2019
@mgarin mgarin added this to Planned in v1.2.10 via automation Aug 10, 2019
@mgarin mgarin modified the milestones: v1.3.0, v1.2.10 Aug 10, 2019
@mgarin
Copy link
Owner

mgarin commented Aug 10, 2019

Short list of planned tooltip changes: #520

@mgarin mgarin moved this from Planned to In progress in v1.2.10 Sep 19, 2019
mgarin added a commit that referenced this issue Sep 20, 2019
- ToolTipProvider.java, AbstractToolTipProvider.java - Improved custom tooltip API, added extra `null` checks
- ComponentArea.java - Added method for checking area availability at any given time
- TableToolTipProvider.java - Changed default direction to `up` as more sensible for common case

TabbedPane [ #202 ]
- TabbedPaneToolTipProvider.java, TabbedPaneCellArea.java - Custom tooltip provider for `JTabbedPane` and it's area settings
- WebTabbedPane.java - Added custom tooltip provider support that can be used instead of basic Swing tooltips
- WebTabbedPane.java - Tooltip provider can also be specified through `tooltipProvider` client property for `JTabbedPane` support
- WTabbedPaneUI.java - Added new listener for retrieving and displaying custom tooltips

Table [ #202 #471 ]
- TableHeaderToolTipProvider.java, TableHeaderCellArea.java - Custom tooltip provider for `JTableHeader` and it's area settings
- WebTable.java - Added custom tooltip provider support for header that can be used instead of basic Swing tooltips
- TableHeaderPainter.java - Added new listener for retrieving and displaying custom tooltips
- WebTable.java - Table header tooltip provider can also be specified through `headerTooltipProvider` client property for `JTable` support
- WebTable.java - Table tooltip provider can now be specified through `tooltipProvider` client property for `JTable` support
- TablePainter.java - Updated to retrieve custom tooltip provider from client properties

List
- WebList.java - Tooltip provider can now be specified through `tooltipProvider` client property for `JList` support
- WebListUI.java - Updated to retrieve custom tooltip provider from client properties

Tree
- WebTree.java - Tooltip provider can now be specified through `tooltipProvider` client property for `JTree` support
- WebTreeUI.java - Updated to retrieve custom tooltip provider from client properties

Utilities
- GeometryUtils.java - Added methods for retrieving non-`null` rectangle containing specified non-`null` rectangles

DemoApplication
- TabbedPaneTooltipExample.java - New example showing Swing and custom tabbed pane tooltips in action
- WebTableExample.java, WebListExample.java, WebTreeExample.java - Added new previews with custom tooltips
- TableTooltipExample.java, ListTooltipExample.java, TreeTooltipExample.java - Replaced `Web`-components with `J`-components
- demo-language.xml - Added multiple translations for new demo examples and updated some of the older ones
- ExamplesFrame.java - Removed pointless feature state legend, it will be coming back later in new light
- extension.xml - Disabled coloring for the different feature states until future improvements to avoid confusion
@mgarin
Copy link
Owner

mgarin commented Sep 20, 2019

Related improvements have been implemented and will be available in v1.2.10 update.

Shortly - now you're able to provide table header and tabbed pane custom tooltips in a similar way how it was possible in list, tree and table cells. There are some new related examples available in the the demo application.

Also all of the custom tooltip providers are now set through JComponent client properties, therefore they are available for common Swing components like JList, JTable etc.

Here is an example with two providers set in JTable:

final JTable table = new JTable ( ... );
table.putClientProperty ( WebTable.HEADER_TOOLTIP_PROVIDER_PROPERTY, new TableHeaderToolTipProvider<String> ()
{
    @Nullable
    @Override
    protected String getToolTipText ( @NotNull final JTableHeader tableHeader,
                                      @NotNull final TableHeaderCellArea<String, JTableHeader> area )
    {
        return "My header tooltip";
    }
} );
table.putClientProperty ( WebTable.TOOLTIP_PROVIDER_PROPERTY, new TableToolTipProvider<Object> ()
{
    @Nullable
    @Override
    protected String getToolTipText ( @NotNull final JTable table, 
                                      @NotNull final TableCellArea<Object, JTable> area )
    {
        return "My cell tooltip";
    }
} );

Respective public static properties can be found in all Web-component versions of J-components.

@mgarin mgarin closed this as completed Sep 20, 2019
v1.2.10 automation moved this from In progress to Completed Sep 20, 2019
@mgarin
Copy link
Owner

mgarin commented Sep 20, 2019

A small screenshot of the demo example for the tabbed pane tooltips:

image

mgarin added a commit that referenced this issue Sep 23, 2019
- WebTableHeader.java, TableHeaderPainter.java - Added `tooltipProvider` client property support [ #202 #471 ]
- WebTable.java - Added a small note on the header tooltip provider option
@wyj3531
Copy link

wyj3531 commented Dec 10, 2021

use the code all the table cell show tips.how to set some table cell not show tips?

@mgarin
Copy link
Owner

mgarin commented Dec 10, 2021

@wyj3531
You can simply return null for the cells you don't want to show tooltips for.
I checked in the code just in case, this should definitely work, both for header and normal cells.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v1.2.10
  
Completed
Development

No branches or pull requests

4 participants