Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[riena-dev] how to update statusline with riena

Hi,all
 
I'm deleloping a C/S system with eclipse riena architecture.
 
There is a retuirement that the desk client system has a background thread to access the backend server,and to refresh some data on statusline.
 
 
I use such code in the Activator ,
 
I see the output message on the console ,but the statusline isn't updated.
 
How could I implement this requirement with riena?
 
Does someone help me ?
 
Thanks!
 
 
 
Job job = new Job("mytest job") {
   
   @Override
   protected IStatus run(IProgressMonitor monitor) {
        try {
     System.out.println("------------run as back ground---");
     if(PlatformUI.isWorkbenchRunning()){
      final IWorkbench workbench = PlatformUI.getWorkbench();
      if (workbench != null) {
       final Display display = workbench.getDisplay();
       display.asyncExec(new Runnable() {
 
        public void run() {
                 IWorkbenchWindow wbWin =workbench.getActiveWorkbenchWindow();
            IWorkbenchPage wbPage = wbWin.getActivePage();
           
            IViewPart[] views = wbPage.getViews();
          
            IViewSite viewSite = views[1].getViewSite();
            IActionBars ab = viewSite.getActionBars();
            IStatusLineManager sl = ab .getStatusLineManager();
           
           
            sl.setMessage("hello");
           
 

        }
       });
      }
     }
     return Status.OK_STATUS;
    } finally {
          schedule(2000);
    }
   }
  };
  job.setPriority(Job.SHORT);
  job.schedule();

Back to the top