Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Disable add components
Disable add components [message #93923] Tue, 14 June 2005 04:37 Go to next message
No real name is currently offline No real nameFriend
Messages: 19
Registered: July 2009
Junior Member
Helo guys,

I have extend Visual Editor to support my custom component, there are
few components that i created allows other component to be add into it
(drop another component inside the display), because of my component
extends java.awt.Panel.

I also have some other component that extends java.awt.Container, but i
managed to disable adding stuff into it by using the .override file.
When i tried to do the same thing for a Panel, it wont work.

How to prevent users from dropping a component into my custom component?

Regards,

Memet.

Attached below is the .override file for my component that extends
Container (MyCalendar)

-- begin --

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore"

xmlns:org.eclipse.ve.internal.cde.utility="http:///org/eclipse/ve/internal/cde/utility.ecore"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:event="event.xmi">
<event:Add featureName="eAnnotations">
<addedEObjects
xsi:type=" org.eclipse.ve.internal.cde.decorators:ClassDescriptorDecora tor "
treeViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tTreeEditPart "

graphViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tGraphicalEditPart ">
<graphic
xsi:type="org.eclipse.ve.internal.cde.utility:GIFFileGraphic "
resourceName="platform:/plugin/com.myplugin.ve/icons/MyCalendar.gif "/>
</addedEObjects>
</event:Add>
</xmi:XMI>

-- end --

And this is my component that extends Panel (MyPanel)

-- begin --

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore"

xmlns:org.eclipse.ve.internal.cde.utility="http:///org/eclipse/ve/internal/cde/utility.ecore"

xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore"
xmlns:event="event.xmi">
<event:Add featureName="eAnnotations">
<addedEObjects
xsi:type=" org.eclipse.ve.internal.cde.decorators:ClassDescriptorDecora tor "
treeViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tTreeEditPart "

graphViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tGraphicalEditPart ">
<graphic
xsi:type="org.eclipse.ve.internal.cde.utility:GIFFileGraphic "
resourceName="platform:/plugin/com.myplugin.ve/icons/MyPanel.gif "/>
</addedEObjects>
<addedEObjects xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator"
beanProxyClassName=" com.myplugin.ve/com.myplugin.ide.util.eclipse.ImagePathProxy Adapter "/>

</event:Add>

</xmi:XMI>

-- end --
Re: Disable add components [message #93938 is a reply to message #93923] Tue, 14 June 2005 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

What driver of VE are you running? Is it M2? You may need to do a
Project->Clean all. The caching mechanism for the override files isn't
perfect yet for when things change. It doesn't see all changes. It
sounds like it isn't seeing your new override file. Check the .log file
to see if there are any override loading errors.


--
Thanks,
Rich Kulp
Re: Disable add components [message #94012 is a reply to message #93938] Wed, 15 June 2005 02:40 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 19
Registered: July 2009
Junior Member
Hello Rich,

I'm using M2 with Eclipse RC1 & all other plugin stated in VE download page.

You're right theres error in the log file


!ENTRY org.eclipse.jem.beaninfo 2 0 2005-06-15 10:01:01.609
!MESSAGE Error loading
file"platform:/plugin/com.myplugin.ve/overrides/com/mywidget/ui/ "
!STACK 0
java.lang.IllegalArgumentException: The 'no null' constraint is violated
at org.eclipse.emf.common.util.BasicEList.validate(BasicEList.j ava:171)
at org.eclipse.emf.ecore.util.EcoreEList.validate(EcoreEList.ja va:59)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:664)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:271)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:5 99)
at
com.ibm.etools.emf.event.impl.EventReaderHelper.setValue(Eve ntReaderHelper.java:342)
at
com.ibm.etools.emf.event.impl.EventUtilImpl.replayAdd(EventU tilImpl.java:321)
at
com.ibm.etools.emf.event.impl.EventUtilImpl.replayEvent(Even tUtilImpl.java:225)
at
com.ibm.etools.emf.event.impl.EventUtilImpl.doForwardEvents( EventUtilImpl.java:119)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter$ExtensionDocApplies.run(BeaninfoClassAdapter.java:1041)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter$ExtensionDocApplies.run(BeaninfoClassAdapter.java:1010)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.createOverrideCache(BeaninfoClassAdapter.java:983)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.applyExtensionDocument(BeaninfoClassAdapter.java:954)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.introspect(BeaninfoClassAdapter.java:680)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.introspectIfNecessary(BeaninfoClassAdapter.java:472)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.introspectIfNecessary(BeaninfoClassAdapter.java:459)
at
org.eclipse.jem.java.impl.JavaClassImpl.getEAnnotations(Java ClassImpl.java:387)
at
org.eclipse.ve.internal.cde.emf.ClassDecoratorSourceIterator .findDecorator(ClassDecoratorSourceIterator.java:37)
at
org.eclipse.ve.internal.cde.emf.ClassDecoratorIterator.initi alize(ClassDecoratorIterator.java:47)
at
org.eclipse.ve.internal.cde.emf.ClassDecoratorSourceIterator . <init>(ClassDecoratorSourceIterator.java:33)
at
org.eclipse.ve.internal.cde.emf.ClassDecoratorFeatureAccess. getDecoratorWithFeature(ClassDecoratorFeatureAccess.java:67)
at
org.eclipse.ve.internal.java.codegen.java.rules.InstanceVari ableCreationRule.getDefaultBooleanValue(InstanceVariableCrea tionRule.java:72)
at
org.eclipse.ve.internal.java.codegen.java.rules.InstanceVari ableCreationRule.isModelled(InstanceVariableCreationRule.jav a:99)
at
org.eclipse.ve.internal.java.codegen.java.rules.InstanceVari ableRule.isModelled(InstanceVariableRule.java:114)
at
org.eclipse.ve.internal.java.codegen.java.rules.InstanceVari ableRule.ignoreVariable(InstanceVariableRule.java:46)
at
org.eclipse.ve.internal.java.codegen.java.TypeVisitor.visit( TypeVisitor.java:160)
at
org.eclipse.ve.internal.java.codegen.java.JavaBeanModelBuild er.visitType(JavaBeanModelBuilder.java:502)
at
org.eclipse.ve.internal.java.codegen.java.JavaBeanModelBuild er.build(JavaBeanModelBuilder.java:407)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslat or.reverseParse(JavaSourceTranslator.java:851)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslat or.decodeDocument(JavaSourceTranslator.java:931)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslat or.loadModel(JavaSourceTranslator.java:573)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$Setup.run(JavaVisualEditorPart.java:1805)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:67)



