Bug 146342 - [ActionSets] Setting the tool tip on an action more than once causes no tool tip to appear.
Summary: [ActionSets] Setting the tool tip on an action more than once causes no tool ...
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-09 17:33 EDT by Christopher Goy CLA
Modified: 2019-09-06 15:37 EDT (History)
5 users (show)

See Also:


Attachments
Sample view with link action added (9.23 KB, text/plain)
2006-06-15 09:37 EDT, Paul Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Goy CLA 2006-06-09 17:33:00 EDT
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
    }
}
Comment 1 Paul Webster CLA 2006-06-15 09:36:07 EDT
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
Comment 2 Paul Webster CLA 2006-06-15 09:37:48 EDT
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
Comment 3 Christopher Goy CLA 2006-06-15 13:32:09 EDT
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

Comment 4 Paul Webster CLA 2006-06-15 14:02:52 EDT
(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
Comment 5 Paul Webster CLA 2006-06-15 14:03:22 EDT
Eric, could I get you to run this test on your machine?

Thanx,
PW
Comment 6 J. Matt Casson CLA 2006-09-20 10:04:38 EDT
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.
Comment 7 Nick Veys CLA 2006-09-20 10:41:02 EDT
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.
Comment 8 Nick Veys CLA 2006-09-20 11:10:26 EDT
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.
Comment 9 Eric Moffatt CLA 2006-09-20 13:11:37 EDT
Paul, (in reply to comment #5) sure....
Comment 10 Remy Suen CLA 2007-09-21 16:44:47 EDT
I cannot reproduce this with I20070920-0936 on Windows XP with the code provided by comment 0.
Comment 11 J. Matt Casson CLA 2008-03-10 09:37:10 EDT
I can no longer reproduce this behavior.  Appears fixed to me.
Comment 12 Eclipse Webmaster CLA 2019-09-06 15:37:44 EDT
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.