Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Technology Project and PMC » plugin not based on physical files having problems with markers
plugin not based on physical files having problems with markers [message #69319] Thu, 20 October 2005 13:33
Eclipse UserFriend
Originally posted by: syed.amar.gmail.com

We have written a plugin that runs on eclipse 3.0.2 and runs on top of
the RCP layer + IDE + Resources layer

The plugin is not based on physical files as the design of the IDE and
Resources layer seems to require. Although there is one physical file
which is read in a tree structure is displayed with nodes specific to
our requirements in a separate custom navigator that we have written.
The nodes do not represent phsical files and we want to show node
specific errors or warnings inside the Problems pane much like Java
file compilation errors appear in JDT.

To do this we have

a) created the marker type as shown below

<extension id="xproblem" name="xproblem"
point="org.eclipse.core.resources.markers">
<super
type="org.eclipse.core.resources.problemmarker"/>
</extension>


b) created a set of problem markers using the workspace root resource
object and the following code repeatedly with different data for the
message:


IMarker marker =
ResourcesPlugin.getWorkspace().getRoot().createMarker("com.company.x.eclipse.content.xproblem ");
HashMap markerValues = new HashMap();
markerValues.put(IDE.EDITOR_ID_ATTR,
"com.company.x.eclipse.content.SlotViewEditor");
markerValues.put(IMarker.SEVERITY, new
Integer(IMarker.SEVERITY_ERROR));
markerValues.put(IMarker.MESSAGE, "Empty
content slots for " + getName());

marker.setAttributes(markerValues);

c) declared the custom editor as follows:

<extension
point="org.eclipse.ui.editors">
<editor
class="com.company.x.eclipse.content.SlotViewEditor"
default="false"
icon="icons/studio.gif"
id="com.company.x.eclipse.content.SlotView"
name="com.company.x.eclipse.content.SlotView"/>


The above allows us to see the problem markers inside the Problems
View pane, showing the value stored against IMarker.MESSAGE in the
marker object, in the description column. The remaining columns are
empty which is unfortunate as it would be ideal to be able to populate
the "Resource", "In Folder" and "Location" column values. This seems
to be a limitation due to the fact that we are not using physical
files mapped to IResources in order to create problem markers. This
is one issue.

The second issue is that double-clicking the problem does not show the
required editor even though the editor has been defined as
"com.company.x.eclipse.content.SlotViewEditor". This is a custom
editor and has been registered as part of the plugin.xml as explained
in step c) above. We discovered that this is due to creating a marker
without an IResource that is of type IFile. To create an IFile you
pretty much need a physical file because of the use of IPath and
eclipse internals expecting real files etc.

We then decided to create all our markers based on the only physical
file we have, mentioned in the introduction of this post above. This
gave us different results in that we could see the Resource column
populated with the name of this file. We could also double click the
problem marker and it would launch the required editor albeit in a new
tab to the one desired. However, opening any of the problem entries
in the Problems View which relate to different nodes in the tree
brings focuses to the same editor tab opened. This side effect is due
to the editor being registered against the resource and that the same
resource is used in all of the problems. This is the third issue.

The above issues are a stumbling block because we can not have problem
markers that you can not double click on or markers that keep showing
the same editor. It would be a breakthrough if someone knew how to
create resources for problem markers without the use of physical
files!

One other idea we have tried to pursue is to not associate an editor
to a problem marker at all. Instead if we can attach a double click
or open listener to the Problems View pane then we can pull out the
tree node object from the corresponding marker and create an editor
tab. Does anyone know how to add a double click listener or open
listener to the Problems View Pane?

Amar Syed
Previous Topic:Serial Port
Next Topic:plugin not based on physical files having problems with markers
Goto Forum:
  


Current Time: Tue Apr 23 02:50:01 GMT 2024

Powered by FUDForum. Page generated in 0.03288 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top