Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update view title

I'm trying to update the title of a view (ie : the text displayed in the tab) programmatically.

When i do that :

view.setPartName(newTitle);

The view name is well updated but the UI is not. So how can i do that ?

Thank you in advance!

like image 850
l1sq0u48 Avatar asked Dec 27 '22 14:12

l1sq0u48


1 Answers

You need to make sure you are setting partName in the correct init method and that you make a call to super before setting part name like this. I know this example works pasted from my app.

@Override
public void init(IViewSite site) throws PartInitException {
    super.init(site);
    String scannerName = site.getSecondaryId();
    setPartName("MyName");
}
like image 64
Duncan Krebs Avatar answered Feb 04 '23 15:02

Duncan Krebs