Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO dadabinding] possible to observe eContainer?
[CDO dadabinding] possible to observe eContainer? [message #523851] Mon, 29 March 2010 15:37 Go to next message
Eclipse UserFriend
Originally posted by: Thomas.Kowatsch.ruag.com

Hi.
Is it possible to bind against the container of an object?
I have an CDOObject on which I want to get notified when the object's
container changes. The container can be of arbitrary type (well a
CDOObject at least).
Is it at all possible to observe the EObject.eContainer (or
CDOObject.eContainer)?
Cheers.
--Thomas
Re: [CDO dadabinding] possible to observe eContainer? [message #523863 is a reply to message #523851] Mon, 29 March 2010 16:07 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080905080608060903080704
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Thomas,

In pure EMF it is generally not possible because the eContainer is not a
regular EStructuralFeature. But in CDO we provide container deltas as:

|*public interface *CDOContainerFeatureDelta *extends *CDOFeatureDelta
{
*public static final *EStructuralFeature CONTAINER_FEATURE = *new
*org.eclipse.emf.cdo.internal.common.revision.delta.CDOConta inerFeatureDeltaImpl.ContainerFeature();

*public *CDOID getResourceID();
*public *Object getContainerID();
*public **int *getContainerFeatureID();
}|


You can access it via:

|*public interface *CDODeltaNotification *extends *CDONotification
{
*public **boolean *hasNext();
*public *CDORevisionDelta getRevisionDelta();
}|


If you only need it for local modifications as they happen, you can also
access them via:


org.eclipse.emf.cdo.transaction.CDOTransactionHandler.modify ingObject(CDOTransaction,
CDOObject, CDOFeatureDelta)

Does that help?

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Am 29.03.2010 17:37, schrieb Thomas Kowatsch:
> Hi.
> Is it possible to bind against the container of an object?
> I have an CDOObject on which I want to get notified when the object's
> container changes. The container can be of arbitrary type (well a
> CDOObject at least).
> Is it at all possible to observe the EObject.eContainer (or
> CDOObject.eContainer)?
> Cheers.
> --Thomas

--------------080905080608060903080704
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Thomas,<br>
<br>
In pure EMF it is generally not possible because the eContainer is not
a regular EStructuralFeature. But in CDO we provide container deltas as:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#7f0055"><b>public


Re: [CDO dadabinding] possible to observe eContainer? [message #523867 is a reply to message #523863] Mon, 29 March 2010 16:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Thomas.Kowatsch.ruag.com

Hi Eike.
That explains a bit how it's handled and the possibility to check for it
in CDO.
But unfortunatley doesn't help with my databinding problem as I would
need an EMF feature to observe, i.e. EMFProperties.value(theFeature).
Maybe it's a problem how it's modeled in the ECore model. I have to
think about that...
Cheers.
--Thomas

Eike Stepper schrieb:
> Hi Thomas,
>
> In pure EMF it is generally not possible because the eContainer is not a
> regular EStructuralFeature. But in CDO we provide container deltas as:
>
> |*public interface *CDOContainerFeatureDelta *extends *CDOFeatureDelta
> {
>
> *public static final *EStructuralFeature CONTAINER_FEATURE = *new *org.eclipse.emf.cdo.internal.common.revision.delta.CDOConta inerFeatureDeltaImpl.ContainerFeature();
>
> *public *CDOID getResourceID();
> *public *Object getContainerID();
> *public **int *getContainerFeatureID();
> }|
>
>
> You can access it via:
>
> |*public interface *CDODeltaNotification *extends *CDONotification
> {
> *public **boolean *hasNext();
> *public *CDORevisionDelta getRevisionDelta();
> }|
>
>
> If you only need it for local modifications as they happen, you can also
> access them via:
>
>
> org.eclipse.emf.cdo.transaction.CDOTransactionHandler.modify ingObject(CDOTransaction,
> CDOObject, CDOFeatureDelta)
>
> Does that help?
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
> Am 29.03.2010 17:37, schrieb Thomas Kowatsch:
>> Hi.
>> Is it possible to bind against the container of an object?
>> I have an CDOObject on which I want to get notified when the object's
>> container changes. The container can be of arbitrary type (well a
>> CDOObject at least).
>> Is it at all possible to observe the EObject.eContainer (or
>> CDOObject.eContainer)?
>> Cheers.
>> --Thomas
Re: [CDO dadabinding] possible to observe eContainer? [message #523971 is a reply to message #523867] Tue, 30 March 2010 01:48 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
the only solution is to model it as bidirectional references so that you
get an festure.

tom

Am 29.03.10 18:26, schrieb Thomas Kowatsch:
> Hi Eike.
> That explains a bit how it's handled and the possibility to check for it
> in CDO.
> But unfortunatley doesn't help with my databinding problem as I would
> need an EMF feature to observe, i.e. EMFProperties.value(theFeature).
> Maybe it's a problem how it's modeled in the ECore model. I have to
> think about that...
> Cheers.
> --Thomas
>
> Eike Stepper schrieb:
>> Hi Thomas,
>>
>> In pure EMF it is generally not possible because the eContainer is not
>> a regular EStructuralFeature. But in CDO we provide container deltas as:
>>
>> |*public interface *CDOContainerFeatureDelta *extends *CDOFeatureDelta
>> {
>> *public static final *EStructuralFeature CONTAINER_FEATURE = *new
>> *org.eclipse.emf.cdo.internal.common.revision.delta.CDOConta inerFeatureDeltaImpl.ContainerFeature();
>>
>>
>> *public *CDOID getResourceID();
>> *public *Object getContainerID();
>> *public **int *getContainerFeatureID();
>> }|
>>
>>
>> You can access it via:
>>
>> |*public interface *CDODeltaNotification *extends *CDONotification
>> {
>> *public **boolean *hasNext();
>> *public *CDORevisionDelta getRevisionDelta();
>> }|
>>
>>
>> If you only need it for local modifications as they happen, you can
>> also access them via:
>>
>>
>> org.eclipse.emf.cdo.transaction.CDOTransactionHandler.modify ingObject(CDOTransaction,
>> CDOObject, CDOFeatureDelta)
>>
>> Does that help?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>> Am 29.03.2010 17:37, schrieb Thomas Kowatsch:
>>> Hi.
>>> Is it possible to bind against the container of an object?
>>> I have an CDOObject on which I want to get notified when the object's
>>> container changes. The container can be of arbitrary type (well a
>>> CDOObject at least).
>>> Is it at all possible to observe the EObject.eContainer (or
>>> CDOObject.eContainer)?
>>> Cheers.
>>> --Thomas
Previous Topic:Persistence advice for Newbie
Next Topic:Very Big Model
Goto Forum:
  


Current Time: Fri Apr 26 15:02:17 GMT 2024

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

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

Back to the top