Is there a way to change the name of one of the default Eclipse views programmatically?

I have a plugin that uses the Eclipse Problems view, and I really would like to change the title to Errors.

Is there a way to change this programmatically, or can I expand the view of problems without creating my own marker view mode?

I know that to change the title of the view, you use setParName in the viewPart class, but since I use one of the Eclipse views, I do not have the viewPart class.

+4
source share
2 answers

If you have a custom perspective, you can set a name for the view by adding it to plugin.xml (the "Extensions" tab of the manifest) instead of a custom perspective class.

nEm: I just wanted to add this to make sure you select this class if you want the error marker behavior

org.eclipse.ui.internal.views.markers.ProblemsView 

Since there is another representation of the problem.

+2
source

You can create your own view definition that is very similar to ProblemView by creating a custom Markers view.

org.eclipse.ui.internal.views.markers.ProblemsView uses the marker generator org.eclipse.ui.ide.problemsGenerator. By creating a subclass class of org.eclipse.ui.views.markers.MarkerSupportView and providing a marker generator, you can use a simple view definition:

 <extension point="org.eclipse.ui.views"> <view class="com.example.MyErrorView" icon="icons/sample.gif" id="com.example.myErrorView" name="My Error View"/> </extension> 

See Prakash http://blog.eclipse-tips.com/2008/11/creating-custom-marker-view.html for a more complex example. Using the icon from another plugin is difficult because there is no guarantee that it will remain where it is, but if you really want to use it

 icon="platform:/plugin/org.eclipse.ui.ide/icons/full/eview16/problems_view.gif" 

Note only, this format does not support changing the NL icon.

+1
source

All Articles