How do we use o.e.gmf.r.common.ui.services.editorProviders ? [message #111617] |
Tue, 13 March 2007 14:45  |
Eclipse User |
|
|
|
Originally posted by: NOSPAM.xyz.com
Has anybody ever used it?
Why doesn't the generated editor use it?
I couldn't find any trace of info about it apart the
ext.point description, but it seems inconsistent to me.
So I put together the following snippets myself:
<extension
point="org.eclipse.gmf.runtime.common.ui.services.editorProviders ">
<EditorProvider
class="exp.diagram.custom.providers.MyLEditorProvider">
<Priority name="Highest"/>
<Policy class="exp.diagram.custom.providers.MyEditorProvider"/>
</EditorProvider>
</extension>
import org.eclipse.gmf.runtime.common.core.service.IProviderPolicy;
import
org.eclipse.gmf.runtime.common.ui.services.editor.AbstractEd itorProvider;
public class MyEditorProvider extends AbstractEditorProvider implements
IProviderPolicy {
.... and so on...
}
Unfortunately none of the methods of AbstractEditorProvider and / or
IProviderPolicy
ever gets called !?
Any comment from somebody more experienced than me?
|
|
|
|
|
Re: How do we use o.e.gmf.r.common.ui.services.editorProviders ? [message #176523 is a reply to message #113873] |
Mon, 10 March 2008 04:52  |
Eclipse User |
|
|
|
Hi,
I'm having the same problem: I registered an EditorProvider (exactly as
Vlad did), but the provider would never be called. I've overwritten the
provider's constructor and set a breakpoint, but it's not even instantiated.
What am I doing wrong? Do I have to provide a policy (Vlad didn't)? Are
there any examples on how to use this extension point?
Thanks,
Chris
Marian schrieb:
> Thanks Vlad,
> the only difference between yours and mine snippets is that
> I was too punctual and payed attention to the Policy about
> which the ext .pnt. description says:
>
> <!ELEMENT Policy EMPTY>
> <!ATTLIST Policy
> class CDATA #REQUIRED>
>
> I'll try it your way
>
>
> "Vlad Ciubotariu" <vcciubot@uwaterloo.ca> wrote in message
> news:pan.2007.03.18.22.10.05.604288@uwaterloo.ca...
>> I've used it to open diagram nodes in a separate window:
>>
>> <extension
>>
>> point="org.eclipse.gmf.runtime.common.ui.services.editorProviders ">
>> <EditorProvider
>> class=" ca.uwaterloo.watform.bluenose2.diagram.part.Bluenose2Diagram EditorProvider ">
>> <Priority name="Lowest"/>
>> </EditorProvider>
>> </extension>
>>
>> package ca.uwaterloo.watform.bluenose2.diagram.part;
>>
>> import
>> org.eclipse.gmf.runtime.common.ui.services.editor.AbstractEd itorProvider;
>>
>> public class Bluenose2DiagramEditorProvider extends AbstractEditorProvider
>> {
>>
>> @Override
>> protected boolean canOpen(IEditorInput editorInput) {
>> if (editorInput instanceof IDiagramEditorInput) {
>> IDiagramEditorInput diagramInput = (IDiagramEditorInput) editorInput;
>> Diagram diagram = diagramInput.getDiagram();
>> if (diagram != null/* && diagram.getType().equals("Bluenose2")*/) {
>> return true;
>> }
>> }
>>
>> return false;
>> }
>>
>> @Override
>> protected String getEditorId(IEditorInput editorInput) {
>> return
>> " ca.uwaterloo.watform.bluenose2.diagram.part.Bluenose2Diagram EditorID ";
>> }
>>
>> }
>>
>> vlad
>>
>> On Tue, 13 Mar 2007 13:45:40 -0500, Marian wrote:
>>
>>> Has anybody ever used it?
>>> Why doesn't the generated editor use it?
>>> I couldn't find any trace of info about it apart the
>>> ext.point description, but it seems inconsistent to me.
>>> So I put together the following snippets myself:
>>>
>>> <extension
>>> point="org.eclipse.gmf.runtime.common.ui.services.editorProviders ">
>>> <EditorProvider
>>> class="exp.diagram.custom.providers.MyLEditorProvider">
>>> <Priority name="Highest"/>
>>> <Policy class="exp.diagram.custom.providers.MyEditorProvider"/>
>>> </EditorProvider>
>>> </extension>
>>>
>>> import org.eclipse.gmf.runtime.common.core.service.IProviderPolicy;
>>> import
>>> org.eclipse.gmf.runtime.common.ui.services.editor.AbstractEd itorProvider;
>>>
>>> public class MyEditorProvider extends AbstractEditorProvider implements
>>> IProviderPolicy {
>>> ... and so on...
>>> }
>>>
>>> Unfortunately none of the methods of AbstractEditorProvider and / or
>>> IProviderPolicy
>>> ever gets called !?
>>> Any comment from somebody more experienced than me?
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03541 seconds