How to update the title

I am trying to update the name of the view (i.e. the text displayed on the tab) programmatically.

When I do this:

view.setPartName(newTitle); 

The view title is well updated, but the user interface is not. So how can I do this?

Thank you in advance!

+4
source share
2 answers

You need to make sure that you set partName in the correct init method and that you make a super call before specifying a part name like this. I know this example works with my application.

 @Override public void init(IViewSite site) throws PartInitException { super.init(site); String scannerName = site.getSecondaryId(); setPartName("MyName"); } 
+7
source

I update the view title without a problem ... when you call the setPartName method?

In my class that extends ViewPart , I call the setPartName method in the init method.

+2
source

Source: https://habr.com/ru/post/1447549/


All Articles