Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » IactionDelegate.selectionChanged returns null?
IactionDelegate.selectionChanged returns null? [message #419319] Mon, 19 May 2008 08:20 Go to next message
Rene Ladan is currently offline Rene LadanFriend
Messages: 51
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------080001050008060200020601
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I have a program which implements IActionDelegate (i.e. it defines both run() and selectionChanged() ).
This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with Eclipse 3.4M7/EMF 2.4M7 , because
according to the implemented selectionChanged(), selection is always null, even if something is selection
when calling the method. There are no compile/build errors.

I've attached the backtrace and the part which implements IActionDelegate.

Am I doing something wrong?

Regards,
Rene

--------------080001050008060200020601
Content-Type: text/plain;
name="MetaEditor.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="MetaEditor.java"

package meta.custom;

import java.io.IOException;

import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.OperationHistoryFactory ;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.workspace.AbstractEMFOperation;
import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;

/**
* This class provides the hooks between the analyze/transformation/PISA engines and the EMF code.
* @author rladan
*/
public class MetaEditor implements IActionDelegate {

/** This contains the current selection of the editor. */
ISelection sel;

private TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain() ;

Variator var = new Variator();

/**
* @see IActionDelegate#run(IAction)
*/
@Override
public void run(final IAction action) {
// Find out what is selected. Note that child nodes are *not*
// automatically selected when their parents are selected.
final AbstractEMFOperation aeo = new AbstractEMFOperation(this.editingDomain, "domain") {
@Override
protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) {
try {
//FIXME sel==null
MetaEditor.this.var.doVariate((EObject)((IStructuredSelectio n)MetaEditor.this.sel).getFirstElement());
} catch (IOException ioe) {
ioe.printStackTrace();
}
return null;
}
};
try {
OperationHistoryFactory.getOperationHistory().execute(aeo, null, null);
} catch (final ExecutionException ee) {
ee.printStackTrace();
}
}

/**
* <!--begin-user-doc-->
* method from org.eclipse.emf.ecore.editor.CreateDynamicInstanceAction.jav a via post from Ed Merks
* <!--end-user-doc-->
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
@Override
public void selectionChanged(final IAction action, final ISelection selection) {
//activated on right-clicking a selection or by pressing e.g. Ctrl+Alt+A
System.out.println("selection="+selection);
if (selection instanceof IStructuredSelection) {
action.setEnabled(true);
this.sel = selection;
} else {
action.setEnabled(false);
this.sel = null;
}
}
}

--------------080001050008060200020601
Content-Type: text/plain;
name="sel-null.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="sel-null.txt"

selection=null
org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:519)
at meta.custom.MetaEditor.run(MetaEditor.java:52)
at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy. execute(ActionDelegateHandlerProxy.java:289)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:471)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:822)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:511)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:126)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:116 2)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1001)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1026)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1011)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1039 )
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1035 )
at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1652)
at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4117 )
at org.eclipse.swt.widgets.Tree.WM_KEYDOWN(Tree.java:5835)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3813 )
at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5703)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4500 )
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:23 46)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3379)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2394)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2358)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 10)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:494)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:489)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:112)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:379)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.NullPointerException
at meta.custom.MetaEditor$1.doExecute(MetaEditor.java:44)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:157)
at org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:511)
... 48 more

--------------080001050008060200020601--
Re: IactionDelegate.selectionChanged returns null? [message #419334 is a reply to message #419319] Mon, 19 May 2008 13:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Rene,

I have an action in org.eclipse.emf.ecore.action.CreateDynamicInstance
that works fine with M7. I suppose you could check in the debugger why
that's being called with a valid selection (it's a popup action on an
EClass) but your action is not..


Rene Ladan wrote:
> Hi,
>
> I have a program which implements IActionDelegate (i.e. it defines
> both run() and selectionChanged() ).
> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
> Eclipse 3.4M7/EMF 2.4M7 , because
> according to the implemented selectionChanged(), selection is always
> null, even if something is selection
> when calling the method. There are no compile/build errors.
>
> I've attached the backtrace and the part which implements
> IActionDelegate.
>
> Am I doing something wrong?
>
> Regards,
> Rene


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: IactionDelegate.selectionChanged returns null? [message #419337 is a reply to message #419334] Mon, 19 May 2008 14:45 Go to previous messageGo to next message
Rene Ladan is currently offline Rene LadanFriend
Messages: 51
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------020402090401020302030806
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ed Merks wrote:
> Rene,
>
> I have an action in org.eclipse.emf.ecore.action.CreateDynamicInstance
> that works fine with M7. I suppose you could check in the debugger why
> that's being called with a valid selection (it's a popup action on an
> EClass) but your action is not..
>
I've changed the file a bit to look like CreateDynamicInstanceAction (unfinalize
method parameters, extend ActionDelegate, add a constructor which calls super() ),
but the parameter 'selection' is still null upon entering selectionChanged().

Any ideas?

Rene

> Rene Ladan wrote:
>> Hi,
>>
>> I have a program which implements IActionDelegate (i.e. it defines
>> both run() and selectionChanged() ).
>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>> Eclipse 3.4M7/EMF 2.4M7 , because
>> according to the implemented selectionChanged(), selection is always
>> null, even if something is selection
>> when calling the method. There are no compile/build errors.
>>
>> I've attached the backtrace and the part which implements
>> IActionDelegate.
>>
>> Am I doing something wrong?
>>
>> Regards,
>> Rene


--------------020402090401020302030806
Content-Type: text/plain;
name="MetaEditor.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="MetaEditor.java"

package meta.custom;

import java.io.IOException;

import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.OperationHistoryFactory ;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.actions.ActionDelegate;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.workspace.AbstractEMFOperation;
import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;

/**
* This class provides the hooks between the analyze/transformation/PISA engines and the EMF code.
* @author rladan
*/
public class MetaEditor extends ActionDelegate implements IActionDelegate {

/**
* @see ActionDelegate
*/
public MetaEditor() {
super();
}
/** This contains the current selection of the editor. */
EObject sel;

private TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain() ;

Variator var = new Variator();

/**
* @see IActionDelegate#run(IAction)
*/
@Override
public void run(IAction action) {
// Find out what is selected. Note that child nodes are *not*
// automatically selected when their parents are selected.
final AbstractEMFOperation aeo = new AbstractEMFOperation(this.editingDomain, "domain") {
@Override
protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) {
try {
MetaEditor.this.var.doVariate(MetaEditor.this.sel);
} catch (IOException ioe) {
ioe.printStackTrace();
}
return null;
}
};
try {
OperationHistoryFactory.getOperationHistory().execute(aeo, null, null);
} catch (final ExecutionException ee) {
ee.printStackTrace();
}
}

/**
* <!--begin-user-doc-->
* method from org.eclipse.emf.ecore.editor.CreateDynamicInstanceAction.jav a via post from Ed Merks
* <!--end-user-doc-->
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
@Override
public void selectionChanged(IAction action, ISelection selection) {
//activated on right-clicking a selection or by pressing e.g. Ctrl+Alt+A
System.out.println("selection="+selection); // FIXME selection == null
if (selection instanceof IStructuredSelection) {
action.setEnabled(true);
this.sel = (EObject)((IStructuredSelection)selection).getFirstElement() ;
} else {
action.setEnabled(false);
this.sel = null;
}
}
}

--------------020402090401020302030806--
Re: IactionDelegate.selectionChanged returns null? [message #419338 is a reply to message #419337] Mon, 19 May 2008 16:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Rene,

Maybe try setting a breakpoint in the selectionChanged method of each
and see how they are called...


Rene Ladan wrote:
> Ed Merks wrote:
>> Rene,
>>
>> I have an action in
>> org.eclipse.emf.ecore.action.CreateDynamicInstance that works fine
>> with M7. I suppose you could check in the debugger why that's being
>> called with a valid selection (it's a popup action on an EClass) but
>> your action is not..
>>
> I've changed the file a bit to look like CreateDynamicInstanceAction
> (unfinalize
> method parameters, extend ActionDelegate, add a constructor which
> calls super() ),
> but the parameter 'selection' is still null upon entering
> selectionChanged().
>
> Any ideas?
>
> Rene
>
>> Rene Ladan wrote:
>>> Hi,
>>>
>>> I have a program which implements IActionDelegate (i.e. it defines
>>> both run() and selectionChanged() ).
>>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>>> Eclipse 3.4M7/EMF 2.4M7 , because
>>> according to the implemented selectionChanged(), selection is always
>>> null, even if something is selection
>>> when calling the method. There are no compile/build errors.
>>>
>>> I've attached the backtrace and the part which implements
>>> IActionDelegate.
>>>
>>> Am I doing something wrong?
>>>
>>> Regards,
>>> Rene
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: IactionDelegate.selectionChanged returns null? [message #419351 is a reply to message #419338] Tue, 20 May 2008 09:16 Go to previous messageGo to next message
Rene Ladan is currently offline Rene LadanFriend
Messages: 51
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------030008010508050201000104
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ed Merks wrote:
> Rene,
>
> Maybe try setting a breakpoint in the selectionChanged method of each
> and see how they are called...
>
I've regenerated all Java files but this doesn't help either. I did
find out that meta.presentation.MetaEditor.handleChangedResources()
(also regenerated) is never called when pressing the activating keys
(Ctrl+Alt+A in my case).

Could the problem be in some project file? (see the attachment).

Rene
>
> Rene Ladan wrote:
>> Ed Merks wrote:
>>> Rene,
>>>
>>> I have an action in
>>> org.eclipse.emf.ecore.action.CreateDynamicInstance that works fine
>>> with M7. I suppose you could check in the debugger why that's being
>>> called with a valid selection (it's a popup action on an EClass) but
>>> your action is not..
>>>
>> I've changed the file a bit to look like CreateDynamicInstanceAction
>> (unfinalize
>> method parameters, extend ActionDelegate, add a constructor which
>> calls super() ),
>> but the parameter 'selection' is still null upon entering
>> selectionChanged().
>>
>> Any ideas?
>>
>> Rene
>>
>>> Rene Ladan wrote:
>>>> Hi,
>>>>
>>>> I have a program which implements IActionDelegate (i.e. it defines
>>>> both run() and selectionChanged() ).
>>>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>>>> Eclipse 3.4M7/EMF 2.4M7 , because
>>>> according to the implemented selectionChanged(), selection is always
>>>> null, even if something is selection
>>>> when calling the method. There are no compile/build errors.
>>>>
>>>> I've attached the backtrace and the part which implements
>>>> IActionDelegate.
>>>>
>>>> Am I doing something wrong?
>>>>
>>>> Regards,
>>>> Rene
>>


--------------030008010508050201000104
Content-Type: application/octet-stream;
name="mt-test.editor.cfg.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="mt-test.editor.cfg.zip"

UEsDBBQAAgAIAASKKThhqlmZmwEAAH0EAAAKAAAAcGx1Z2luLnhtbJ1TyU7D MBC9V+o/GAuO
samQEIckFRSQeuCCQByr1JkGI9eObIft67Hjxglh5xTPzHuzvUk6f94K9Aja cCUzPCOHGIFk
quSyyvDtzWVyguf5dJLOgQleG+ixRw7rQy64lyTTCUqZql80r+5t7i06NJ1j f1nuTydJEii1
aCou27eLoRSeLUif2FsI1YpLizKEla7IrjRpOJHwdMdfC10anAdkygoLldIv wUSIl2MebDfu
rTSQwCUdhSzPcUeTxRYyfLC6Xa4CatWhYiXaeTrHUwt8X3gLtiC1BgPSFtYN RK6c50qVIELe
UU3PaauOYCtRrEFEKBOFMb/K31N23f5rHZwp6Yn+a+imEYKq9cPsmMZql1wA qfimW4/bRwmG
aV77rvJPZxoAUjpExxQGBDDv6ice9t627YZXjWZgyPJ698SIRpWCKq2Z0nhX +fjQvrwxKLlV
uj+wYHcdfq/zRYsd7PETkQNmp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U5GLy5z dm4vdG1wL1BL
AQIUAAoAAAAAACiBMDgAAAAAAAAAAAAAAAAcAAAAAAAAAAAAEAAAADoJAABN RVRBLUlORi8u
c3ZuL3RtcC9wcm9wLWJhc2UvUEsBAhQACgAAAAAAKIEwOAAAAAAAAAAAAAAA ABgAAAAAAAAA
AAAQAAAAdAkAAE1FVEEtSU5GLy5zdm4vdG1wL3Byb3BzL1BLAQIUAAoAAAAA AOWNszgAAAAA
AAAAAAAAAAAcAAAAAAAAAAAAEAAAAKoJAABNRVRBLUlORi8uc3ZuL3RtcC90 ZXh0LWJhc2Uv
UEsBAhQAFAACAAgAlHGwOFnZSW5AAQAAuAIAABQAAAAAAAAAAQAgAAAA5AkA AE1FVEEtSU5G
L01BTklGRVNULk1GUEsBAhQACgAAAAAABIopOAAAAAAAAAAAAAAAAAkAAAAA AAAAAAAQAAAA
VgsAAE1FVEEtSU5GL1BLBQYAAAAADwAPAMADAAB9CwAAAAA=
--------------030008010508050201000104
Content-Type: application/octet-stream;
name="mt-test.diagram.custom.cfg.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="mt-test.diagram.custom.cfg.zip"

UEsDBAoAAAAAAEBStDgAAAAAAAAAAAAAAAAOAAAATUVUQS1JTkYvLnN2bi9Q SwMECgAAAAAA
iIRjOAAAAAAAAAAAAAAAABgAAABNRVRBLUlORi8uc3ZuL3Byb3AtYmFzZS9Q SwMECgAAAAAA
iIRjOAAAAAAAAAAAAAAAABQAAABNRVRBLUlORi8uc3ZuL3Byb3BzL1BLAwQK AAAAAABAUrQ4
AAAAAAAAAAAAAAAAGAAAAE1FVEEtSU5GLy5zdm4vdGV4dC1iYXNlL1BLAwQK AAAAAABAUrQ4
AAAAAAAAAAAAAAAAEgAAAE1FVEEtSU5GLy5zdm4vdG1wL1BLAwQKAAAAAACI hGM4AAAAAAAA
AAAAAAAAHAAAAE1FVEEtSU5GLy5zdm4vdG1wL3Byb3AtYmFzZS9QSwMECgAA AAAAiIRjOAAA
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JRuSDcAAAAAAAAAAAAAAAARAAAAAAAAAAEAIAAAAIUEAABw bHVnaW4ucHJv
cGVydGllc1BLAQIUABQAAgAIAAVYTjhWcI1ywQEAAA4FAAAKAAAAAAAAAAEA IAAAALQEAABw
bHVnaW4ueG1sUEsBAhQAFAACAAgA6nGwOMKLXvycAgAAYg0AABAAAAAAAAAA AQAgAAAAnQYA
AGJ1aWxkLnByb3BlcnRpZXNQSwECFAAUAAIACABCS7Q47ntI4xwBAACkAgAA CgAAAAAAAAAB
ACAAAABnCQAALmNsYXNzcGF0aFBLBQYAAAAADwAPAMADAACrCgAAAAA=
--------------030008010508050201000104--
Re: IactionDelegate.selectionChanged returns null? [message #419354 is a reply to message #419351] Tue, 20 May 2008 11:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Rene,

It's handle activate that should be called and it should properly set
the selection that's applied to your action; handleChangedResources
should only be called if there are resource deltas in the workspace that
affect the files being edited.


Rene Ladan wrote:
> Ed Merks wrote:
>> Rene,
>>
>> Maybe try setting a breakpoint in the selectionChanged method of each
>> and see how they are called...
>>
> I've regenerated all Java files but this doesn't help either. I did
> find out that meta.presentation.MetaEditor.handleChangedResources()
> (also regenerated) is never called when pressing the activating keys
> (Ctrl+Alt+A in my case).
>
> Could the problem be in some project file? (see the attachment).
>
> Rene
>>
>> Rene Ladan wrote:
>>> Ed Merks wrote:
>>>> Rene,
>>>>
>>>> I have an action in
>>>> org.eclipse.emf.ecore.action.CreateDynamicInstance that works fine
>>>> with M7. I suppose you could check in the debugger why that's
>>>> being called with a valid selection (it's a popup action on an
>>>> EClass) but your action is not..
>>>>
>>> I've changed the file a bit to look like CreateDynamicInstanceAction
>>> (unfinalize
>>> method parameters, extend ActionDelegate, add a constructor which
>>> calls super() ),
>>> but the parameter 'selection' is still null upon entering
>>> selectionChanged().
>>>
>>> Any ideas?
>>>
>>> Rene
>>>
>>>> Rene Ladan wrote:
>>>>> Hi,
>>>>>
>>>>> I have a program which implements IActionDelegate (i.e. it defines
>>>>> both run() and selectionChanged() ).
>>>>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>>>>> Eclipse 3.4M7/EMF 2.4M7 , because
>>>>> according to the implemented selectionChanged(), selection is
>>>>> always null, even if something is selection
>>>>> when calling the method. There are no compile/build errors.
>>>>>
>>>>> I've attached the backtrace and the part which implements
>>>>> IActionDelegate.
>>>>>
>>>>> Am I doing something wrong?
>>>>>
>>>>> Regards,
>>>>> Rene
>>>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: IactionDelegate.selectionChanged returns null? [message #419417 is a reply to message #419338] Thu, 22 May 2008 09:08 Go to previous messageGo to next message
Rene Ladan is currently offline Rene LadanFriend
Messages: 51
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------070604030601010703040404
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I completely regenerated the model, edit, and editor code and resources to be sure that
there were no leftovers which could cause problems, but the selection returned from
IActionDelegate.selectionChanged() is still null.

Upon loading the model, the topmost element is selected, getContentOutlinePage()
tells that this is an org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl, which causes
handleContentOutlineSelection() to ignore this element, because it is not an instance
of IStructuredSelection.

If I click on the element of type Meta.meta (the first child of XMIResourceImpl),
these listeners are informed:
org.eclipse.emf.edit.ui.action.DeleteAction@13c339f
org.eclipse.emf.edit.ui.action.CutAction@1612600
org.eclipse.emf.edit.ui.action.CopyAction@105e560
org.eclipse.emf.edit.ui.action.PasteAction@1641c0
org.eclipse.emf.edit.ui.action.ValidateAction@136ab79
org.eclipse.emf.edit.ui.action.ControlAction@33c1aa
meta.presentation.MetaActionBarContributor@1efa3e7
org.eclipse.ui.internal.AbstractSelectionService$1@1f1cc1a
org.eclipse.ui.internal.AbstractSelectionService$2@18eef25
org.eclipse.ui.internal.AbstractSelectionService$1@f67d81
org.eclipse.ui.internal.AbstractSelectionService$2@a9a1ac

Are these listeners involved in setting the selection, if not,
what sets the selection?

I've added the metamodel, a dummy sample model, and some of
the custom add-on code which is contained in its own project.

Does anyone see any errors in it?

Ed Merks wrote:
> Rene,
>
> Maybe try setting a breakpoint in the selectionChanged method of each
> and see how they are called...
>
>
> Rene Ladan wrote:
>> Ed Merks wrote:
>>> Rene,
>>>
>>> I have an action in
>>> org.eclipse.emf.ecore.action.CreateDynamicInstance that works fine
>>> with M7. I suppose you could check in the debugger why that's being
>>> called with a valid selection (it's a popup action on an EClass) but
>>> your action is not..
>>>
>> I've changed the file a bit to look like CreateDynamicInstanceAction
>> (unfinalize
>> method parameters, extend ActionDelegate, add a constructor which
>> calls super() ),
>> but the parameter 'selection' is still null upon entering
>> selectionChanged().
>>
>> Any ideas?
>>
>> Rene
>>
>>> Rene Ladan wrote:
>>>> Hi,
>>>>
>>>> I have a program which implements IActionDelegate (i.e. it defines
>>>> both run() and selectionChanged() ).
>>>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>>>> Eclipse 3.4M7/EMF 2.4M7 , because
>>>> according to the implemented selectionChanged(), selection is always
>>>> null, even if something is selection
>>>> when calling the method. There are no compile/build errors.
>>>>
>>>> I've attached the backtrace and the part which implements
>>>> IActionDelegate.
>>>>
>>>> Am I doing something wrong?
>>>>
>>>> Regards,
>>>> Rene
>>


--------------070604030601010703040404
Content-Type: application/octet-stream;
name="meta.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="meta.zip"

UEsDBBQAAgAIAHl6tTg2M3HepQkAAF6FAAAKAAAAbWV0YS5lY29yZe1dW2/b OBZ+H2D+g6F9
btVmXxZB0kHipAtj0jaI09nZp4KWjm1uJFJDUY69v35J3UxJdiqblExtkocW pijy47nz8KKL
39ZhMFoBizEll87H9x+cERCP+pgsLp3vj5/f/cP57dOvv1yARxmc394j7wkt YLQO8Xn51pl4
69dfRuJPNEbic/Hw0llyHp277vPz83saLt5TtnD//DJxiipxtcrz39MaZx8+ fBTV7qbeEkL0
DpOYI+JBpfUUSeV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
AQIUABQAAgAIALOFtTgUn4WrcQEAAFEDAAAbAAAAAAAAAAEAIAAAALwPAABh ZGQtb24vTUVU
QS1JTkYvTUFOSUZFU1QuTUZQSwECFAAKAAAAAACUbkg3AAAAAAAAAAAAAAAA GAAAAAAAAAAB
ACAAAABmEQAAYWRkLW9uL3BsdWdpbi5wcm9wZXJ0aWVzUEsBAhQAFAACAAgA 5IW1OAWTXjHA
AQAADgUAABEAAAAAAAAAAQAgAAAAnBEAAGFkZC1vbi9wbHVnaW4ueG1sUEsB AhQACgAAAAAA
cFi2OAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAQAAAAixMAAGFkZC1vbi9zcmMv UEsBAhQACgAA
AAAAdVi2OAAAAAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAtBMAAGFkZC1vbi9z cmMvbWV0YS9Q
SwECFAAKAAAAAACxWLY4AAAAAAAAAAAAAAAAFwAAAAAAAAAAABAAAADiEwAA YWRkLW9uL3Ny
Yy9tZXRhL2N1c3RvbS9QSwECFAAUAAIACACuWLY4dgbl7s4DAABCCgAAJgAA AAAAAAABACAA
AAAXFAAAYWRkLW9uL3NyYy9tZXRhL2N1c3RvbS9NZXRhRWRpdG9yLmphdmFQ SwECFAAKAAAA
AABmWLY4AAAAAAAAAAAAAAAABwAAAAAAAAAAABAAAAApGAAAYWRkLW9uL1BL BQYAAAAADgAO
AH8DAABOGAAAAAA=
--------------070604030601010703040404--
Re: IactionDelegate.selectionChanged returns null? [message #419430 is a reply to message #419417] Thu, 22 May 2008 11:39 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030805090507020904010405
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Rene,

When the generated editor's setSelection is called, anything listening
to the editor's selection provider should be notified. All those
actions you mention listen for that. I have two days of e4
<http://wiki.eclipse.org/E4/Summit>meetings, so I'm not sure when I will
get to trying out your example... Given that the selection is getting
to all these other actions, there must be something specific about your
action that's different from all these others. Is your action in this
sample code?


Rene Ladan wrote:
> I completely regenerated the model, edit, and editor code and
> resources to be sure that
> there were no leftovers which could cause problems, but the selection
> returned from
> IActionDelegate.selectionChanged() is still null.
>
> Upon loading the model, the topmost element is selected,
> getContentOutlinePage()
> tells that this is an org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl,
> which causes
> handleContentOutlineSelection() to ignore this element, because it is
> not an instance
> of IStructuredSelection.
>
> If I click on the element of type Meta.meta (the first child of
> XMIResourceImpl),
> these listeners are informed:
> org.eclipse.emf.edit.ui.action.DeleteAction@13c339f
> org.eclipse.emf.edit.ui.action.CutAction@1612600
> org.eclipse.emf.edit.ui.action.CopyAction@105e560
> org.eclipse.emf.edit.ui.action.PasteAction@1641c0
> org.eclipse.emf.edit.ui.action.ValidateAction@136ab79
> org.eclipse.emf.edit.ui.action.ControlAction@33c1aa
> meta.presentation.MetaActionBarContributor@1efa3e7
> org.eclipse.ui.internal.AbstractSelectionService$1@1f1cc1a
> org.eclipse.ui.internal.AbstractSelectionService$2@18eef25
> org.eclipse.ui.internal.AbstractSelectionService$1@f67d81
> org.eclipse.ui.internal.AbstractSelectionService$2@a9a1ac
>
> Are these listeners involved in setting the selection, if not,
> what sets the selection?
>
> I've added the metamodel, a dummy sample model, and some of
> the custom add-on code which is contained in its own project.
>
> Does anyone see any errors in it?
>
> Ed Merks wrote:
>> Rene,
>>
>> Maybe try setting a breakpoint in the selectionChanged method of each
>> and see how they are called...
>>
>>
>> Rene Ladan wrote:
>>> Ed Merks wrote:
>>>> Rene,
>>>>
>>>> I have an action in
>>>> org.eclipse.emf.ecore.action.CreateDynamicInstance that works fine
>>>> with M7. I suppose you could check in the debugger why that's
>>>> being called with a valid selection (it's a popup action on an
>>>> EClass) but your action is not..
>>>>
>>> I've changed the file a bit to look like CreateDynamicInstanceAction
>>> (unfinalize
>>> method parameters, extend ActionDelegate, add a constructor which
>>> calls super() ),
>>> but the parameter 'selection' is still null upon entering
>>> selectionChanged().
>>>
>>> Any ideas?
>>>
>>> Rene
>>>
>>>> Rene Ladan wrote:
>>>>> Hi,
>>>>>
>>>>> I have a program which implements IActionDelegate (i.e. it defines
>>>>> both run() and selectionChanged() ).
>>>>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>>>>> Eclipse 3.4M7/EMF 2.4M7 , because
>>>>> according to the implemented selectionChanged(), selection is
>>>>> always null, even if something is selection
>>>>> when calling the method. There are no compile/build errors.
>>>>>
>>>>> I've attached the backtrace and the part which implements
>>>>> IActionDelegate.
>>>>>
>>>>> Am I doing something wrong?
>>>>>
>>>>> Regards,
>>>>> Rene
>>>
>


--------------030805090507020904010405
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Rene,<br>
<br>
When the generated editor's setSelection is called, anything listening
to the editor's selection provider should be notified.&nbsp; All those
actions you mention listen for that. I have two days of <a
href="http://wiki.eclipse.org/E4/Summit">e4 </a>meetings, so I'm not
sure when I will get to trying out your example...&nbsp; Given that the
selection is getting to all these other actions, there must be
something specific about your action that's different from all these
others.&nbsp; Is your action in this sample code?<br>
<br>
<br>
Rene Ladan wrote:
<blockquote cite="mid:g13d65$ink$1@build.eclipse.org" type="cite">I
completely regenerated the model, edit, and editor code and resources
to be sure that
<br>
there were no leftovers which could cause problems, but the selection
returned from
<br>
IActionDelegate.selectionChanged() is still null.
<br>
<br>
Upon loading the model, the topmost element is selected,
getContentOutlinePage()
<br>
tells that this is an org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl,
which causes
<br>
handleContentOutlineSelection() to ignore this element, because it is
not an instance
<br>
of IStructuredSelection.
<br>
<br>
If I click on the element of type Meta.meta (the first child of
XMIResourceImpl),
<br>
these listeners are informed:
<br>
&nbsp;org.eclipse.emf.edit.ui.action.DeleteAction@13c339f
<br>
&nbsp;org.eclipse.emf.edit.ui.action.CutAction@1612600
<br>
&nbsp;org.eclipse.emf.edit.ui.action.CopyAction@105e560
<br>
&nbsp;org.eclipse.emf.edit.ui.action.PasteAction@1641c0
<br>
&nbsp;org.eclipse.emf.edit.ui.action.ValidateAction@136ab79
<br>
&nbsp;org.eclipse.emf.edit.ui.action.ControlAction@33c1aa
<br>
&nbsp;meta.presentation.MetaActionBarContributor@1efa3e7
<br>
&nbsp;org.eclipse.ui.internal.AbstractSelectionService$1@1f1cc1a
<br>
&nbsp;org.eclipse.ui.internal.AbstractSelectionService$2@18eef25
<br>
&nbsp;org.eclipse.ui.internal.AbstractSelectionService$1@f67d81
<br>
&nbsp;org.eclipse.ui.internal.AbstractSelectionService$2@a9a1ac
<br>
<br>
Are these listeners involved in setting the selection, if not,
<br>
what sets the selection?
<br>
<br>
I've added the metamodel, a dummy sample model, and some of
<br>
the custom add-on code which is contained in its own project.
<br>
<br>
Does anyone see any errors in it?
<br>
<br>
Ed Merks wrote:
<br>
<blockquote type="cite">Rene,
<br>
<br>
Maybe try setting a breakpoint in the selectionChanged method of each
and see how they are called...
<br>
<br>
<br>
Rene Ladan wrote:
<br>
<blockquote type="cite">Ed Merks wrote:
<br>
<blockquote type="cite">Rene,
<br>
<br>
I have an action in org.eclipse.emf.ecore.action.CreateDynamicInstance
that works fine with M7.&nbsp; I suppose you could check in the debugger why
that's being called with a valid selection (it's a popup action on an
EClass) but your action is not..
<br>
&nbsp;
<br>
</blockquote>
I've changed the file a bit to look like CreateDynamicInstanceAction
(unfinalize
<br>
method parameters, extend ActionDelegate, add a constructor which calls
super() ),
<br>
but the parameter 'selection' is still null upon entering
selectionChanged().
<br>
<br>
Any ideas?
<br>
<br>
Rene
<br>
<br>
<blockquote type="cite">Rene Ladan wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
I have a program which implements IActionDelegate (i.e. it defines both
run() and selectionChanged() ).
<br>
This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with Eclipse
3.4M7/EMF 2.4M7 , because
<br>
according to the implemented selectionChanged(), selection is always
null, even if something is selection
<br>
when calling the method.&nbsp; There are no compile/build errors.
<br>
<br>
I've attached the backtrace and the part which implements
IActionDelegate.
<br>
<br>
Am I doing something wrong?
<br>
<br>
Regards,
<br>
Rene
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>

--------------030805090507020904010405--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: IactionDelegate.selectionChanged returns null? [message #419437 is a reply to message #419430] Thu, 22 May 2008 12:06 Go to previous messageGo to next message
Rene Ladan is currently offline Rene LadanFriend
Messages: 51
Registered: July 2009
Member
Ed Merks wrote:
> Rene,
>
> When the generated editor's setSelection is called, anything listening
> to the editor's selection provider should be notified. All those
> actions you mention listen for that.

> Given that the selection is getting
> to all these other actions, there must be something specific about your
> action that's different from all these others. Is your action in this
> sample code?
Yes, just press Ctrl+Alt+A when the element 'meta' in the sample model is
selected. I get 'selection=null' in the console.

>
>
> Rene Ladan wrote:
>> I completely regenerated the model, edit, and editor code and
>> resources to be sure that
>> there were no leftovers which could cause problems, but the selection
>> returned from
>> IActionDelegate.selectionChanged() is still null.
>>
>> Upon loading the model, the topmost element is selected,
>> getContentOutlinePage()
>> tells that this is an org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl,
>> which causes
>> handleContentOutlineSelection() to ignore this element, because it is
>> not an instance
>> of IStructuredSelection.
>>
>> If I click on the element of type Meta.meta (the first child of
>> XMIResourceImpl),
>> these listeners are informed:
>> org.eclipse.emf.edit.ui.action.DeleteAction@13c339f
>> org.eclipse.emf.edit.ui.action.CutAction@1612600
>> org.eclipse.emf.edit.ui.action.CopyAction@105e560
>> org.eclipse.emf.edit.ui.action.PasteAction@1641c0
>> org.eclipse.emf.edit.ui.action.ValidateAction@136ab79
>> org.eclipse.emf.edit.ui.action.ControlAction@33c1aa
>> meta.presentation.MetaActionBarContributor@1efa3e7
>> org.eclipse.ui.internal.AbstractSelectionService$1@1f1cc1a
>> org.eclipse.ui.internal.AbstractSelectionService$2@18eef25
>> org.eclipse.ui.internal.AbstractSelectionService$1@f67d81
>> org.eclipse.ui.internal.AbstractSelectionService$2@a9a1ac
>>
>> Are these listeners involved in setting the selection, if not,
>> what sets the selection?
>>
>> I've added the metamodel, a dummy sample model, and some of
>> the custom add-on code which is contained in its own project.
>>
>> Does anyone see any errors in it?
>>
>> Ed Merks wrote:
>>> Rene,
>>>
>>> Maybe try setting a breakpoint in the selectionChanged method of each
>>> and see how they are called...
>>>
>>>
>>> Rene Ladan wrote:
>>>> Ed Merks wrote:
>>>>> Rene,
>>>>>
>>>>> I have an action in
>>>>> org.eclipse.emf.ecore.action.CreateDynamicInstance that works fine
>>>>> with M7. I suppose you could check in the debugger why that's
>>>>> being called with a valid selection (it's a popup action on an
>>>>> EClass) but your action is not..
>>>>>
>>>> I've changed the file a bit to look like CreateDynamicInstanceAction
>>>> (unfinalize
>>>> method parameters, extend ActionDelegate, add a constructor which
>>>> calls super() ),
>>>> but the parameter 'selection' is still null upon entering
>>>> selectionChanged().
>>>>
>>>> Any ideas?
>>>>
>>>> Rene
>>>>
>>>>> Rene Ladan wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I have a program which implements IActionDelegate (i.e. it defines
>>>>>> both run() and selectionChanged() ).
>>>>>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>>>>>> Eclipse 3.4M7/EMF 2.4M7 , because
>>>>>> according to the implemented selectionChanged(), selection is
>>>>>> always null, even if something is selection
>>>>>> when calling the method. There are no compile/build errors.
>>>>>>
>>>>>> I've attached the backtrace and the part which implements
>>>>>> IActionDelegate.
>>>>>>
>>>>>> Am I doing something wrong?
>>>>>>
>>>>>> Regards,
>>>>>> Rene
>>>>
>>
>
Re: IactionDelegate.selectionChanged returns null? [message #419464 is a reply to message #419437] Fri, 23 May 2008 01:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Rene,

The room I was in today didn't allow newsgroup access. I'll hopefully
get a chance to try this tomorrow.


Rene Ladan wrote:
> Ed Merks wrote:
>> Rene,
>>
>> When the generated editor's setSelection is called, anything
>> listening to the editor's selection provider should be notified. All
>> those actions you mention listen for that.
>
>> Given that the selection is getting to all these other actions, there
>> must be something specific about your action that's different from
>> all these others. Is your action in this sample code?
> Yes, just press Ctrl+Alt+A when the element 'meta' in the sample model is
> selected. I get 'selection=null' in the console.
>
>>
>>
>> Rene Ladan wrote:
>>> I completely regenerated the model, edit, and editor code and
>>> resources to be sure that
>>> there were no leftovers which could cause problems, but the
>>> selection returned from
>>> IActionDelegate.selectionChanged() is still null.
>>>
>>> Upon loading the model, the topmost element is selected,
>>> getContentOutlinePage()
>>> tells that this is an
>>> org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl, which causes
>>> handleContentOutlineSelection() to ignore this element, because it
>>> is not an instance
>>> of IStructuredSelection.
>>>
>>> If I click on the element of type Meta.meta (the first child of
>>> XMIResourceImpl),
>>> these listeners are informed:
>>> org.eclipse.emf.edit.ui.action.DeleteAction@13c339f
>>> org.eclipse.emf.edit.ui.action.CutAction@1612600
>>> org.eclipse.emf.edit.ui.action.CopyAction@105e560
>>> org.eclipse.emf.edit.ui.action.PasteAction@1641c0
>>> org.eclipse.emf.edit.ui.action.ValidateAction@136ab79
>>> org.eclipse.emf.edit.ui.action.ControlAction@33c1aa
>>> meta.presentation.MetaActionBarContributor@1efa3e7
>>> org.eclipse.ui.internal.AbstractSelectionService$1@1f1cc1a
>>> org.eclipse.ui.internal.AbstractSelectionService$2@18eef25
>>> org.eclipse.ui.internal.AbstractSelectionService$1@f67d81
>>> org.eclipse.ui.internal.AbstractSelectionService$2@a9a1ac
>>>
>>> Are these listeners involved in setting the selection, if not,
>>> what sets the selection?
>>>
>>> I've added the metamodel, a dummy sample model, and some of
>>> the custom add-on code which is contained in its own project.
>>>
>>> Does anyone see any errors in it?
>>>
>>> Ed Merks wrote:
>>>> Rene,
>>>>
>>>> Maybe try setting a breakpoint in the selectionChanged method of
>>>> each and see how they are called...
>>>>
>>>>
>>>> Rene Ladan wrote:
>>>>> Ed Merks wrote:
>>>>>> Rene,
>>>>>>
>>>>>> I have an action in
>>>>>> org.eclipse.emf.ecore.action.CreateDynamicInstance that works
>>>>>> fine with M7. I suppose you could check in the debugger why
>>>>>> that's being called with a valid selection (it's a popup action
>>>>>> on an EClass) but your action is not..
>>>>>>
>>>>> I've changed the file a bit to look like
>>>>> CreateDynamicInstanceAction (unfinalize
>>>>> method parameters, extend ActionDelegate, add a constructor which
>>>>> calls super() ),
>>>>> but the parameter 'selection' is still null upon entering
>>>>> selectionChanged().
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> Rene
>>>>>
>>>>>> Rene Ladan wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have a program which implements IActionDelegate (i.e. it
>>>>>>> defines both run() and selectionChanged() ).
>>>>>>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>>>>>>> Eclipse 3.4M7/EMF 2.4M7 , because
>>>>>>> according to the implemented selectionChanged(), selection is
>>>>>>> always null, even if something is selection
>>>>>>> when calling the method. There are no compile/build errors.
>>>>>>>
>>>>>>> I've attached the backtrace and the part which implements
>>>>>>> IActionDelegate.
>>>>>>>
>>>>>>> Am I doing something wrong?
>>>>>>>
>>>>>>> Regards,
>>>>>>> Rene
>>>>>
>>>
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: IactionDelegate.selectionChanged returns null? [message #419504 is a reply to message #419464] Sun, 25 May 2008 12:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Rene,

I don't see anything obviously wrong with the code, but this confuses me:

<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
adaptable="false"
id="mt-test.diagram.custom.objectContribution1"
objectClass="meta.custom.MetaEditor">
<action
class="meta.custom.MetaEditor"

Compare that to this where objectClass on <objectContribution> is the
type of object to which the popup applies:

<objectContribution
id="org.eclipse.emf.ecore.editor.CreateDynamicInstance"
objectClass="org.eclipse.emf.ecore.EClass">
<action
id="org.eclipse.emf.ecore.editor.CreateDynamicInstanceAction "
label="%_UI_CreateDynamicInstance_menu_item"
menubarPath="additions"

class="org.eclipse.emf.ecore.action.CreateDynamicInstanceAction "

It's like your action only applies to itself. To me that seems more
than a little suspect...


Ed Merks wrote:
> Rene,
>
> The room I was in today didn't allow newsgroup access. I'll hopefully
> get a chance to try this tomorrow.
>
>
> Rene Ladan wrote:
>> Ed Merks wrote:
>>> Rene,
>>>
>>> When the generated editor's setSelection is called, anything
>>> listening to the editor's selection provider should be notified.
>>> All those actions you mention listen for that.
>>
>>> Given that the selection is getting to all these other actions,
>>> there must be something specific about your action that's different
>>> from all these others. Is your action in this sample code?
>> Yes, just press Ctrl+Alt+A when the element 'meta' in the sample
>> model is
>> selected. I get 'selection=null' in the console.
>>
>>>
>>>
>>> Rene Ladan wrote:
>>>> I completely regenerated the model, edit, and editor code and
>>>> resources to be sure that
>>>> there were no leftovers which could cause problems, but the
>>>> selection returned from
>>>> IActionDelegate.selectionChanged() is still null.
>>>>
>>>> Upon loading the model, the topmost element is selected,
>>>> getContentOutlinePage()
>>>> tells that this is an
>>>> org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl, which causes
>>>> handleContentOutlineSelection() to ignore this element, because it
>>>> is not an instance
>>>> of IStructuredSelection.
>>>>
>>>> If I click on the element of type Meta.meta (the first child of
>>>> XMIResourceImpl),
>>>> these listeners are informed:
>>>> org.eclipse.emf.edit.ui.action.DeleteAction@13c339f
>>>> org.eclipse.emf.edit.ui.action.CutAction@1612600
>>>> org.eclipse.emf.edit.ui.action.CopyAction@105e560
>>>> org.eclipse.emf.edit.ui.action.PasteAction@1641c0
>>>> org.eclipse.emf.edit.ui.action.ValidateAction@136ab79
>>>> org.eclipse.emf.edit.ui.action.ControlAction@33c1aa
>>>> meta.presentation.MetaActionBarContributor@1efa3e7
>>>> org.eclipse.ui.internal.AbstractSelectionService$1@1f1cc1a
>>>> org.eclipse.ui.internal.AbstractSelectionService$2@18eef25
>>>> org.eclipse.ui.internal.AbstractSelectionService$1@f67d81
>>>> org.eclipse.ui.internal.AbstractSelectionService$2@a9a1ac
>>>>
>>>> Are these listeners involved in setting the selection, if not,
>>>> what sets the selection?
>>>>
>>>> I've added the metamodel, a dummy sample model, and some of
>>>> the custom add-on code which is contained in its own project.
>>>>
>>>> Does anyone see any errors in it?
>>>>
>>>> Ed Merks wrote:
>>>>> Rene,
>>>>>
>>>>> Maybe try setting a breakpoint in the selectionChanged method of
>>>>> each and see how they are called...
>>>>>
>>>>>
>>>>> Rene Ladan wrote:
>>>>>> Ed Merks wrote:
>>>>>>> Rene,
>>>>>>>
>>>>>>> I have an action in
>>>>>>> org.eclipse.emf.ecore.action.CreateDynamicInstance that works
>>>>>>> fine with M7. I suppose you could check in the debugger why
>>>>>>> that's being called with a valid selection (it's a popup action
>>>>>>> on an EClass) but your action is not..
>>>>>>>
>>>>>> I've changed the file a bit to look like
>>>>>> CreateDynamicInstanceAction (unfinalize
>>>>>> method parameters, extend ActionDelegate, add a constructor which
>>>>>> calls super() ),
>>>>>> but the parameter 'selection' is still null upon entering
>>>>>> selectionChanged().
>>>>>>
>>>>>> Any ideas?
>>>>>>
>>>>>> Rene
>>>>>>
>>>>>>> Rene Ladan wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have a program which implements IActionDelegate (i.e. it
>>>>>>>> defines both run() and selectionChanged() ).
>>>>>>>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>>>>>>>> Eclipse 3.4M7/EMF 2.4M7 , because
>>>>>>>> according to the implemented selectionChanged(), selection is
>>>>>>>> always null, even if something is selection
>>>>>>>> when calling the method. There are no compile/build errors.
>>>>>>>>
>>>>>>>> I've attached the backtrace and the part which implements
>>>>>>>> IActionDelegate.
>>>>>>>>
>>>>>>>> Am I doing something wrong?
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> Rene
>>>>>>
>>>>
>>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: IactionDelegate.selectionChanged returns null? [message #419549 is a reply to message #419504] Tue, 27 May 2008 08:14 Go to previous message
Rene Ladan is currently offline Rene LadanFriend
Messages: 51
Registered: July 2009
Member
Hi Ed,

I have it working again :) The only thing is that the hotkey (Ctrl+Alt+A)
doesn't work, but selecting the action from the context menu does. I suspect
it's because the key is not properly 'connected' in the plugin.xml file.
It's not that bad, since the tool is not of commercial quality anyway.

Rene

Ed Merks wrote:
> Rene,
>
> I don't see anything obviously wrong with the code, but this confuses me:
>
> <extension
> point="org.eclipse.ui.popupMenus">
> <objectContribution
> adaptable="false"
> id="mt-test.diagram.custom.objectContribution1"
> objectClass="meta.custom.MetaEditor">
> <action
> class="meta.custom.MetaEditor"
>
> Compare that to this where objectClass on <objectContribution> is the
> type of object to which the popup applies:
>
> <objectContribution
> id="org.eclipse.emf.ecore.editor.CreateDynamicInstance"
> objectClass="org.eclipse.emf.ecore.EClass">
> <action
> id="org.eclipse.emf.ecore.editor.CreateDynamicInstanceAction "
> label="%_UI_CreateDynamicInstance_menu_item"
> menubarPath="additions"
>
> class="org.eclipse.emf.ecore.action.CreateDynamicInstanceAction "
>
> It's like your action only applies to itself. To me that seems more
> than a little suspect...
>
>
> Ed Merks wrote:
>> Rene,
>>
>> The room I was in today didn't allow newsgroup access. I'll hopefully
>> get a chance to try this tomorrow.
>>
>>
>> Rene Ladan wrote:
>>> Ed Merks wrote:
>>>> Rene,
>>>>
>>>> When the generated editor's setSelection is called, anything
>>>> listening to the editor's selection provider should be notified.
>>>> All those actions you mention listen for that.
>>>
>>>> Given that the selection is getting to all these other actions,
>>>> there must be something specific about your action that's different
>>>> from all these others. Is your action in this sample code?
>>> Yes, just press Ctrl+Alt+A when the element 'meta' in the sample
>>> model is
>>> selected. I get 'selection=null' in the console.
>>>
>>>>
>>>>
>>>> Rene Ladan wrote:
>>>>> I completely regenerated the model, edit, and editor code and
>>>>> resources to be sure that
>>>>> there were no leftovers which could cause problems, but the
>>>>> selection returned from
>>>>> IActionDelegate.selectionChanged() is still null.
>>>>>
>>>>> Upon loading the model, the topmost element is selected,
>>>>> getContentOutlinePage()
>>>>> tells that this is an
>>>>> org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl, which causes
>>>>> handleContentOutlineSelection() to ignore this element, because it
>>>>> is not an instance
>>>>> of IStructuredSelection.
>>>>>
>>>>> If I click on the element of type Meta.meta (the first child of
>>>>> XMIResourceImpl),
>>>>> these listeners are informed:
>>>>> org.eclipse.emf.edit.ui.action.DeleteAction@13c339f
>>>>> org.eclipse.emf.edit.ui.action.CutAction@1612600
>>>>> org.eclipse.emf.edit.ui.action.CopyAction@105e560
>>>>> org.eclipse.emf.edit.ui.action.PasteAction@1641c0
>>>>> org.eclipse.emf.edit.ui.action.ValidateAction@136ab79
>>>>> org.eclipse.emf.edit.ui.action.ControlAction@33c1aa
>>>>> meta.presentation.MetaActionBarContributor@1efa3e7
>>>>> org.eclipse.ui.internal.AbstractSelectionService$1@1f1cc1a
>>>>> org.eclipse.ui.internal.AbstractSelectionService$2@18eef25
>>>>> org.eclipse.ui.internal.AbstractSelectionService$1@f67d81
>>>>> org.eclipse.ui.internal.AbstractSelectionService$2@a9a1ac
>>>>>
>>>>> Are these listeners involved in setting the selection, if not,
>>>>> what sets the selection?
>>>>>
>>>>> I've added the metamodel, a dummy sample model, and some of
>>>>> the custom add-on code which is contained in its own project.
>>>>>
>>>>> Does anyone see any errors in it?
>>>>>
>>>>> Ed Merks wrote:
>>>>>> Rene,
>>>>>>
>>>>>> Maybe try setting a breakpoint in the selectionChanged method of
>>>>>> each and see how they are called...
>>>>>>
>>>>>>
>>>>>> Rene Ladan wrote:
>>>>>>> Ed Merks wrote:
>>>>>>>> Rene,
>>>>>>>>
>>>>>>>> I have an action in
>>>>>>>> org.eclipse.emf.ecore.action.CreateDynamicInstance that works
>>>>>>>> fine with M7. I suppose you could check in the debugger why
>>>>>>>> that's being called with a valid selection (it's a popup action
>>>>>>>> on an EClass) but your action is not..
>>>>>>>>
>>>>>>> I've changed the file a bit to look like
>>>>>>> CreateDynamicInstanceAction (unfinalize
>>>>>>> method parameters, extend ActionDelegate, add a constructor which
>>>>>>> calls super() ),
>>>>>>> but the parameter 'selection' is still null upon entering
>>>>>>> selectionChanged().
>>>>>>>
>>>>>>> Any ideas?
>>>>>>>
>>>>>>> Rene
>>>>>>>
>>>>>>>> Rene Ladan wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I have a program which implements IActionDelegate (i.e. it
>>>>>>>>> defines both run() and selectionChanged() ).
>>>>>>>>> This used to work with Eclipse 3.3.2/EMF 2.3, but it fails with
>>>>>>>>> Eclipse 3.4M7/EMF 2.4M7 , because
>>>>>>>>> according to the implemented selectionChanged(), selection is
>>>>>>>>> always null, even if something is selection
>>>>>>>>> when calling the method. There are no compile/build errors.
>>>>>>>>>
>>>>>>>>> I've attached the backtrace and the part which implements
>>>>>>>>> IActionDelegate.
>>>>>>>>>
>>>>>>>>> Am I doing something wrong?
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>> Rene
>>>>>>>
>>>>>
>>>>
Previous Topic:Setting the text color of the tree label provider
Next Topic:Profile DataType uml editor
Goto Forum:
  


Current Time: Fri Apr 26 21:47:36 GMT 2024

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

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

Back to the top