Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » ecore reference xsd
ecore reference xsd [message #108162] Thu, 01 March 2007 07:20 Go to next message
Eclipse UserFriend
Originally posted by: rahuliiitb.gmail.com

Hi,

I have an attribute whose type i have specified as an ecore:ref to a
another element present in the xsd. The declartion looks like this

<xsd:attribute ecore:reference="ElementType" name="attrFile">
<xsd:simpleType>
<xsd:list itemType="xsd:anyURI"/>
</xsd:simpleType>

A button comes when we click on this attribute value in propertysheet view
after i run this eclipse application. On clicking of this button a Dialog
is opened which is created in FeatureEditorDialog.class.

Instead of the dialog created by FeatureEditorDialog i want to display my
own custom dialog when the user clicks on this button.

Since FeatureEditorDialog is a .class file so i cannot modify it.
The another option is to catch hold of this button listener but i am
unable to find that.

Can some one help me on resolving this issue.

Thanks in advance
Rahul
Re: ecore reference xsd [message #108246 is a reply to message #108162] Thu, 01 March 2007 09:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------070000000400030203060107
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Rahul,

You can easily search the newgroup history like this to look at previous
answers to this question:

http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&cmd=Search%21&form=extended&wf=574a74&ps=1 0&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools .emf&wm=wrd&t=News&t=Mail
< http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&cmd=Search%21&form=extended&wf=574a74&ps=1 0&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools .emf&wm=wrd&t=News&t=Mail>


Rahul wrote:
> Hi,
>
> I have an attribute whose type i have specified as an ecore:ref to a
> another element present in the xsd. The declartion looks like this
>
> <xsd:attribute ecore:reference="ElementType" name="attrFile">
> <xsd:simpleType>
> <xsd:list itemType="xsd:anyURI"/>
> </xsd:simpleType>
>
> A button comes when we click on this attribute value in propertysheet
> view after i run this eclipse application. On clicking of this button
> a Dialog is opened which is created in FeatureEditorDialog.class.
> Instead of the dialog created by FeatureEditorDialog i want to display
> my own custom dialog when the user clicks on this button.
> Since FeatureEditorDialog is a .class file so i cannot modify it. The
> another option is to catch hold of this button listener but i am
> unable to find that.
> Can some one help me on resolving this issue.
>
> Thanks in advance Rahul
>


--------------070000000400030203060107
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">
Rahul,<br>
<br>
You can easily search the newgroup history like this to look at
previous answers to this question:<br>
<blockquote><a
href=" http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&amp ;cmd=Search%21&amp;form=extended&amp;wf=574a74&a mp;ps=10&amp;m=all&amp;t=5&amp;ul=%2Fnewslists%2 Fnews.eclipse.tools.emf&amp;wm=wrd&amp;t=News&am p;t=Mail "> http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&amp ;cmd=Search%21&amp;form=extended&amp;wf=574a74&a mp;ps=10&amp;m=all&amp;t=5&amp;ul=%2Fnewslists%2 Fnews.eclipse.tools.emf&amp;wm=wrd&amp;t=News&am p;t=Mail </a><br>
</blockquote>
<br>
Rahul wrote:
<blockquote cite="mid563e943f19a8c14a08170421b96e1b38$1@www.eclipse.org"
type="cite">Hi,
<br>
<br>
I have an attribute whose type i have specified as an ecore:ref to a
another element present in the xsd. The declartion looks like this
<br>
Re: ecore reference xsd [message #108360 is a reply to message #108246] Fri, 02 March 2007 05:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rahuliiitb.gmail.com

Hi Ed Merks,

Thanks for your reply. I am now able to get my dialog after i click on the
button. I am able to display the selected value in the cell editor but now
the issue is tht this value is not written back into the file which holds
the semantic view so it does not become persisted.

Can you plz clarify on how can i write back into the semantic view.

Thanks in advance.
Rahul
Re: ecore reference xsd [message #108440 is a reply to message #108360] Fri, 02 March 2007 07:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Rahul,

I don't know what your code is doing, but set some breakpoints to see
how ItemPropertyDescriptor.setPropertyValue is normally called to update
the model.


Rahul wrote:
> Hi Ed Merks,
>
> Thanks for your reply. I am now able to get my dialog after i click on
> the button. I am able to display the selected value in the cell editor
> but now the issue is tht this value is not written back into the file
> which holds the semantic view so it does not become persisted.
>
> Can you plz clarify on how can i write back into the semantic view.
>
> Thanks in advance.
> Rahul
>
Re: ecore reference xsd [message #108777 is a reply to message #108440] Mon, 05 March 2007 01:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rahuliiitb.gmail.com

Hi Ed Merks,

I have put breakpoint in the ItemPropertyDescriptor.setPropertyValue as
suggested by you. It goes to the getPropertyDescriptor(Object object,
Object propertyId) function but it does not go inside the if
(propertyId.equals(itemPropertyDescriptor.getId(object))) present for the
attribute which has been modified.
The same thing happens in mindmap example where if
you select the Topic element and assign some value to the subtopic it does
not get written back in the model back. Is this problem because i have
specified the type of an attribute as an ecore:refernce.

And can you please suggest if i can get a button in the propertyview
without specifying the type of an attribute as an ecore:reference.

Thanks in advance

Rahul
Re: ecore reference xsd [message #108791 is a reply to message #108777] Mon, 05 March 2007 01:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------030006090703070004020509
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Rahul,

The setPropertyValue method does this:

public void setPropertyValue(Object object, Object value)
{
EObject eObject = (EObject)object;
EditingDomain editingDomain = getEditingDomain(object);

if (parentReferences != null)
{
Command removeCommand = null;
for (int i = 0; i < parentReferences.length; ++i)
{
Object oldValue = eObject.eGet(parentReferences[i]);
if (oldValue != null)
{
final EReference parentReference = parentReferences[i];
if (oldValue == value)
{
return;
}
else if (parentReference.getEType().isInstance(value))
{
if (editingDomain == null)
{
eObject.eSet(parentReference, value);
}
else
{

editingDomain.getCommandStack().execute(SetCommand.create(ed itingDomain,
getCommandOwner(eObject), parentReference, value));
}
return;
}
else
{
if (editingDomain == null)
{
eObject.eSet(parentReference, null);
}
else
{
removeCommand = SetCommand.create(editingDomain,
getCommandOwner(eObject), parentReference, null);
}
break;
}
}
}

for (int i = 0; i < parentReferences.length; ++i)
{
final EReference parentReference = parentReferences[i];
if (parentReference.getEType().isInstance(value))
{
if (editingDomain == null)
{
eObject.eSet(parentReferences[i], value);
}
else
{
if (removeCommand != null)
{
final CompoundCommand compoundCommand = new
CompoundCommand(CompoundCommand.LAST_COMMAND_ALL);
compoundCommand.append(removeCommand);

compoundCommand.append(SetCommand.create(editingDomain,
getCommandOwner(eObject), parentReference, value));
editingDomain.getCommandStack().execute(compoundCommand);
}
else
{

editingDomain.getCommandStack().execute(SetCommand.create(ed itingDomain,
getCommandOwner(eObject), parentReference, value));
}
}
break;
}
}
}
else
{
if (editingDomain == null)
{
eObject.eSet(feature, value);
}
else
{

editingDomain.getCommandStack().execute(SetCommand.create(ed itingDomain,
getCommandOwner(eObject), feature, value));
}
}
}

I suggested looking at it because that's how the EMF properties view
does all it's updating. I.e., no matter what cell editor is used, it
eventually calls this with the value that the cell editor has
specified. I don't really understand the issue you describe about
getPropertyDescriptor. All I can really do is point you at the
generated code that already works as an example and hope that from that
example you can make the specializations you need to make your case work...


Rahul wrote:
> Hi Ed Merks,
>
> I have put breakpoint in the ItemPropertyDescriptor.setPropertyValue
> as suggested by you. It goes to the getPropertyDescriptor(Object
> object, Object propertyId) function but it does not go inside the if
> (propertyId.equals(itemPropertyDescriptor.getId(object))) present for
> the attribute which has been
> modified.
> The same thing happens in mindmap example where if you select the
> Topic element and assign some value to the subtopic it does not get
> written back in the model back. Is this problem because i have
> specified the type of an attribute as an ecore:refernce.
>
> And can you please suggest if i can get a button in the propertyview
> without specifying the type of an attribute as an ecore:reference.
>
> Thanks in advance
>
> Rahul
>


--------------030006090703070004020509
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">
Rahul,<br>
<br>
The setPropertyValue method does this:<br>
<blockquote><small>
Re: ecore reference xsd [message #109265 is a reply to message #108162] Tue, 06 March 2007 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rahul_tech2006.yahoo.com

Hi Ed Merks,

Is there any way through which i can get a button for an attribute in the
cell editor without specifying the ecore:reference to some another
element. I have an attribute called file whose type is of
string. I want to display a button instead of a text box for this
attribute in the propertysheet.
Can you please suggest some way through which i can get button instead of
textbox.

Thanks in advance

Rahul
Re: ecore reference xsd [message #109278 is a reply to message #109265] Tue, 06 March 2007 10:03 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------000108080000060804090807
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Rahul,

This link will find answers for how to create a custom cell editor,
which is what you are asking to do:

http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&cmd=Search%21&form=extended&wf=574a74&ps=1 0&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools .emf&wm=wrd&t=News&t=Mail
< http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&cmd=Search%21&form=extended&wf=574a74&ps=1 0&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools .emf&wm=wrd&t=News&t=Mail>


Rahul wrote:
> Hi Ed Merks,
>
> Is there any way through which i can get a button for an attribute in
> the cell editor without specifying the ecore:reference to some another
> element. I have an attribute called file whose type is
> of string. I want to display a button instead of a text box for this
> attribute in the propertysheet. Can you please suggest some way
> through which i can get button instead of textbox.
>
> Thanks in advance
>
> Rahul
>


--------------000108080000060804090807
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">
Rahul,<br>
<br>
This link will find answers for how to create a custom cell editor,
which is what you are asking to do:<br>
<blockquote><a
href=" http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&amp ;cmd=Search%21&amp;form=extended&amp;wf=574a74&a mp;ps=10&amp;m=all&amp;t=5&amp;ul=%2Fnewslists%2 Fnews.eclipse.tools.emf&amp;wm=wrd&amp;t=News&am p;t=Mail "> http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&amp ;cmd=Search%21&amp;form=extended&amp;wf=574a74&a mp;ps=10&amp;m=all&amp;t=5&amp;ul=%2Fnewslists%2 Fnews.eclipse.tools.emf&amp;wm=wrd&amp;t=News&am p;t=Mail </a><br>
</blockquote>
<br>
Rahul wrote:
<blockquote cite="midca3e055c57e945cb9c0ec0bd3bf6dc71$1@www.eclipse.org"
type="cite">Hi Ed Merks,
<br>
<br>
Is there any way through which i can get a button for an attribute in
the cell editor without specifying the ecore:reference to some another
element.
Previous Topic:External node labels not working for nested elements
Next Topic:Notational Update after programatic move fails
Goto Forum:
  


Current Time: Fri Oct 31 17:04:33 EDT 2025

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

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

Back to the top