Skip to main content



      Home
Home » Newcomers » Newcomers » Force Eclipse to update Status Bar
Force Eclipse to update Status Bar [message #1700515] Fri, 03 July 2015 03:50
Eclipse UserFriend
I'm working on Eclipse plugin and I add an action to the statusbar by
ToolBarManager manager = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL); 
manager.add(updatingNewsAction);


However I've got problem with removing the updatingNewsAction from the toolbar. It's removed, but I can see that only when something updates the statusbar - for example minimazing/maximazing the borderline views. Then after reading some blog post I've wrote:

PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
        @Override
        public void run() {

            IWorkbench wb = PlatformUI.getWorkbench();
            IWorkbenchWindow win = wb.getActiveWorkbenchWindow();

            IWorkbenchPage page = win.getActivePage();

            IWorkbenchPart part = page.getActivePart();
            IWorkbenchPartSite site = part.getSite();

            IViewSite vSite = (IViewSite) site;

            IActionBars actionBars = vSite.getActionBars();

            if (actionBars == null) {
                return;
            }
            IStatusLineManager statusLineManager = actionBars.getStatusLineManager();

            if (statusLineManager == null) {
                return;
            }
            statusLineManager.update(true);
        }
    });


Which is a step forward, because it gets updated when switching focus between views, but still it doesn't happen immediately and without user interactions. How to update the status bar programmatically immediately?
Previous Topic:Need help
Next Topic:getting started
Goto Forum:
  


Current Time: Thu May 15 13:22:10 EDT 2025

Powered by FUDForum. Page generated in 0.07098 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top