Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » HELP: need 2 different editModels for 2 projects having file with same filename.ext (but different c
HELP: need 2 different editModels for 2 projects having file with same filename.ext (but different c [message #317167] Wed, 27 June 2007 09:58 Go to next message
Eclipse UserFriend
I have 2 plugins with different editors and edit models which need to
operate on the *same* filename (sip.xml) but for files with *different*
version contents (different internal models). Within each of the 2 editor
plugin.xml I have been sucessful in defining 2 different contentTypes and
using those contentTypes to conditionally control which editor is launched
(i.e. not just dependent on filename.ext), and I have been sucessful in
defining 2 different navigator contributions dependent on triggerpoints for
the containing project/facet/nature.

Where I am stumped is in defining an editor editModel which is dependent on
*more* than the filename.ext (i.e. dependent on the file contentType, and/or
dependent on the containing project facet/version/nature, etc).

Right now, since both editors have the same editModelResource
(filename.ext), whichever one is invoked first loads its editModel (and
works OK), but the 2nd one then gets the first editModel (not its 2nd
editModel) and causes classCastExceptions.

So, the fundamental question is how can I tie an editModel to *more* than
filename.ext (i.e. to its containing project facet/version/nature, and/or to
its contentType, etc) ?
- if that is not possible then is there someway to dynamically purge the
cached editModel and load a different one?

<!-- Sip.xml MODEL editor -->
<extension
point="org.eclipse.wst.common.emfworkbench.integration.editModel ">
<editModel editModelID="jsr116.siptools"
factoryClass=" org.eclipse.jst.common.jdt.internal.integration.JavaArtifact EditModelFactory ">
<editModelResource
autoload="false"
URI="WEB-INF/sip.xml"/>
</editModel>
</extension>
<extension
point="org.eclipse.emf.ecore.generated_package">
<package uri="http:///sipmodel.ecore"
class="com.ibm.siptools.sipmodel.SipModelPackage">
</package>
</extension>
<extension
point="org.eclipse.wst.common.emf.packageURIMap">
<map uri="http:///sipmodel.ecore"
prefix="sipmodel">
</map>
</extension>
<extension
point=" org.eclipse.wst.common.emfworkbench.integration.adapterFacto ry ">
<adapterFactory functionGroupID="org.eclipse.jst.j2ee"
className=" com.ibm.siptools.sipmodel.provider.SipModelItemProviderAdapt erFactory "
packageURI="http:///sipmodel.ecore"
id=" com.ibm.siptools.sipmodel.provider.SipModelItemProviderAdapt erFactory ">
</adapterFactory>
</extension>
Re: HELP: need 2 different editModels for 2 projects having file with same filename.ext (but differe [message #317205 is a reply to message #317167] Thu, 28 June 2007 07:38 Go to previous messageGo to next message
Eclipse UserFriend
So you are saying that your two content types appear correct. If you
open one sip.xml file it opens one editor. If you open the other
sip.xml file it opens the other editor.

But the problem is if you open one sim.xml and then open the other, it
will always pick the first editor it opened for sim.xml?


If that's the case, please open a bug at https://bugs.eclipse.org/bugs/
against Eclipse Platform UI

Are you in 3.2.x or 3.3?

PW
Re: HELP: need 2 different editModels for 2 projects having file with same filename.ext (but differe [message #317225 is a reply to message #317205] Thu, 28 June 2007 12:08 Go to previous messageGo to next message
Eclipse UserFriend
No, each of the editors opens correctly, controlled by their contentType.

BUT, the second editor, when it tries to use its editModel, always gets
the already loaded editModel from the first editor. i.e. Once eclipse loads
an editModel (controlled by the filename.ext as per my original post)
then there is no way for a different editor to use a different editModel
when editing a file with the same filename.ext (even though its contents
and version is different).

i.e. fundamentally I need eclipse loading of editModels to be controlled
by contentType and/or project facet/nature and not just filename.ext
- such that 2 different editors can use 2 different editModels.

"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:f606d2$ams$1@build.eclipse.org...
> So you are saying that your two content types appear correct. If you open
> one sip.xml file it opens one editor. If you open the other sip.xml file
> it opens the other editor.
>
> But the problem is if you open one sim.xml and then open the other, it
> will always pick the first editor it opened for sim.xml?
>
>
> If that's the case, please open a bug at https://bugs.eclipse.org/bugs/
> against Eclipse Platform UI
>
> Are you in 3.2.x or 3.3?
>
> PW
Re: HELP: need 2 different editModels for 2 projects having file with same filename.ext (but differe [message #317227 is a reply to message #317225] Thu, 28 June 2007 13:39 Go to previous message
Eclipse UserFriend
barry searle wrote:
> No, each of the editors opens correctly, controlled by their contentType.
>
> BUT, the second editor, when it tries to use its editModel, always gets
> the already loaded editModel from the first editor. i.e. Once eclipse loads
> an editModel (controlled by the filename.ext as per my original post)
> then there is no way for a different editor to use a different editModel
> when editing a file with the same filename.ext (even though its contents
> and version is different).
>

OK, I'm still not sure what an editModel is, but I'm guessing based on
your original post XML then that it is either EMF or WST based. You
might need to post your original question on the emf group or the
webtools group. http://www.eclipse.org/newsgroups/

Later,
PW
Previous Topic:Resetting dirty status of TextMergeViewer
Next Topic:Error message display in the Project Properties page
Goto Forum:
  


Current Time: Fri Jul 25 23:22:44 EDT 2025

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

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

Back to the top