Community
Participate
Working Groups
When changing the toolTip of an Action object after the first time it is set, the tool tip is no longer shown. In the example below, if the user hovers over the action button on the toolbar before clicking it, the tool tip will show. After clicking the tool tip, it gets set based on the boolean value. When the tool tip is changed, it no longer appears when the user hovers over it. Here is code that will create a sample view that can be put into any perspective and will show my point. public class ActionTest extends ViewPart { public static final String ID = "goy.chris.ActionTest"; //$NON-NLS-1$ private boolean isLinkedWithMap = true; private Action linkWithMap = new Action("Link With Map", IAction.AS_CHECK_BOX) { public void run() { isLinkedWithMap = !isLinkedWithMap; if (isLinkedWithMap) { setToolTipText("Disable Link With Map"); } else { setToolTipText("Enable Link With Map"); } } }; /** * Create contents of the view part * @param parent */ @Override public void createPartControl(Composite parent) { linkWithMap.setChecked(isLinkedWithMap); linkWithMap.setToolTipText("Disable Link With Map"); initializeToolBar(); initializeMenu(); } /** * Initialize the toolbar */ private void initializeToolBar() { IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager(); toolbarManager.add(linkWithMap); } /** * Initialize the menu */ private void initializeMenu() { IMenuManager menuManager = getViewSite().getActionBars().getMenuManager(); menuManager.add(linkWithMap); } @Override public void setFocus() { // Set the focus } }
Chris, I generated a test plugin with the Sample View template, then inserted your code into (built the action in makeActions(), and added the action in fillLocalToolBar()). ex: linkWithMap = new Action("Link With Map", IAction.AS_CHECK_BOX) { public void run() { isLinkedWithMap = !isLinkedWithMap; if (isLinkedWithMap) { setToolTipText("Disable Link With Map"); } else { setToolTipText("Enable Link With Map"); } } }; linkWithMap.setChecked(isLinkedWithMap); linkWithMap.setToolTipText("Disable Link With Map"); it added a named toolbar button, and every time I clicked it the button changed it's tooltip. What happens when you run a similar test? ... I'll attach my SampleView.java. PW
Created attachment 44515 [details] Sample view with link action added I created a project from the SampleView template (with the tree,not the table). The tooltip is continually updated. PW
Paul, I see it working in the example. But it only seems to work after another tool tip is shown. If i never hover over another tool tip, the changed tool tip on my action will never show. Try this: Start the app. Hover over my action. Click my action. Take the mouse off of it, but don't hover over any other tool tip. Then hover over my action again. No tool tip will show. Then hover over another action to get its tooltip to appear. Then hover over my action and the tool tip will show. Thanks, Chris
(In reply to comment #3) > Start the app. > Hover over my action. > Click my action. > Take the mouse off of it, but don't hover over any other tool tip. > Then hover over my action again. > This works fine on my setup. My tooltip keeps updating even if all I do is move my mouse over and off that one button. I run java 1.4.2 though. Later, PW
Eric, could I get you to run this test on your machine? Thanx, PW
I've noticed this occurs on any actions in eclipse 3.2, most notable is in the Problems view since there is only the one "Filter" action to select. After it has been selected, the tooltip will no longer show. On the main eclipse toolbar, after I select an action, I can only get the tooltip to display after hovering over another action. As a side note, I am running Java 5, since the last comment appears to hint that Java 1.4.2 may be making it work.
Getting this as well, it seems to happen regardless of whether you wait for the first tooltip to show up, if you just click a toolbar button, no more tooltip for that button until you get another one to show from (it seems) the same view/toolbar. This problem is **not** present on the 3.2.0 Solaris SPARC GTK build.
Yikes, just noticed that the Windows task bar exhibits this behavior as well. Have two programs open, toggle one by clicking the task bar, then hover over it, no tooltip. Hover over the other program in the task bar, then back to the first one, tooltip is back. Yet the toolbar in MS Access 2003 does not exhibit the behavior. Seems like a platform problem but not in all of their toolbars.
Paul, (in reply to comment #5) sure....
I cannot reproduce this with I20070920-0936 on Windows XP with the code provided by comment 0.
I can no longer reproduce this behavior. Appears fixed to me.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.