How do we use o.e.gmf.r.common.ui.services.editorProviders ? [message #111617] |
Tue, 13 March 2007 18: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 #112696 is a reply to message #111617] |
Sun, 18 March 2007 22:10 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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?
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03334 seconds