Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » IEditorActionDelegate problem
IEditorActionDelegate problem [message #157228] Fri, 16 June 2006 21:55 Go to next message
Michael Schmidt is currently offline Michael SchmidtFriend
Messages: 45
Registered: July 2009
Member
Folks,
I've read my books and Googled the Internet, but can't solve a seemingly
simple problem. I'm adding an IEditorActionDelegate to my RCP application
and testing it. When the editor is opened, the entries appear on the
menubar and toolbar as they should but when clicked I get an error dialog
"The chosen action is not currently available". Also, none of the
println() test lines appear in the console. Here is the
IEditorActionDelegate class code:

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorActionDelegate;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.actions.ActionDelegate;

class DbFilterActionDelegate extends ActionDelegate implements
IEditorActionDelegate {

private IEditorPart editor;

public DbFilterActionDelegate() {
}

public void setActiveEditor(IAction action, IEditorPart editor) {
this.editor = editor;
System.out.println("Responded to active editor change");
// TODO Auto-generated method stub

}

public void run(IAction action) {
System.out.println("Responded to run");
// TODO Auto-generated method stub

}

public void selectionChanged(IAction action, ISelection selection) {
System.out.println("Responded to selection change");
// TODO Auto-generated method stub
}



}

Here is the snippet from plugin.xml:

<extension
point="org.eclipse.ui.editorActions">
<editorContribution
id="mschmidt.akamai.dbeditor.actions"
targetID="mschmidt.akamai.dbeditors.AuxEditor">
<menu
id="mschmidt.komo.menubar.dbeditorActions"
label="D&amp;B Tasks"
path="additions">
<groupMarker name="editorActionGroup"/>
</menu>
<action
id="mschmidt.akamai.dbeditors.actions.filter"
label="&amp;Filter"
icon="icons/filter.gif"

menubarPath="mschmidt.komo.menubar.dbeditorActions/editorActionGroup "
style="push"
toolbarPath="Normal/additions"
tooltip="Filter the table view"
class="mschmidt.akamai.dbeditors.DbFilterActionDelegate"
definitionId="mschmidt.akamai.dbeditors.actions.filter"/>
</editorContribution>

</extension>

It is my understanding that I don't need an EditorActionContributor nor
any special code in the EditorPart itself. Where am I going wrong?
Thanks!

Michael Schmidt
Re: IEditorActionDelegate problem - solved [message #157265 is a reply to message #157228] Sat, 17 June 2006 17:38 Go to previous messageGo to next message
Michael Schmidt is currently offline Michael SchmidtFriend
Messages: 45
Registered: July 2009
Member
Folks,
Unfortunately, nobody responded. In continuing to work on the problem I
looked at the runtime log. The IEditorActionDelegate class needs to be
public. As I suspected, a simple oversight.
Michael Schmidt
Re: IEditorActionDelegate problem [message #157803 is a reply to message #157228] Wed, 21 June 2006 12:24 Go to previous message
Eclipse UserFriend
Originally posted by: kulbir.singh.trianz.com

Hi,

if u r getting the error that the "choosen operation....." then you can
check the class path from the xml file and wheere u implemened the
IEditorAcitonDelegate class, delete the metadata folder and try once
again..
might be this will help you.

regards
Previous Topic:Dialog class Object
Next Topic:Licence Problem
Goto Forum:
  


Current Time: Thu Jul 18 06:39:54 GMT 2024

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

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

Back to the top