Albert
Albert

Reputation:

How to programmatically change name or icon of Eclipse view?

Can the name and icon of an Eclipse view be programmatically changed? I am referring to the name and icon that appear in the tab for the view - which are specified as XML attributes "name" and "icon" in the <view> element in plugin.xml.

Upvotes: 8

Views: 4598

Answers (2)

jamesh
jamesh

Reputation: 20111

setPartName(String) and setTitleImage(Image), both on WorkbenchPart are what you're looking for.

Both EditorParts and ViewPart are extensions of WorkbenchPart.

It should be noted that both these methods are protected so should be called from within the part itself.

Upvotes: 9

Albert
Albert

Reputation: 546

setPartName(..) in the ViewPart class.

Upvotes: 0

Related Questions