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)
- Retry on connection error doesn't work with CSP enabled
- Handling network connection error with SeverPush active HOT 7
- Missing requirement: org.eclipse.rap.rwt.osgi 3.22.0.20220708-1200 requires 'java.package; javax.servlet [4.0.0,5.0.0)' but it could not be found HOT 3
- RAP version which support jboss8 and openjdk17 HOT 7
- Ampersand character ommited from label text HOT 1
- selection in not yet focused multiline Text widget HOT 2
- CSRF security HOT 2
- Focus issues with ContextMenu in Chrome/Edge browser
- pack column for Tableviewer
- Copy of photo is stored on server and never cleaned up
- 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
- Client sometimes doesn't re-layout on browser window size change HOT 4
- TypeError when POST fails causes error-dialog is not shown HOT 3
- No jface.databinding.swt.typed package? HOT 22
- Mouse up / down event not triggering on table header click or select HOT 7
- Improve deployment of realease artefacts to Maven Central
- Wrong handling error in ServerPush.js / Connections.js HOT 1
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.