Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Validation - constraintProvider - package
Validation - constraintProvider - package [message #80847] Tue, 24 April 2007 11:33 Go to next message
Grzegorz Bialek is currently offline Grzegorz BialekFriend
Messages: 43
Registered: July 2009
Member
Hello,



I have a model divided to many packages. In one of my package I have defined
interface ExpressionHolder with feature Expression. In other packages I
implement this interface. I want to add constraint to check expression in
any place where someone use ExpressionHolder.



I create 'constraintProvider' and 'constraint' for type ExpressionHolder and
this works but I must list any packages that probably use my interface. Is
it possible to not include all that packages but only base package (I want
to someone may create own model for some extension in the future)?



Grzesiek
Re: Validation - constraintProvider - package [message #80848 is a reply to message #80847] Tue, 24 April 2007 13:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Grzesiek,

I see that there is an early filter in the determination of the constraints
applicable to an EObject, that checks the EObject's EClass's EPackage
against the packages declared by the constraint provider (in the default
XML-based implementation, that is; custom providers can behave
differently). This will prevent the framework from consulting the
provider, which constraints would correctly determine (by EClass
inheritance) that they apply.

The EPackage filtering should account for the possibility that one package
"extends" another. Would you mind raising a bug?

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT& ;version=1.1&component=Validation

Cheers,

Christian


Grzegorz Biaek wrote:

> Hello,
>
>
>
> I have a model divided to many packages. In one of my package I have
> defined interface ExpressionHolder with feature Expression. In other
> packages I implement this interface. I want to add constraint to check
> expression in any place where someone use ExpressionHolder.
>
>
>
> I create 'constraintProvider' and 'constraint' for type ExpressionHolder
> and this works but I must list any packages that probably use my
> interface. Is it possible to not include all that packages but only base
> package (I want to someone may create own model for some extension in the
> future)?
>
>
>
> Grzesiek
Re: Validation - constraintProvider - package [message #81132 is a reply to message #80848] Wed, 25 April 2007 13:17 Go to previous messageGo to next message
Grzegorz Bialek is currently offline Grzegorz BialekFriend
Messages: 43
Registered: July 2009
Member
Thanks

I create request:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=183917

I have one more question to you. I use your's pattern of workbench
integration from EXTLibraryEditor
(org.eclipse.emf.workspace.examples.library.editor).
Few days ago I migrate application from Eclipse 3.2 to 3.3 and I get some
strange results.

I have two editors for different models (form different epackage) based on
common parts (abstract editor). In my operationHistoryListener I use code:
ResourceUndoContext.getAffectedResources(event.getOperation( ));
but for some reasons in one of my editors it returns empty set. I debug this
and discover that in first editor I have command with two undoContexts:
org.eclipse.core.commands.operations.UndoContext
org.eclipse.emf.workspace.ResourceUndoContext
and in this not working I have only that first context. I don't understand
why I have different contexts because both command is from shared page of
editors.
I don't know where those contexts are set to commands. Do you know how to
debug this sytuation?

Grzesiek
(sorry for my English ;> )





Uzytkownik "Christian W. Damus" <cdamus@ca.ibm.com> napisal w wiadomosci
news:f0l15c$21c$1@build.eclipse.org...
> Hi, Grzesiek,
>
> I see that there is an early filter in the determination of the
constraints
> applicable to an EObject, that checks the EObject's EClass's EPackage
> against the packages declared by the constraint provider (in the default
> XML-based implementation, that is; custom providers can behave
> differently). This will prevent the framework from consulting the
> provider, which constraints would correctly determine (by EClass
> inheritance) that they apply.
>
> The EPackage filtering should account for the possibility that one package
> "extends" another. Would you mind raising a bug?
>
>
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT& ;version=1.1&component=Validation
>
> Cheers,
>
> Christian
Re: Validation - constraintProvider - package [message #81147 is a reply to message #81132] Wed, 25 April 2007 13:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Grzesiek,

Your English is very good.

I suspect that your WorkspaceCommandStack perhaps isn't being notified when
commands are executed in your second editor. Try putting a breakpoint at
the beginning of the

WorkspaceCommandStackImpl.DomainListener.resourceSetChanged( ...)

method to see how it computes the affected resources and whether it retains
them. The resources should be stored in the affectedResources field and
later converted to ResourceContexts in the historyNotification(...) method.

HTH,

Christian


Grzegorz Bialek wrote:

> Thanks
>
> I create request:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=183917
>
> I have one more question to you. I use your's pattern of workbench
> integration from EXTLibraryEditor
> (org.eclipse.emf.workspace.examples.library.editor).
> Few days ago I migrate application from Eclipse 3.2 to 3.3 and I get some
> strange results.
>
> I have two editors for different models (form different epackage) based on
> common parts (abstract editor). In my operationHistoryListener I use code:
> ResourceUndoContext.getAffectedResources(event.getOperation( ));
> but for some reasons in one of my editors it returns empty set. I debug
> this and discover that in first editor I have command with two
> undoContexts:
> org.eclipse.core.commands.operations.UndoContext
> org.eclipse.emf.workspace.ResourceUndoContext
> and in this not working I have only that first context. I don't understand
> why I have different contexts because both command is from shared page of
> editors.
> I don't know where those contexts are set to commands. Do you know how to
> debug this sytuation?
>
> Grzesiek
> (sorry for my English ;> )
>

<snip>
Re: Validation - constraintProvider - package [message #81176 is a reply to message #81147] Wed, 25 April 2007 14:24 Go to previous message
Grzegorz Bialek is currently offline Grzegorz BialekFriend
Messages: 43
Registered: July 2009
Member
Hello,



I found that place few minutes ago. Like you said method resourceSetChanged
was not called in my second editor - I simply load second model outside of
EditingDomain (directly by ResourceSetImpl) ;D



Thanks for help

Grzesiek



Uzytkownik "Christian W. Damus" <cdamus@ca.ibm.com> napisal w wiadomosci
news:f0nlnh$d97$1@build.eclipse.org...
> Hi, Grzesiek,
>
> Your English is very good.
>
> I suspect that your WorkspaceCommandStack perhaps isn't being notified
when
> commands are executed in your second editor. Try putting a breakpoint at
> the beginning of the
>
> WorkspaceCommandStackImpl.DomainListener.resourceSetChanged( ...)
>
> method to see how it computes the affected resources and whether it
retains
> them. The resources should be stored in the affectedResources field and
> later converted to ResourceContexts in the historyNotification(...)
method.
>
> HTH,
>
> Christian
>
>
> Grzegorz Bialek wrote:
>
> > Thanks
> >
> > I create request:
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=183917
> >
> > I have one more question to you. I use your's pattern of workbench
> > integration from EXTLibraryEditor
> > (org.eclipse.emf.workspace.examples.library.editor).
> > Few days ago I migrate application from Eclipse 3.2 to 3.3 and I get
some
> > strange results.
> >
> > I have two editors for different models (form different epackage) based
on
> > common parts (abstract editor). In my operationHistoryListener I use
code:
> > ResourceUndoContext.getAffectedResources(event.getOperation( ));
> > but for some reasons in one of my editors it returns empty set. I debug
> > this and discover that in first editor I have command with two
> > undoContexts:
> > org.eclipse.core.commands.operations.UndoContext
> > org.eclipse.emf.workspace.ResourceUndoContext
> > and in this not working I have only that first context. I don't
understand
> > why I have different contexts because both command is from shared page
of
> > editors.
> > I don't know where those contexts are set to commands. Do you know how
to
> > debug this sytuation?
> >
> > Grzesiek
> > (sorry for my English ;> )
> >
>
> <snip>
Re: Validation - constraintProvider - package [message #604986 is a reply to message #80847] Tue, 24 April 2007 13:36 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Grzesiek,

I see that there is an early filter in the determination of the constraints
applicable to an EObject, that checks the EObject's EClass's EPackage
against the packages declared by the constraint provider (in the default
XML-based implementation, that is; custom providers can behave
differently). This will prevent the framework from consulting the
provider, which constraints would correctly determine (by EClass
inheritance) that they apply.

The EPackage filtering should account for the possibility that one package
"extends" another. Would you mind raising a bug?

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT& ;version=1.1&component=Validation

Cheers,

Christian


Grzegorz Biaek wrote:

> Hello,
>
>
>
> I have a model divided to many packages. In one of my package I have
> defined interface ExpressionHolder with feature Expression. In other
> packages I implement this interface. I want to add constraint to check
> expression in any place where someone use ExpressionHolder.
>
>
>
> I create 'constraintProvider' and 'constraint' for type ExpressionHolder
> and this works but I must list any packages that probably use my
> interface. Is it possible to not include all that packages but only base
> package (I want to someone may create own model for some extension in the
> future)?
>
>
>
> Grzesiek
Re: Validation - constraintProvider - package [message #605042 is a reply to message #80848] Wed, 25 April 2007 13:17 Go to previous message
Grzegorz Bialek is currently offline Grzegorz BialekFriend
Messages: 43
Registered: July 2009
Member
Thanks

I create request:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=183917

I have one more question to you. I use your's pattern of workbench
integration from EXTLibraryEditor
(org.eclipse.emf.workspace.examples.library.editor).
Few days ago I migrate application from Eclipse 3.2 to 3.3 and I get some
strange results.

I have two editors for different models (form different epackage) based on
common parts (abstract editor). In my operationHistoryListener I use code:
ResourceUndoContext.getAffectedResources(event.getOperation( ));
but for some reasons in one of my editors it returns empty set. I debug this
and discover that in first editor I have command with two undoContexts:
org.eclipse.core.commands.operations.UndoContext
org.eclipse.emf.workspace.ResourceUndoContext
and in this not working I have only that first context. I don't understand
why I have different contexts because both command is from shared page of
editors.
I don't know where those contexts are set to commands. Do you know how to
debug this sytuation?

Grzesiek
(sorry for my English ;> )





Uzytkownik "Christian W. Damus" <cdamus@ca.ibm.com> napisal w wiadomosci
news:f0l15c$21c$1@build.eclipse.org...
> Hi, Grzesiek,
>
> I see that there is an early filter in the determination of the
constraints
> applicable to an EObject, that checks the EObject's EClass's EPackage
> against the packages declared by the constraint provider (in the default
> XML-based implementation, that is; custom providers can behave
> differently). This will prevent the framework from consulting the
> provider, which constraints would correctly determine (by EClass
> inheritance) that they apply.
>
> The EPackage filtering should account for the possibility that one package
> "extends" another. Would you mind raising a bug?
>
>
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT& ;version=1.1&component=Validation
>
> Cheers,
>
> Christian
Re: Validation - constraintProvider - package [message #605045 is a reply to message #81132] Wed, 25 April 2007 13:40 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Grzesiek,

Your English is very good.

I suspect that your WorkspaceCommandStack perhaps isn't being notified when
commands are executed in your second editor. Try putting a breakpoint at
the beginning of the

WorkspaceCommandStackImpl.DomainListener.resourceSetChanged( ...)

method to see how it computes the affected resources and whether it retains
them. The resources should be stored in the affectedResources field and
later converted to ResourceContexts in the historyNotification(...) method.

HTH,

Christian


Grzegorz Bialek wrote:

> Thanks
>
> I create request:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=183917
>
> I have one more question to you. I use your's pattern of workbench
> integration from EXTLibraryEditor
> (org.eclipse.emf.workspace.examples.library.editor).
> Few days ago I migrate application from Eclipse 3.2 to 3.3 and I get some
> strange results.
>
> I have two editors for different models (form different epackage) based on
> common parts (abstract editor). In my operationHistoryListener I use code:
> ResourceUndoContext.getAffectedResources(event.getOperation( ));
> but for some reasons in one of my editors it returns empty set. I debug
> this and discover that in first editor I have command with two
> undoContexts:
> org.eclipse.core.commands.operations.UndoContext
> org.eclipse.emf.workspace.ResourceUndoContext
> and in this not working I have only that first context. I don't understand
> why I have different contexts because both command is from shared page of
> editors.
> I don't know where those contexts are set to commands. Do you know how to
> debug this sytuation?
>
> Grzesiek
> (sorry for my English ;> )
>

<snip>
Re: Validation - constraintProvider - package [message #605051 is a reply to message #81147] Wed, 25 April 2007 14:24 Go to previous message
Grzegorz Bialek is currently offline Grzegorz BialekFriend
Messages: 43
Registered: July 2009
Member
Hello,



I found that place few minutes ago. Like you said method resourceSetChanged
was not called in my second editor - I simply load second model outside of
EditingDomain (directly by ResourceSetImpl) ;D



Thanks for help

Grzesiek



Uzytkownik "Christian W. Damus" <cdamus@ca.ibm.com> napisal w wiadomosci
news:f0nlnh$d97$1@build.eclipse.org...
> Hi, Grzesiek,
>
> Your English is very good.
>
> I suspect that your WorkspaceCommandStack perhaps isn't being notified
when
> commands are executed in your second editor. Try putting a breakpoint at
> the beginning of the
>
> WorkspaceCommandStackImpl.DomainListener.resourceSetChanged( ...)
>
> method to see how it computes the affected resources and whether it
retains
> them. The resources should be stored in the affectedResources field and
> later converted to ResourceContexts in the historyNotification(...)
method.
>
> HTH,
>
> Christian
>
>
> Grzegorz Bialek wrote:
>
> > Thanks
> >
> > I create request:
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=183917
> >
> > I have one more question to you. I use your's pattern of workbench
> > integration from EXTLibraryEditor
> > (org.eclipse.emf.workspace.examples.library.editor).
> > Few days ago I migrate application from Eclipse 3.2 to 3.3 and I get
some
> > strange results.
> >
> > I have two editors for different models (form different epackage) based
on
> > common parts (abstract editor). In my operationHistoryListener I use
code:
> > ResourceUndoContext.getAffectedResources(event.getOperation( ));
> > but for some reasons in one of my editors it returns empty set. I debug
> > this and discover that in first editor I have command with two
> > undoContexts:
> > org.eclipse.core.commands.operations.UndoContext
> > org.eclipse.emf.workspace.ResourceUndoContext
> > and in this not working I have only that first context. I don't
understand
> > why I have different contexts because both command is from shared page
of
> > editors.
> > I don't know where those contexts are set to commands. Do you know how
to
> > debug this sytuation?
> >
> > Grzesiek
> > (sorry for my English ;> )
> >
>
> <snip>
Previous Topic:[Teneo] : Transient annotation not working on EClass.
Next Topic:[Teneo] ClassCastException retrieving model
Goto Forum:
  


Current Time: Thu Mar 28 12:41:19 GMT 2024

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

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

Back to the top