Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How do we use o.e.gmf.r.common.ui.services.editorProviders ?
How do we use o.e.gmf.r.common.ui.services.editorProviders ? [message #111617] Tue, 13 March 2007 18:45 Go to next message
Eclipse UserFriend
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 #112696 is a reply to message #111617] Sun, 18 March 2007 22:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vcciubot.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?
Re: How do we use o.e.gmf.r.common.ui.services.editorProviders ? [message #113873 is a reply to message #112696] Thu, 22 March 2007 23:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: NOSPAM.xyz.com

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?
>
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 08:52 Go to previous message
chris is currently offline chrisFriend
Messages: 72
Registered: July 2009
Member
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?
>
>
Previous Topic:how to store ListenerFilters persistent
Next Topic:Showing non-containment features readonly
Goto Forum:
  


Current Time: Fri Apr 26 00:43:32 GMT 2024

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

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

Back to the top