Regards,

Memet
Re: Disable add components [message #94058 is a reply to message #94012] Wed, 15 June 2005 14:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

There is a problem with your override file. Unfortunately it doesn't say
what line it was on because it happened too late in the parsing but one
of your statements tried to add a null to a feature that is not allowed
to be null.

However I did notice in:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore"

xmlns:org.eclipse.ve.internal.cde.utility="http:///org/eclipse/ve/internal/cde/utility.ecore"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"

xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore"
xmlns:event="event.xmi">
<event:Add featureName="eAnnotations">
<addedEObjects
xsi:type=" org.eclipse.ve.internal.cde.decorators:ClassDescriptorDecora tor "

treeViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tTreeEditPart "

graphViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tGraphicalEditPart ">
<graphic
xsi:type="org.eclipse.ve.internal.cde.utility:GIFFileGraphic "
resourceName="platform:/plugin/com.myplugin.ve/icons/MyPanel.gif "/>
</addedEObjects>
<addedEObjects
xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator"
beanProxyClassName=" com.myplugin.ve/com.myplugin.ide.util.eclipse.ImagePathProxy Adapter "/>
</event:Add>

</xmi:XMI>


That it needs to be <event:AddMany></event:AddMany> and not
<event:Add></event:Add> because you are adding more than one eAnnotation.

--
Thanks,
Rich Kulp
Re: Disable add components [message #94102 is a reply to message #94058] Thu, 16 June 2005 02:28 Go to previous message
No real name is currently offline No real nameFriend
Messages: 19
Registered: July 2009
Junior Member
Thanks alot Mr Rich. Its working :)

Regards,

Memet

Rich Kulp wrote:
> There is a problem with your override file. Unfortunately it doesn't say
> what line it was on because it happened too late in the parsing but one
> of your statements tried to add a null to a feature that is not allowed
> to be null.
>
> However I did notice in:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore"
>
>
> xmlns:org.eclipse.ve.internal.cde.utility="http:///org/eclipse/ve/internal/cde/utility.ecore"
>
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>
> xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore"
>
> xmlns:event="event.xmi">
> <event:Add featureName="eAnnotations">
> <addedEObjects
> xsi:type=" org.eclipse.ve.internal.cde.decorators:ClassDescriptorDecora tor "
>
> treeViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tTreeEditPart "
>
>
> graphViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tGraphicalEditPart ">
>
> <graphic
> xsi:type="org.eclipse.ve.internal.cde.utility:GIFFileGraphic "
> resourceName="platform:/plugin/com.myplugin.ve/icons/MyPanel.gif "/>
> </addedEObjects>
> <addedEObjects
> xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator"
> beanProxyClassName=" com.myplugin.ve/com.myplugin.ide.util.eclipse.ImagePathProxy Adapter "/>
>
> </event:Add>
>
> </xmi:XMI>
>
>
> That it needs to be <event:AddMany></event:AddMany> and not
> <event:Add></event:Add> because you are adding more than one eAnnotation.
>
Re: Disable add components [message #607952 is a reply to message #93923] Tue, 14 June 2005 13:25 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

What driver of VE are you running? Is it M2? You may need to do a
Project->Clean all. The caching mechanism for the override files isn't
perfect yet for when things change. It doesn't see all changes. It
sounds like it isn't seeing your new override file. Check the .log file
to see if there are any override loading errors.


--
Thanks,
Rich Kulp
Re: Disable add components [message #607957 is a reply to message #93938] Wed, 15 June 2005 02:40 Go to previous message
No real name is currently offline No real nameFriend
Messages: 19
Registered: July 2009
Junior Member
Hello Rich,

I'm using M2 with Eclipse RC1 & all other plugin stated in VE download page.

You're right theres error in the log file


!ENTRY org.eclipse.jem.beaninfo 2 0 2005-06-15 10:01:01.609
!MESSAGE Error loading
file"platform:/plugin/com.myplugin.ve/overrides/com/mywidget/ui/ "
!STACK 0
java.lang.IllegalArgumentException: The 'no null' constraint is violated
at org.eclipse.emf.common.util.BasicEList.validate(BasicEList.j ava:171)
at org.eclipse.emf.ecore.util.EcoreEList.validate(EcoreEList.ja va:59)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:664)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:271)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:5 99)
at
com.ibm.etools.emf.event.impl.EventReaderHelper.setValue(Eve ntReaderHelper.java:342)
at
com.ibm.etools.emf.event.impl.EventUtilImpl.replayAdd(EventU tilImpl.java:321)
at
com.ibm.etools.emf.event.impl.EventUtilImpl.replayEvent(Even tUtilImpl.java:225)
at
com.ibm.etools.emf.event.impl.EventUtilImpl.doForwardEvents( EventUtilImpl.java:119)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter$ExtensionDocApplies.run(BeaninfoClassAdapter.java:1041)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter$ExtensionDocApplies.run(BeaninfoClassAdapter.java:1010)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.createOverrideCache(BeaninfoClassAdapter.java:983)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.applyExtensionDocument(BeaninfoClassAdapter.java:954)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.introspect(BeaninfoClassAdapter.java:680)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.introspectIfNecessary(BeaninfoClassAdapter.java:472)
at
org.eclipse.jem.internal.beaninfo.adapters.BeaninfoClassAdap ter.introspectIfNecessary(BeaninfoClassAdapter.java:459)
at
org.eclipse.jem.java.impl.JavaClassImpl.getEAnnotations(Java ClassImpl.java:387)
at
org.eclipse.ve.internal.cde.emf.ClassDecoratorSourceIterator .findDecorator(ClassDecoratorSourceIterator.java:37)
at
org.eclipse.ve.internal.cde.emf.ClassDecoratorIterator.initi alize(ClassDecoratorIterator.java:47)
at
org.eclipse.ve.internal.cde.emf.ClassDecoratorSourceIterator . <init>(ClassDecoratorSourceIterator.java:33)
at
org.eclipse.ve.internal.cde.emf.ClassDecoratorFeatureAccess. getDecoratorWithFeature(ClassDecoratorFeatureAccess.java:67)
at
org.eclipse.ve.internal.java.codegen.java.rules.InstanceVari ableCreationRule.getDefaultBooleanValue(InstanceVariableCrea tionRule.java:72)
at
org.eclipse.ve.internal.java.codegen.java.rules.InstanceVari ableCreationRule.isModelled(InstanceVariableCreationRule.jav a:99)
at
org.eclipse.ve.internal.java.codegen.java.rules.InstanceVari ableRule.isModelled(InstanceVariableRule.java:114)
at
org.eclipse.ve.internal.java.codegen.java.rules.InstanceVari ableRule.ignoreVariable(InstanceVariableRule.java:46)
at
org.eclipse.ve.internal.java.codegen.java.TypeVisitor.visit( TypeVisitor.java:160)
at
org.eclipse.ve.internal.java.codegen.java.JavaBeanModelBuild er.visitType(JavaBeanModelBuilder.java:502)
at
org.eclipse.ve.internal.java.codegen.java.JavaBeanModelBuild er.build(JavaBeanModelBuilder.java:407)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslat or.reverseParse(JavaSourceTranslator.java:851)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslat or.decodeDocument(JavaSourceTranslator.java:931)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslat or.loadModel(JavaSourceTranslator.java:573)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$Setup.run(JavaVisualEditorPart.java:1805)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:67)



