Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Could not resolve SapphireActionHandler
Could not resolve SapphireActionHandler [message #853818] Mon, 23 April 2012 11:09 Go to next message
Nepomuk Seiler is currently offline Nepomuk Seiler
Messages: 88
Registered: December 2010
Member
Hi,

I'm trying to add a custom ActionHandler. I've implemented a class with SapphireActionHandler.

However the sdef file says: "Could not resolve implementation class".
I have imported all packages.

<?xml version="1.0" encoding="UTF-8"?>
<definition>
     <import>
          <package>de.lmu.ifi.dbs.knowing.core.model</package>
          <package>de.lmu.ifi.dbs.knowing.debug.ui.handler</package>
          <package>de.lmu.ifi.dbs.knowing.debug.ui.editor</package>
     </import>
....

     <action>
          <id>knowing.dpu.run</id>
          <label>Run</label>
     </action>
     <action-handler>
          <action>knowing.dpu.run</action>
          <id>knowing.dpu.run.handler.default</id>
          <impl>de.lmu.ifi.dbs.knowing.debug.ui.handler.SapphireRunHandler</impl>
     </action-handler>
....



The class isn't that big yet

package de.lmu.ifi.dbs.knowing.debug.ui.handler;

import org.eclipse.sapphire.ui.SapphireActionHandler;
import org.eclipse.sapphire.ui.SapphireRenderingContext;

public class SapphireRunHandler extends SapphireActionHandler {

	@Override
	protected Object run(SapphireRenderingContext context) {
		System.out.println("RUN!");
		return null;
	}

}



Second question. How can I add this action to the section title bar,
where the "hide outline" buttion is located?

thx,
Muki
Re: Could not resolve SapphireActionHandler [message #853837 is a reply to message #853818] Mon, 23 April 2012 11:28 Go to previous messageGo to next message
Greg Amerson is currently offline Greg Amerson
Messages: 116
Registered: March 2010
Senior Member
For the first issue change your impl to just be this:
<impl>SapphireRunHandler</impl>


For the second issue, in your action definition set the Sapphire context to
<context>Sapphire.EditorPage.Outline.Header</context>


Hope this helps!

[Updated on: Mon, 23 April 2012 11:28]

Report message to a moderator

Re: Could not resolve SapphireActionHandler [message #853937 is a reply to message #853837] Mon, 23 April 2012 13:39 Go to previous message
Nepomuk Seiler is currently offline Nepomuk Seiler
Messages: 88
Registered: December 2010
Member
Hi Greg,

Thanks for the quick reply. The first question helped me out,
but the context statement doesn't work.

The snippet now looks like this

<action>
  <id>knowing.dpu.run</id>
  <label>Run</label>
  <image>icons/lrun_obj.gif</image>
  <context>Sapphire.EditorPage.Outline.Header</context>
</action>
<action-handler>
  <action>knowing.dpu.run</action>
  <id>knowing.dpu.run.handler.default</id>
  <impl>SapphireRunHandler</impl>
</action-handler>


However the action is now greyed out ( I added it with an ActionLink to see if it works )
and nothing is shown in the headline.

UPDATE
It was not high enough in the sdef hierarchy. Sorry.

thx in advance,
Muki

[Updated on: Mon, 23 April 2012 13:43]

Report message to a moderator

Previous Topic:Diagram node handler factory
Next Topic:Aligning Sapphire 0.5 release with Juno
Goto Forum:
  


Current Time: Fri Oct 31 06:57:01 GMT 2014

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

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