Comments (8)
Probably adding the method is enough. As seen from the code the toolTip text is set on the menu shell. Shell#setToolTipText is already available.
from org.eclipse.rap.
Compile-wise this works, but no Tooltip shows up when hovering over the MenuItems. (which works in SWT)
Should I anyway make a PR to integrate that as first step?
from org.eclipse.rap.
I've double checked the SWT implementation and it is different at least on Windows:
public void setToolTipText (String toolTip) {
checkWidget ();
if (toolTip == null && itemToolTip != null) {
itemToolTip.setVisible (false);
itemToolTip = null;
}
if (toolTip == null || toolTip.trim().length() == 0
|| (itemToolTip != null && toolTip.equals(itemToolTip.getMessage()))) return;
itemToolTip = new MenuItemToolTip (this.getParent().getShell());
itemToolTip.setMessage (toolTip);
itemToolTip.setVisible (false);
}
There is an internal class MenuItemToolTip extends ToolTip
that handles the MenuItem tooltip.
The tooltip visibility is controlled by the method
void showTooltip (int x, int y) {
if (itemToolTip == null) return;
itemToolTip.setLocationInPixels (x, y);
itemToolTip.setVisible (true);
}
which is called by the Menu class.
from org.eclipse.rap.
from org.eclipse.rap.
Maybe this is the way to go in RWT as well.
from org.eclipse.rap.
I'll try to come with complete JS implementation here, similar to the other widgets.
from org.eclipse.rap.
I tried to adapt that, but the tooltip does not show up when hovering over the MenuItem's.
I think "nobody" handles the hovering and calling getTooltipText().
I tried to adapt it like eg. ToolItems tooltip handling:
- I added
WidgetLCAUtil.preserveToolTipText( item, item.getToolTipText() )
inMenuItemLCA
like it's done inToolItemLCA
- and added
case "rwt.widgets.MenuItem":
in
like the ToolItem but it still does not work
(not that I'm really knowing what I'm doing here but I just tried to do the same like ToolItem does ...)
Any ideas?
from org.eclipse.rap.
@phermsdorf I've created a fully working implementation and a pull request. What is probably missing for you are the changes in MenuItemHandler.js
.
from org.eclipse.rap.
Related Issues (20)
- Support for SVG Images for Actions, Commands and Menu's for HighDPI and zooming support
- Missing RAP artifacts in maven central HOT 2
- JS crash in rwt.event.DomEvent.isAltGrPressed() while drag'n'drop HOT 1
- [Grid] Index out of bounds exception when using cell selection and setItemCount HOT 2
- org.eclipse.rap.rwt.client.service.ClientInfo.getClientTimezoneOffset() returns invalid value after a daylight saving change
- Infinite loop in RAPDragTracker
- Memory leaks using Display.timerExec with push session active
- RAP version which support jboss8 HOT 17
- BridgeServlet issue
- Replace dependency to org.eclipse.osgi.services HOT 6
- Which RAP version is supporting Java 21?
- Browser controls in tabs lose scroll position in Chromium based browers HOT 2
- ServerPushSession is interrupted after a period of inactivity HOT 4
- `NullPointerException`: Cannot invoke `IProgressMonitor.beginTask(String, int)` because `monitor` is null HOT 6
- Weakness in `FileDialog` may cause `Widget disposed` error HOT 4
- Auto Suggest demo is broken
- Add 'insertText' functionality to the Nebula RichTextEditor HOT 1
- Scrolling continues unexpectedly HOT 5
- Missing RAP artifacts in maven central HOT 6
- fixFocus works differently between SWT and RWT
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org.eclipse.rap.