如何以编程方式更改Eclipse视图的名称或图标?

时间:2021-05-05 23:27:32

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.

可以通过编程方式更改Eclipse视图的名称和图标吗?我指的是视图选项卡中显示的名称和图标 - 在plugin.xml的 元素中指定为XML属性“name”和“icon”。

2 个解决方案

#1


9  

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

WorkbenchPart上的setPartName(String)和setTitleImage(Image)都是您正在寻找的。

Both EditorParts and ViewPart are extensions of WorkbenchPart.

EditorParts和ViewPart都是WorkbenchPart的扩展。

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

应该注意的是,这两种方法都受到保护,因此应该从部件本身内部进行调用。

#2


0  

setPartName(..) in the ViewPart class.

ViewPart类中的setPartName(..)。

#1


9  

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

WorkbenchPart上的setPartName(String)和setTitleImage(Image)都是您正在寻找的。

Both EditorParts and ViewPart are extensions of WorkbenchPart.

EditorParts和ViewPart都是WorkbenchPart的扩展。

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

应该注意的是,这两种方法都受到保护,因此应该从部件本身内部进行调用。

#2


0  

setPartName(..) in the ViewPart class.

ViewPart类中的setPartName(..)。