|
Re: Using own EditorInput for generated (Bpmn)DiagramEditor [message #619000 is a reply to message #618998] |
Wed, 03 September 2008 15:35 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
What you need is not to override the EditorInput, but the document provider.
If you override the setDocumentProvider method and subclass
BpmnDocumentProvider, you can then override the saveDocumentToFile and
setDocumentContentFromStorage method to do more things.
I hope it will fit with your scenario.
Thanks,
Antoine
Till Essers wrote:
> Hi
>
> I want to define my own EditorInput for use with the BpmnDiagramEditor
> from the STP package.
> This is becaus of the files aren't located on the local machine but on
> an archive server. So I have to store them locally on load and send them
> back on saving. Even though I need some more information when starting
> the editor and filling the palette.
>
> My first thought was to subclass FileEditorInput, but I don't understand
> when the actual file is being loaded, nor how I could load the files
> from the server if it is being loaded inside the editor.
> If done quite a lot googling, been searching the newsgroups and the
> eclipse help site, but I don't know how to start with this task.
>
> Thanks in advance,
> Till
|
|
|
|
Re: Using own EditorInput for generated (Bpmn)DiagramEditor [message #619012 is a reply to message #619003] |
Fri, 05 September 2008 11:17 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
Till Essers wrote:
> If I'm right I could create my own EditorInput (create class
> implementing IEditorInput) and register my own DocumentProvider to
> handle the data?
Yep.
> Besides this I would have the advantage to pass my own object with
> aditional data to the editor and will have it available in the
> PaletteProvider too?
I think so, I don't know what you do with the palette provider so I
can't be too affirmative :)
> That would solve every problem I have right now ;)
That's good to hear!
>
> Antoine Toulme schrieb:
>> What you need is not to override the EditorInput, but the document
>> provider.
>>
>> If you override the setDocumentProvider method and subclass
>> BpmnDocumentProvider, you can then override the saveDocumentToFile and
>> setDocumentContentFromStorage method to do more things.
>>
>> I hope it will fit with your scenario.
>>
>> Thanks,
>>
>> Antoine
>>
>> Till Essers wrote:
>>> Hi
>>>
>>> I want to define my own EditorInput for use with the
>>> BpmnDiagramEditor from the STP package.
>>> This is becaus of the files aren't located on the local machine but
>>> on an archive server. So I have to store them locally on load and
>>> send them back on saving. Even though I need some more information
>>> when starting the editor and filling the palette.
>>>
>>> My first thought was to subclass FileEditorInput, but I don't
>>> understand when the actual file is being loaded, nor how I could load
>>> the files from the server if it is being loaded inside the editor.
>>> If done quite a lot googling, been searching the newsgroups and the
>>> eclipse help site, but I don't know how to start with this task.
>>>
>>> Thanks in advance,
>>> Till
|
|
|
|
Re: Using own EditorInput for generated (Bpmn)DiagramEditor [message #619021 is a reply to message #619016] |
Fri, 05 September 2008 12:49 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
Till Essers wrote:
> Antoine Toulme schrieb:
>>> Besides this I would have the advantage to pass my own object with
>>> aditional data to the editor and will have it available in the
>>> PaletteProvider too?
>> I think so, I don't know what you do with the palette provider so I
>> can't be too affirmative :)
> I have to filter the palette to only show items which are allowed by our
> server. This is due to the fact you can put rights on each object.
> It is working right now, but I think I should work with my own factory
> here instead of throwing have of the palette away ;)
You can provide your own palette factory this way:
<extension point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders" >
<paletteProvider
class="com.acme.bpmn.part.IntalioBpmnPaletteProvider">
<Priority name="Lowest"/>
<editor id="com.acme.bpmn.editor"/>
</paletteProvider>
</extension>
That's all GMF stuff.
>
> Do I really have to handle the palette and the popup toolbar and end
> connections menus diffrently?
We did not find a way to unify those just yet, but of course if you feel
like helping on that end we'll take patches.
Also the thing is that palette items are different from the popup
toolbar and the connections. For the first, you need to know what you
want to show. For the latters, you can use the edit policies to forbid
the creation of the element.
> Does chaning an edit domain doesn't affect the palette?
I don't know.
>
> Thanks for your help (once again :))
>
> Till
>
> PS: Nice to have such a responsive and helpfull newsgroup/developer!
Thanks!
|
|
|
Powered by
FUDForum. Page generated in 0.03593 seconds