Regards,

Memet
Re: Disable add components [message #607960 is a reply to message #94012] Wed, 15 June 2005 14:05 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

There is a problem with your override file. Unfortunately it doesn't say
what line it was on because it happened too late in the parsing but one
of your statements tried to add a null to a feature that is not allowed
to be null.

However I did notice in:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore"

xmlns:org.eclipse.ve.internal.cde.utility="http:///org/eclipse/ve/internal/cde/utility.ecore"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"

xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore"
xmlns:event="event.xmi">
<event:Add featureName="eAnnotations">
<addedEObjects
xsi:type=" org.eclipse.ve.internal.cde.decorators:ClassDescriptorDecora tor "

treeViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tTreeEditPart "

graphViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tGraphicalEditPart ">
<graphic
xsi:type="org.eclipse.ve.internal.cde.utility:GIFFileGraphic "
resourceName="platform:/plugin/com.myplugin.ve/icons/MyPanel.gif "/>
</addedEObjects>
<addedEObjects
xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator"
beanProxyClassName=" com.myplugin.ve/com.myplugin.ide.util.eclipse.ImagePathProxy Adapter "/>
</event:Add>

</xmi:XMI>


That it needs to be <event:AddMany></event:AddMany> and not
<event:Add></event:Add> because you are adding more than one eAnnotation.

--
Thanks,
Rich Kulp
Re: Disable add components [message #607963 is a reply to message #94058] Thu, 16 June 2005 02:28 Go to previous message
No real name is currently offline No real nameFriend
Messages: 19
Registered: July 2009
Junior Member
Thanks alot Mr Rich. Its working :)

Regards,

Memet

Rich Kulp wrote:
> There is a problem with your override file. Unfortunately it doesn't say
> what line it was on because it happened too late in the parsing but one
> of your statements tried to add a null to a feature that is not allowed
> to be null.
>
> However I did notice in:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore"
>
>
> xmlns:org.eclipse.ve.internal.cde.utility="http:///org/eclipse/ve/internal/cde/utility.ecore"
>
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>
> xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore"
>
> xmlns:event="event.xmi">
> <event:Add featureName="eAnnotations">
> <addedEObjects
> xsi:type=" org.eclipse.ve.internal.cde.decorators:ClassDescriptorDecora tor "
>
> treeViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tTreeEditPart "
>
>
> graphViewClassname=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.Componen tGraphicalEditPart ">
>
> <graphic
> xsi:type="org.eclipse.ve.internal.cde.utility:GIFFileGraphic "
> resourceName="platform:/plugin/com.myplugin.ve/icons/MyPanel.gif "/>
> </addedEObjects>
> <addedEObjects
> xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator"
> beanProxyClassName=" com.myplugin.ve/com.myplugin.ide.util.eclipse.ImagePathProxy Adapter "/>
>
> </event:Add>
>
> </xmi:XMI>
>
>
> That it needs to be <event:AddMany></event:AddMany> and not
> <event:Add></event:Add> because you are adding more than one eAnnotation.
>
Previous Topic:Problem in initialization of VE in Eclipse
Next Topic:What is nedded för VE to display a visual class?
Goto Forum:
  


Current Time: Thu Mar 28 17:45:32 GMT 2024

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

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

Back to the top