Getting IResource instance from *Command classes [message #202321] |
Tue, 19 August 2008 06:55 |
Eclipse User |
|
|
|
Originally posted by: martin.divbyzero.net
Hi,
when creating a link between two nodes in my GMF diagram, I want to add
a new entry to the Tasks section in Eclipse's Resource Perspective.
I understand that I need to add the necessary functionality in the
ConnectionCreateCommand class (a link is called Connection in my model),
but I'm a bit lost about getting the correct IResource instance there,
which is needed to create a task using MarkerUtilties. Currently I'm
using the following code in ConnectionCreateCommand:
> protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
> IAdaptable info) throws ExecutionException {
>
> /* ... */
>
> HashMap attributes = new HashMap();
> MarkerUtilities.setMessage(attributes, "hello world");
>
> IResource resource = ...;
>
> try {
> MarkerUtilities.createMarker(resource, attributes, IMarker.TASK);
> } catch (CoreException e) {
> /* ... */
> }
>
> return super.doExecuteWithResult(monitor, info);
> }
My question now is how to get the correct value for the variable resource?
Best,
Martin
|
|
|
|
Powered by
FUDForum. Page generated in 0.02948 seconds