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  |
Eclipse User |
|
|
|
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 #317227 is a reply to message #317225] |
Thu, 28 June 2007 13:39  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04258 seconds