It seems that I have a problem with binding the problem marker to the resource; in my case, I am trying to create a problem marker for the editor.
To achieve this, I tried to do the following:
public class MyEditor extends TextEditor{
private ColorManager colorManager;
public MyEditor() {
super();
...
IResource resource = (IResource) getEditorInput().getAdapter(IResource.class);
try
{
marker = resource.createMarker(IMarker.PROBLEM);
}
catch (CoreException e)
{
e.printStackTrace();
}
}
However, the problem is that getEditorInput () returns null. I guess I won’t call in the right place. I thought it would be ideal to create a marker when I create an editor, but this proves the opposite.
Does anyone have any tips on getting the required resource so that I can create a problem marker? I would like to show errors, etc. In the editor.
, , ITextEditor, , . (: - . ReportError)
.
:
, , createMarker (res ), .
. Eclipse