Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Getting PropertySource for EMF within GMF editor
Getting PropertySource for EMF within GMF editor [message #169929] Fri, 25 January 2008 19:12 Go to next message
Eclipse UserFriend
Hi All!

I read through a lot of articles discussing how to realize property pages,
but I didn't found a solution (that I understand ;-)) for getting the
PropertySource for an EMF element.

What I want to do is the following:
My starting point is the edit part of an element. But how can I manipulate
the underlying EMF element and automatically updating the GMF graph? And I
want to do this within a PropertyPage.

Could really need some help here (if possible... also an easy explanation
;-))

Kind regards,
Markus
Re: Getting PropertySource for EMF within GMF editor [message #169939 is a reply to message #169929] Fri, 25 January 2008 19:24 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.
--------------060600090909030501060304
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Markus,

The generated EMF editor has a working example.
| /**
* This is how the framework determines which interfaces we implement.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
*public *Object getAdapter(Class key)
{
*if *(key.equals(IContentOutlinePage.*class*))
{
*return *showOutlineView() ? getContentOutlinePage() : *null*;
}
*else if *(key.equals(IPropertySheetPage.*class*))
{
*return *getPropertySheetPage();
}
*else if *(key.equals(IGotoMarker.*class*))
{
*return this*;
}
*else*
{
*return super*.getAdapter(key);
}
}


/**
* This accesses a cached version of the property sheet.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
*public *IPropertySheetPage getPropertySheetPage()
{
*if *(propertySheetPage == *null*)
{
propertySheetPage =
*new *ExtendedPropertySheetPage(editingDomain)
{
@Override
*public **void *setSelectionToViewer(List<?> selection)
{
PrimerEditor.*this*.setSelectionToViewer(selection);
PrimerEditor.*this*.setFocus();
}

@Override
*public **void *setActionBars(IActionBars actionBars)
{
*super*.setActionBars(actionBars);
getActionBarContributor().shareGlobalActions(this, actionBars);
}
};
propertySheetPage.setPropertySourceProvider(*new *AdapterFactoryContentProvider(adapterFactory));
}

*return *propertySheetPage;
}|



Markus Gieser wrote:
> Hi All!
>
> I read through a lot of articles discussing how to realize property pages,
> but I didn't found a solution (that I understand ;-)) for getting the
> PropertySource for an EMF element.
>
> What I want to do is the following:
> My starting point is the edit part of an element. But how can I manipulate
> the underlying EMF element and automatically updating the GMF graph? And I
> want to do this within a PropertyPage.
>
> Could really need some help here (if possible... also an easy explanation
> ;-))
>
> Kind regards,
> Markus
>
>
>


--------------060600090909030501060304
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Markus,<br>
<br>
The generated EMF editor has a working example.<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-1">
<!-- ======================================================== -->
<!-- = 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"
height="986" width="818">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff">&nbsp;&nbsp;</font><font
color="#3f5fbf">/**</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf"> *&nbsp;This&nbsp;is&nbsp;how&nbsp;the&nb sp;framework&nbsp;determines&nbsp;which&nbsp;int erfaces&nbsp;we&nbsp;implement. </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font
color="#7f7f9f">&lt;!--&nbsp;begin-user-doc&nbsp;--&gt; </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font
color="#7f7f9f">&lt;!--&nbsp;end-user-doc&nbsp;--&gt; </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;@generated</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*/</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#646464">@SuppressWarnings</font><font
color="#000000">(</font><font color="#2a00ff">"unchecked"</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#646464">@Override</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#000000">Object&nbsp;getAdapter</font><font color="#000000">(</font><font
color="#000000">Class&nbsp;key</font><font color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>if&nbsp;</b></font><font
color="#000000">(</font><font color="#000000">key.equals</font><font
color="#000000">(</font><font color="#000000">IContentOutlinePage.</font><font
color="#7f0055"><b>class</b></font><font color="#000000">))</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>return&nbsp;</b></font><font
color="#000000">showOutlineView</font><font color="#000000">()&nbsp;</font><font
color="#000000">?&nbsp;getContentOutlinePage</font><font color="#000000">()&nbsp;</font><font
color="#000000">:&nbsp;</font><font color="#7f0055"><b>null</b></font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>else&nbsp;if&nbsp;</b></font ><font
color="#000000">(</font><font color="#000000">key.equals</font><font
color="#000000">(</font><font color="#000000">IPropertySheetPage.</font><font
color="#7f0055"><b>class</b></font><font color="#000000">))</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>return&nbsp;</b></font><font
color="#000000">getPropertySheetPage</font><font color="#000000">()</font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>else&nbsp;if&nbsp;</b></font ><font
color="#000000">(</font><font color="#000000">key.equals</font><font
color="#000000">(</font><font color="#000000">IGotoMarker.</font><font
color="#7f0055"><b>class</b></font><font color="#000000">))</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>return&nbsp;this</b></font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>else</b></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>return&nbsp;super</b></font><font
color="#000000">.getAdapter</font><font color="#000000">(</font><font
color="#000000">key</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#3f5fbf">/**</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf"> *&nbsp;This&nbsp;accesses&nbsp;a&nbsp;cached &nbsp;version&nbsp;of&nbsp;the&nbsp;property &nbsp;sheet. </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font
color="#7f7f9f">&lt;!--&nbsp;begin-user-doc&nbsp;--&gt; </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font
color="#7f7f9f">&lt;!--&nbsp;end-user-doc&nbsp;--&gt; </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;@generated</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*/</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#000000">IPropertySheetPage&nbsp;getPropertySheetPage </font><font
color="#000000">()</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>if&nbsp;</b></font><font
color="#000000">(</font><font color="#000000">propertySheetPage&nbsp;==&nbsp;</font ><font
color="#7f0055"><b>null</b></font><font color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">propertySheetPage&nbsp;=</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">ExtendedPropertySheetPage</font><font color="#000000">(</font><font
color="#000000">editingDomain</font><font color="#000000">)</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </font><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#646464">@Override</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#7f0055"><b>void&nbsp;</b></font><font color="#000000">setSelectionToViewer</font><font
color="#000000">(</font><font color="#000000">List&lt;?&gt;&nbsp;selection</font ><font
color="#000000">)</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">PrimerEditor.</font><font
color="#7f0055"><b>this</b></font><font color="#000000">.setSelectionToViewer</font><font
color="#000000">(</font><font color="#000000">selection</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">PrimerEditor.</font><font
color="#7f0055"><b>this</b></font><font color="#000000">.setFocus</font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#646464">@Override</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#7f0055"><b>void&nbsp;</b></font><font color="#000000">setActionBars</font><font
color="#000000">(</font><font color="#000000">IActionBars&nbsp;actionBars</font><font
color="#000000">)</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>super</b></font><font
color="#000000">.setActionBars</font><font color="#000000">(</font><font
color="#000000">actionBars</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">getActionBarContributor</font><font
color="#000000">()</font><font color="#000000">.shareGlobalActions</font><font
color="#000000">(</font><font color="#000000">this,&nbsp;actionBars</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">}</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </font><font color="#000000">}</font><font
color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">propertySheetPage.setPropertySourceProvider </font><font
color="#000000">(</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">AdapterFactoryContentProvider</font><font
color="#000000">(</font><font color="#000000">adapterFactory</font><font
color="#000000">))</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>return&nbsp;</b></font><font
color="#000000">propertySheetPage;</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== --><br>
<br>
Markus Gieser wrote:
<blockquote cite="mid:fndcb5$ler$1@build.eclipse.org" type="cite">
<pre wrap="">Hi All!

I read through a lot of articles discussing how to realize property pages,
but I didn't found a solution (that I understand ;-)) for getting the
PropertySource for an EMF element.

What I want to do is the following:
My starting point is the edit part of an element. But how can I manipulate
the underlying EMF element and automatically updating the GMF graph? And I
want to do this within a PropertyPage.

Could really need some help here (if possible... also an easy explanation
;-))

Kind regards,
Markus


</pre>
</blockquote>
<br>
</body>
</html>

--------------060600090909030501060304--
Re: Getting PropertySource for EMF within GMF editor [message #169949 is a reply to message #169939] Fri, 25 January 2008 19:32 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C85F91.58432070
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Ed!

Perhaps I'm just to stupid, but I don't see the answer to my =
question...?

How can I get the IPropertySource for an EMF element from its GMF =
EditPart?

Regards,
Markus

"Ed Merks" <merks@ca.ibm.com> schrieb im Newsbeitrag =
news:fndd1i$sg4$1@build.eclipse.org...
Markus,

The generated EMF editor has a working example.

/**
* This is how the framework determines which interfaces we =
implement.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class key)
{
if (key.equals(IContentOutlinePage.class))
{
return showOutlineView() ? getContentOutlinePage() : null;
}
else if (key.equals(IPropertySheetPage.class))
{
return getPropertySheetPage();
}
else if (key.equals(IGotoMarker.class))
{
return this;
}
else
{
return super.getAdapter(key);
}
}


/**
* This accesses a cached version of the property sheet.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IPropertySheetPage getPropertySheetPage()
{
if (propertySheetPage =3D=3D null)
{
propertySheetPage =3D
new ExtendedPropertySheetPage(editingDomain)
{
@Override
public void setSelectionToViewer(List<?> selection)
{
PrimerEditor.this.setSelectionToViewer(selection);
PrimerEditor.this.setFocus();
}

@Override
public void setActionBars(IActionBars actionBars)
{
super.setActionBars(actionBars);
getActionBarContributor().shareGlobalActions(this, =
actionBars);
}
};
propertySheetPage.setPropertySourceProvider(new =
AdapterFactoryContentProvider(adapterFactory));
}

return propertySheetPage;
} =20



Markus Gieser wrote:=20
Hi All!

I read through a lot of articles discussing how to realize property =
pages,=20
but I didn't found a solution (that I understand ;-)) for getting the=20
PropertySource for an EMF element.

What I want to do is the following:
My starting point is the edit part of an element. But how can I =
manipulate=20
the underlying EMF element and automatically updating the GMF graph? And =
I=20
want to do this within a PropertyPage.

Could really need some help here (if possible... also an easy =
explanation=20
;-))

Kind regards,
Markus=20


=20

------=_NextPart_000_000B_01C85F91.58432070
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16587" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Ed!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Perhaps I'm just to stupid, but I don't =
see the=20
answer to my question...?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>How can I get the IPropertySource for =
an EMF=20
element from its GMF EditPart?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Markus</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
schrieb im Newsbeitrag <A=20
href=3D"news:fndd1i$sg4$1@build.eclipse.org">news:fndd1i$sg4$1@build.ecli=
pse.org</A>...</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">Markus,<BR><BR>The=20
generated EMF editor has a working example.<BR>
<STYLE type=3Dtext/css>CODE {
FONT-SIZE: 10pt; MARGIN: 0px; FONT-FAMILY: Courier New, Courier
}
</STYLE>
<!-- =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D --><!-- =3D Java Sourcecode to HTML automatically =
converted code =3D --><!-- =3D Java2Html Converter 5.0 [2006-02-26] by =
Markus Gebhard markus@jave.de =3D --><!-- =3D Further =
information: http://www.java2html.de =3D -->
<DIV class=3Djava align=3Dleft>
<TABLE height=3D986 cellSpacing=3D0 cellPadding=3D3 width=3D818 =
bgColor=3D#ffffff=20
border=3D0>
<TBODY>
<TR><!-- start source code -->
<TD vAlign=3Dtop noWrap align=3Dleft><CODE><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT =
color=3D#3f5fbf>/**</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
=
color=3D#3f5fbf> *&nbsp;This&nbsp;is&nbsp;how&nbsp;the&nb sp;framework&nbsp=
;determines&nbsp;which&nbsp;interfaces&nbsp;we&a mp;nbsp;implement. </FONT><BR>=
<FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;</FONT><FONT=20
=
color=3D#7f7f9f>&lt;!--&nbsp;begin-user-doc&nbsp;--&gt; </FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;</FONT><FONT=20
=
color=3D#7f7f9f>&lt;!--&nbsp;end-user-doc&nbsp;--&gt; </FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;@generated</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*/</FONT><BR><FONT =
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#646464>@SuppressWarnings</FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#2a00ff>"unchecked"</FONT><FONT =
color=3D#000000>)</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#646464>@Override</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#7f0055><B>public&nbsp;</B></FONT><FONT=20
color=3D#000000>Object&nbsp;getAdapter</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>Class&nbsp;key</FONT><FONT=20
color=3D#000000>)</FONT><BR><FONT =
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>if&nbsp;</B></FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#000000>key.equals</FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#000000>IContentOutlinePage.</FONT><FONT=20
color=3D#7f0055><B>class</B></FONT><FONT =
color=3D#000000>))</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT =

color=3D#7f0055><B>return&nbsp;</B></FONT><FONT=20
color=3D#000000>showOutlineView</FONT><FONT=20
color=3D#000000>()&nbsp;</FONT><FONT=20
color=3D#000000>?&nbsp;getContentOutlinePage</FONT><FONT=20
color=3D#000000>()&nbsp;</FONT><FONT =
color=3D#000000>:&nbsp;</FONT><FONT=20
color=3D#7f0055><B>null</B></FONT><FONT =
color=3D#000000>;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>else&nbsp;if&nbsp;</B></FONT> <FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>key.equals</FONT><FONT=20
color=3D#000000>(</FONT><FONT=20
color=3D#000000>IPropertySheetPage.</FONT><FONT=20
color=3D#7f0055><B>class</B></FONT><FONT =
color=3D#000000>))</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT =

color=3D#7f0055><B>return&nbsp;</B></FONT><FONT=20
color=3D#000000>getPropertySheetPage</FONT><FONT=20
color=3D#000000>()</FONT><FONT color=3D#000000>;</FONT><BR><FONT =

color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>else&nbsp;if&nbsp;</B></FONT> <FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>key.equals</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>IGotoMarker.</FONT><FONT=20
color=3D#7f0055><B>class</B></FONT><FONT =
color=3D#000000>))</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT =

color=3D#7f0055><B>return&nbsp;this</B></FONT><FONT=20
color=3D#000000>;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>else</B></FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT =

color=3D#7f0055><B>return&nbsp;super</B></FONT><FONT=20
color=3D#000000>.getAdapter</FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#000000>key</FONT><FONT color=3D#000000>)</FONT><FONT=20
color=3D#000000>;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><FONT =
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>}</FONT><BR><FONT =
color=3D#ffffff></FONT><BR><FONT=20
color=3D#ffffff></FONT><BR><FONT =
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>/**</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
=
color=3D#3f5fbf> *&nbsp;This&nbsp;accesses&nbsp;a&nbsp;cached &nbsp;version=
&nbsp;of&nbsp;the&nbsp;property&nbsp;sheet.</FONT ><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;</FONT><FONT=20
=
color=3D#7f7f9f>&lt;!--&nbsp;begin-user-doc&nbsp;--&gt; </FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;</FONT><FONT=20
=
color=3D#7f7f9f>&lt;!--&nbsp;end-user-doc&nbsp;--&gt; </FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;@generated</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*/</FONT><BR><FONT =
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#7f0055><B>public&nbsp;</B></FONT><FONT=20
=
color=3D#000000>IPropertySheetPage&nbsp;getPropertySheetPage </FONT><FONT =

color=3D#000000>()</FONT><BR><FONT =
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>if&nbsp;</B></FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#000000>propertySheetPage&nbsp;=3D=3D&nbsp; </FONT><FONT=20
color=3D#7f0055><B>null</B></FONT><FONT =
color=3D#000000>)</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT =

color=3D#000000>propertySheetPage&nbsp;=3D</FONT><BR> <FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </FONT><F=
ONT=20
color=3D#7f0055><B>new&nbsp;</B></FONT><FONT=20
color=3D#000000>ExtendedPropertySheetPage</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>editingDomain</FONT><FONT=20
color=3D#000000>)</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </FONT><F=
ONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#646464>@Override</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#7f0055><B>public&nbsp;</B></FONT><FONT=20
color=3D#7f0055><B>void&nbsp;</B></FONT><FONT=20
color=3D#000000>setSelectionToViewer</FONT><FONT=20
color=3D#000000>(</FONT><FONT=20
color=3D#000000>List&lt;?&gt;&nbsp;selection</FONT ><FONT=20
color=3D#000000>)</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>PrimerEditor.</FONT><FONT=20
color=3D#7f0055><B>this</B></FONT><FONT=20
color=3D#000000>.setSelectionToViewer</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>selection</FONT><FONT=20
color=3D#000000>)</FONT><FONT color=3D#000000>;</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>PrimerEditor.</FONT><FONT=20
color=3D#7f0055><B>this</B></FONT><FONT=20
color=3D#000000>.setFocus</FONT><FONT =
color=3D#000000>()</FONT><FONT=20
color=3D#000000>;</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#000000>}</FONT><BR><FONT =
color=3D#ffffff></FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#646464>@Override</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#7f0055><B>public&nbsp;</B></FONT><FONT=20
color=3D#7f0055><B>void&nbsp;</B></FONT><FONT=20
color=3D#000000>setActionBars</FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#000000>IActionBars&nbsp;actionBars</FONT><FONT=20
color=3D#000000>)</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#7f0055><B>super</B></FONT><FONT=20
color=3D#000000>.setActionBars</FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#000000>actionBars</FONT><FONT =
color=3D#000000>)</FONT><FONT=20
color=3D#000000>;</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>getActionBarContributor</FONT><FONT=20
color=3D#000000>()</FONT><FONT=20
color=3D#000000>.shareGlobalActions</FONT><FONT=20
color=3D#000000>(</FONT><FONT=20
color=3D#000000>this,&nbsp;actionBars</FONT><FONT=20
color=3D#000000>)</FONT><FONT color=3D#000000>;</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#000000>}</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </FONT><F=
ONT=20
color=3D#000000>}</FONT><FONT color=3D#000000>;</FONT><BR><FONT=20
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT =

=
color=3D#000000>propertySheetPage.setPropertySourceProvider </FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#7f0055><B>new&nbsp;</B></FONT><FONT=20
color=3D#000000>AdapterFactoryContentProvider</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>adapterFactory</FONT><FONT=20
color=3D#000000>))</FONT><FONT color=3D#000000>;</FONT><BR><FONT =

color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><FONT =
color=3D#ffffff></FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>return&nbsp;</B></FONT><FONT=20
color=3D#000000>propertySheetPage;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT =
color=3D#000000>}</FONT></CODE> </TD><!-- end source code =
--></TR></TBODY></TABLE></DIV><!-- =3D END of automatically =
generated HTML code =3D --><!-- =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D --><BR><BR>Markus=20
Gieser wrote:=20
<BLOCKQUOTE cite=3Dmid:fndcb5$ler$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Hi All!

I read through a lot of articles discussing how to realize property =
pages,=20
but I didn't found a solution (that I understand ;-)) for getting the=20
PropertySource for an EMF element.

What I want to do is the following:
My starting point is the edit part of an element. But how can I =
manipulate=20
the underlying EMF element and automatically updating the GMF graph? And =
I=20
want to do this within a PropertyPage.

Could really need some help here (if possible... also an easy =
explanation=20
;-))

Kind regards,
Markus=20


</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000B_01C85F91.58432070--
Re: Getting PropertySource for EMF within GMF editor [message #169959 is a reply to message #169949] Fri, 25 January 2008 19:44 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.
--------------070403090903040600040907
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Markus,

See how there is a property source provider being set for the properties
view? That's where the properties view gets its property source from.
I.e., AdaperFactoryContentProvider has a getPropertySource method.


Markus Gieser wrote:
> Hi Ed!
>
> Perhaps I'm just to stupid, but I don't see the answer to my question...?
>
> How can I get the IPropertySource for an EMF element from its GMF
> EditPart?
>
> Regards,
> Markus
>
> "Ed Merks" <merks@ca.ibm.com <mailto:merks@ca.ibm.com>> schrieb im
> Newsbeitrag news:fndd1i$sg4$1@build.eclipse.org...
>
> Markus,
>
> The generated EMF editor has a working example.
> | /**
> * This is how the framework determines which interfaces we implement.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> @SuppressWarnings("unchecked")
> @Override
> *public *Object getAdapter(Class key)
> {
> *if *(key.equals(IContentOutlinePage.*class*))
> {
> *return *showOutlineView() ? getContentOutlinePage() : *null*;
> }
> *else if *(key.equals(IPropertySheetPage.*class*))
> {
> *return *getPropertySheetPage();
> }
> *else if *(key.equals(IGotoMarker.*class*))
> {
> *return this*;
> }
> *else*
> {
> *return super*.getAdapter(key);
> }
> }
>
>
> /**
> * This accesses a cached version of the property sheet.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> *public *IPropertySheetPage getPropertySheetPage()
> {
> *if *(propertySheetPage == *null*)
> {
> propertySheetPage =
> *new *ExtendedPropertySheetPage(editingDomain)
> {
> @Override
> *public **void *setSelectionToViewer(List<?> selection)
> {
> PrimerEditor.*this*.setSelectionToViewer(selection);
> PrimerEditor.*this*.setFocus();
> }
>
> @Override
> *public **void *setActionBars(IActionBars actionBars)
> {
> *super*.setActionBars(actionBars);
> getActionBarContributor().shareGlobalActions(this, actionBars);
> }
> };
> propertySheetPage.setPropertySourceProvider(*new *AdapterFactoryContentProvider(adapterFactory));
> }
>
> *return *propertySheetPage;
> }|
>
>
>
> Markus Gieser wrote:
>> Hi All!
>>
>> I read through a lot of articles discussing how to realize property pages,
>> but I didn't found a solution (that I understand ;-)) for getting the
>> PropertySource for an EMF element.
>>
>> What I want to do is the following:
>> My starting point is the edit part of an element. But how can I manipulate
>> the underlying EMF element and automatically updating the GMF graph? And I
>> want to do this within a PropertyPage.
>>
>> Could really need some help here (if possible... also an easy explanation
>> ;-))
>>
>> Kind regards,
>> Markus
>>
>>
>>
>


--------------070403090903040600040907
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Markus,<br>
<br>
See how there is a property source provider being set for the
properties view?&nbsp; That's where the properties view gets its property
source from.&nbsp; I.e., AdaperFactoryContentProvider has a
getPropertySource method.<br>
<br>
<br>
Markus Gieser wrote:
<blockquote cite="mid:fnddin$1h1$1@build.eclipse.org" type="cite">
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.6000.16587" name="GENERATOR">
<div><font face="Arial" size="2">Hi Ed!</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Perhaps I'm just to stupid, but I
don't see the answer to my question...?</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">How can I get the IPropertySource
for an EMF element from its GMF EditPart?</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Regards,</font></div>
<div><font face="Arial" size="2">Markus</font></div>
<div>&nbsp;</div>
<div>"Ed Merks" &lt;<a moz-do-not-send="true"
href="mailto:merks@ca.ibm.com">merks@ca.ibm.com</a>&gt; schrieb im
Newsbeitrag <a moz-do-not-send="true"
href="news:fndd1i$sg4$1@build.eclipse.org">news:fndd1i$sg4$1@build.eclipse.org</a>...</div>
<blockquote
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">Markus,<br>
<br>
The generated EMF editor has a working example.<br>
<style type="text/css">CODE {
FONT-SIZE: 10pt; MARGIN: 0px; FONT-FAMILY: Courier New, Courier
}
</style><!-- ======================================================== --><!-- = 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"
height="986" width="818">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"><code><font color="#ffffff">&nbsp;&nbsp;</font><font color="#3f5fbf">/**</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf"> *&nbsp;This&nbsp;is&nbsp;how&nbsp;the&nb sp;framework&nbsp;determines&nbsp;which&nbsp;int erfaces&nbsp;we&nbsp;implement. </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font
color="#7f7f9f">&lt;!--&nbsp;begin-user-doc&nbsp;--&gt; </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font
color="#7f7f9f">&lt;!--&nbsp;end-user-doc&nbsp;--&gt; </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;@generated</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*/</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#646464">@SuppressWarnings</font><font
color="#000000">(</font><font color="#2a00ff">"unchecked"</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#646464">@Override</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#000000">Object&nbsp;getAdapter</font><font color="#000000">(</font><font
color="#000000">Class&nbsp;key</font><font color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>if&nbsp;</b></font><font
color="#000000">(</font><font color="#000000">key.equals</font><font
color="#000000">(</font><font color="#000000">IContentOutlinePage.</font><font
color="#7f0055"><b>class</b></font><font color="#000000">))</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>return&nbsp;</b></font><font
color="#000000">showOutlineView</font><font color="#000000">()&nbsp;</font><font
color="#000000">?&nbsp;getContentOutlinePage</font><font color="#000000">()&nbsp;</font><font
color="#000000">:&nbsp;</font><font color="#7f0055"><b>null</b></font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>else&nbsp;if&nbsp;</b></font ><font
color="#000000">(</font><font color="#000000">key.equals</font><font
color="#000000">(</font><font color="#000000">IPropertySheetPage.</font><font
color="#7f0055"><b>class</b></font><font color="#000000">))</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>return&nbsp;</b></font><font
color="#000000">getPropertySheetPage</font><font color="#000000">()</font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>else&nbsp;if&nbsp;</b></font ><font
color="#000000">(</font><font color="#000000">key.equals</font><font
color="#000000">(</font><font color="#000000">IGotoMarker.</font><font
color="#7f0055"><b>class</b></font><font color="#000000">))</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>return&nbsp;this</b></font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>else</b></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>return&nbsp;super</b></font><font
color="#000000">.getAdapter</font><font color="#000000">(</font><font
color="#000000">key</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<br>
<br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#3f5fbf">/**</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf"> *&nbsp;This&nbsp;accesses&nbsp;a&nbsp;cached &nbsp;version&nbsp;of&nbsp;the&nbsp;property &nbsp;sheet. </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font
color="#7f7f9f">&lt;!--&nbsp;begin-user-doc&nbsp;--&gt; </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font
color="#7f7f9f">&lt;!--&nbsp;end-user-doc&nbsp;--&gt; </font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;@generated</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*/</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#000000">IPropertySheetPage&nbsp;getPropertySheetPage </font><font
color="#000000">()</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>if&nbsp;</b></font><font
color="#000000">(</font><font color="#000000">propertySheetPage&nbsp;==&nbsp;</font ><font
color="#7f0055"><b>null</b></font><font color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">propertySheetPage&nbsp;=</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">ExtendedPropertySheetPage</font><font color="#000000">(</font><font
color="#000000">editingDomain</font><font color="#000000">)</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </font><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#646464">@Override</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#7f0055"><b>void&nbsp;</b></font><font color="#000000">setSelectionToViewer</font><font
color="#000000">(</font><font color="#000000">List&lt;?&gt;&nbsp;selection</font ><font
color="#000000">)</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">PrimerEditor.</font><font
color="#7f0055"><b>this</b></font><font color="#000000">.setSelectionToViewer</font><font
color="#000000">(</font><font color="#000000">selection</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">PrimerEditor.</font><font
color="#7f0055"><b>this</b></font><font color="#000000">.setFocus</font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">}</font><br>
<br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#646464">@Override</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#7f0055"><b>void&nbsp;</b></font><font color="#000000">setActionBars</font><font
color="#000000">(</font><font color="#000000">IActionBars&nbsp;actionBars</font><font
color="#000000">)</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">{</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#7f0055"><b>super</b></font><font
color="#000000">.setActionBars</font><font color="#000000">(</font><font
color="#000000">actionBars</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">getActionBarContributor</font><font
color="#000000">()</font><font color="#000000">.shareGlobalActions</font><font
color="#000000">(</font><font color="#000000">this,&nbsp;actionBars</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">}</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </font><font color="#000000">}</font><font
color="#000000">;</font><br>
<font color="#ffffff"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#000000">propertySheetPage.setPropertySourceProvider </font><font
color="#000000">(</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">AdapterFactoryContentProvider</font><font
color="#000000">(</font><font color="#000000">adapterFactory</font><font
color="#000000">))</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#000000">}</font><br>
<br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font ><font color="#7f0055"><b>return&nbsp;</b></font><font
color="#000000">propertySheetPage;</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font></code>
</td>
<!-- end source code --></tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = --><!-- ======================================================== --><br>
<br>
Markus Gieser wrote:
<blockquote cite="mid:fndcb5$ler$1@build.eclipse.org" type="cite">
<pre wrap="">Hi All!

I read through a lot of articles discussing how to realize property pages,
but I didn't found a solution (that I understand ;-)) for getting the
PropertySource for an EMF element.

What I want to do is the following:
My starting point is the edit part of an element. But how can I manipulate
the underlying EMF element and automatically updating the GMF graph? And I
want to do this within a PropertyPage.

Could really need some help here (if possible... also an easy explanation
;-))

Kind regards,
Markus


</pre>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
</body>
</html>

--------------070403090903040600040907--
Re: Getting PropertySource for EMF within GMF editor [message #170075 is a reply to message #169959] Sun, 27 January 2008 17:01 Go to previous message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C8610E.AB20F780
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I got it now... thanks for your help!
"Ed Merks" <merks@ca.ibm.com> schrieb im Newsbeitrag =
news:fnde7p$7bp$1@build.eclipse.org...
Markus,

See how there is a property source provider being set for the =
properties view? That's where the properties view gets its property =
source from. I.e., AdaperFactoryContentProvider has a getPropertySource =
method.


Markus Gieser wrote:=20
Hi Ed!

Perhaps I'm just to stupid, but I don't see the answer to my =
question...?

How can I get the IPropertySource for an EMF element from its GMF =
EditPart?

Regards,
Markus

"Ed Merks" <merks@ca.ibm.com> schrieb im Newsbeitrag =
news:fndd1i$sg4$1@build.eclipse.org...
Markus,

The generated EMF editor has a working example.

/**
* This is how the framework determines which interfaces =
we implement.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class key)
{
if (key.equals(IContentOutlinePage.class))
{
return showOutlineView() ? getContentOutlinePage() : =
null;
}
else if (key.equals(IPropertySheetPage.class))
{
return getPropertySheetPage();
}
else if (key.equals(IGotoMarker.class))
{
return this;
}
else
{
return super.getAdapter(key);
}
}


/**
* This accesses a cached version of the property sheet.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IPropertySheetPage getPropertySheetPage()
{
if (propertySheetPage =3D=3D null)
{
propertySheetPage =3D
new ExtendedPropertySheetPage(editingDomain)
{
@Override
public void setSelectionToViewer(List<?> =
selection)
{
=
PrimerEditor.this.setSelectionToViewer(selection);
PrimerEditor.this.setFocus();
}

@Override
public void setActionBars(IActionBars actionBars)
{
super.setActionBars(actionBars);
=
getActionBarContributor().shareGlobalActions(this, actionBars);
}
};
propertySheetPage.setPropertySourceProvider(new =
AdapterFactoryContentProvider(adapterFactory));
}

return propertySheetPage;
} =20



Markus Gieser wrote:=20
Hi All!

I read through a lot of articles discussing how to realize property =
pages,=20
but I didn't found a solution (that I understand ;-)) for getting the=20
PropertySource for an EMF element.

What I want to do is the following:
My starting point is the edit part of an element. But how can I =
manipulate=20
the underlying EMF element and automatically updating the GMF graph? And =
I=20
want to do this within a PropertyPage.

Could really need some help here (if possible... also an easy =
explanation=20
;-))

Kind regards,
Markus=20


=20



------=_NextPart_000_000C_01C8610E.AB20F780
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16587" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I got it now... thanks for your =
help!</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
schrieb im Newsbeitrag <A=20
=
href=3D"news:fnde7p$7bp$1@build.eclipse.org">news:fnde7p$7bp$1@build.ecli=
pse.org</A>...</DIV>Markus,<BR><BR>See=20
how there is a property source provider being set for the properties=20
view?&nbsp; That's where the properties view gets its property source=20
from.&nbsp; I.e., AdaperFactoryContentProvider has a getPropertySource =

method.<BR><BR><BR>Markus Gieser wrote:=20
<BLOCKQUOTE cite=3Dmid:fnddin$1h1$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.6000.16587" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>Hi Ed!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Perhaps I'm just to stupid, but I =
don't see the=20
answer to my question...?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>How can I get the IPropertySource =
for an EMF=20
element from its GMF EditPart?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Markus</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>"Ed Merks" &lt;<A href=3D"mailto:merks@ca.ibm.com"=20
moz-do-not-send=3D"true">merks@ca.ibm.com</A>&gt; schrieb im =
Newsbeitrag <A=20
href=3D"news:fndd1i$sg4$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:fndd1i$sg4$1@build.eclipse.org</A>...</DIV>=

<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">Markus,<BR><BR>The =

generated EMF editor has a working example.<BR>
<STYLE type=3Dtext/css>CODE {
FONT-SIZE: 10pt; MARGIN: 0px; FONT-FAMILY: Courier New, Courier
}
</STYLE>
<!-- =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D --><!-- =3D Java Sourcecode to HTML automatically =
converted code =3D --><!-- =3D Java2Html Converter 5.0 [2006-02-26] by =
Markus Gebhard markus@jave.de =3D --><!-- =3D Further =
information: http://www.java2html.de =3D -->
<DIV class=3Djava align=3Dleft>
<TABLE height=3D986 cellSpacing=3D0 cellPadding=3D3 width=3D818 =
bgColor=3D#ffffff=20
border=3D0>
<TBODY>
<TR><!-- start source code -->
<TD vAlign=3Dtop noWrap align=3Dleft><CODE><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>/**</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
=
color=3D#3f5fbf> *&nbsp;This&nbsp;is&nbsp;how&nbsp;the&nb sp;framework&nbsp=
;determines&nbsp;which&nbsp;interfaces&nbsp;we&a mp;nbsp;implement. </FONT><BR>=
<FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;</FONT><FONT=20
=
color=3D#7f7f9f>&lt;!--&nbsp;begin-user-doc&nbsp;--&gt; </FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;</FONT><FONT=20
=
color=3D#7f7f9f>&lt;!--&nbsp;end-user-doc&nbsp;--&gt; </FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;@generated</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*/</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#646464>@SuppressWarnings</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#2a00ff>"unchecked"</FONT><FONT=20
color=3D#000000>)</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#646464>@Override</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#7f0055><B>public&nbsp;</B></FONT><FONT=20
color=3D#000000>Object&nbsp;getAdapter</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>Class&nbsp;key</FONT><FONT=20
color=3D#000000>)</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>if&nbsp;</B></FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>key.equals</FONT><FONT=20
color=3D#000000>(</FONT><FONT=20
color=3D#000000>IContentOutlinePage.</FONT><FONT=20
color=3D#7f0055><B>class</B></FONT><FONT=20
color=3D#000000>))</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT=20
color=3D#7f0055><B>return&nbsp;</B></FONT><FONT=20
color=3D#000000>showOutlineView</FONT><FONT=20
color=3D#000000>()&nbsp;</FONT><FONT=20
color=3D#000000>?&nbsp;getContentOutlinePage</FONT><FONT=20
color=3D#000000>()&nbsp;</FONT><FONT =
color=3D#000000>:&nbsp;</FONT><FONT=20
color=3D#7f0055><B>null</B></FONT><FONT=20
color=3D#000000>;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>else&nbsp;if&nbsp;</B></FONT> <FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>key.equals</FONT><FONT=20
color=3D#000000>(</FONT><FONT=20
color=3D#000000>IPropertySheetPage.</FONT><FONT=20
color=3D#7f0055><B>class</B></FONT><FONT=20
color=3D#000000>))</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT=20
color=3D#7f0055><B>return&nbsp;</B></FONT><FONT=20
color=3D#000000>getPropertySheetPage</FONT><FONT=20
color=3D#000000>()</FONT><FONT =
color=3D#000000>;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>else&nbsp;if&nbsp;</B></FONT> <FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>key.equals</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>IGotoMarker.</FONT><FONT=20
color=3D#7f0055><B>class</B></FONT><FONT=20
color=3D#000000>))</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT=20
color=3D#7f0055><B>return&nbsp;this</B></FONT><FONT=20
color=3D#000000>;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>else</B></FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT=20
color=3D#7f0055><B>return&nbsp;super</B></FONT><FONT=20
color=3D#000000>.getAdapter</FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#000000>key</FONT><FONT =
color=3D#000000>)</FONT><FONT=20
color=3D#000000>;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>}</FONT><BR><BR><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>/**</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
=
color=3D#3f5fbf> *&nbsp;This&nbsp;accesses&nbsp;a&nbsp;cached &nbsp;version=
&nbsp;of&nbsp;the&nbsp;property&nbsp;sheet.</FONT ><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;</FONT><FONT=20
=
color=3D#7f7f9f>&lt;!--&nbsp;begin-user-doc&nbsp;--&gt; </FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;</FONT><FONT=20
=
color=3D#7f7f9f>&lt;!--&nbsp;end-user-doc&nbsp;--&gt; </FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*&nbsp;@generated</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#3f5fbf>*/</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#7f0055><B>public&nbsp;</B></FONT><FONT=20
=
color=3D#000000>IPropertySheetPage&nbsp;getPropertySheetPage </FONT><FONT =

color=3D#000000>()</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>if&nbsp;</B></FONT><FONT=20
color=3D#000000>(</FONT><FONT=20
=
color=3D#000000>propertySheetPage&nbsp;=3D=3D&nbsp; </FONT><FONT=20
color=3D#7f0055><B>null</B></FONT><FONT=20
color=3D#000000>)</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT=20
color=3D#000000>propertySheetPage&nbsp;=3D</FONT><BR> <FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </FONT><F=
ONT=20
color=3D#7f0055><B>new&nbsp;</B></FONT><FONT=20
color=3D#000000>ExtendedPropertySheetPage</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>editingDomain</FONT><FONT=20
color=3D#000000>)</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </FONT><F=
ONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#646464>@Override</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#7f0055><B>public&nbsp;</B></FONT><FONT=20
color=3D#7f0055><B>void&nbsp;</B></FONT><FONT=20
color=3D#000000>setSelectionToViewer</FONT><FONT=20
color=3D#000000>(</FONT><FONT=20
color=3D#000000>List&lt;?&gt;&nbsp;selection</FONT ><FONT=20
color=3D#000000>)</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>PrimerEditor.</FONT><FONT=20
color=3D#7f0055><B>this</B></FONT><FONT=20
color=3D#000000>.setSelectionToViewer</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>selection</FONT><FONT=20
color=3D#000000>)</FONT><FONT =
color=3D#000000>;</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>PrimerEditor.</FONT><FONT=20
color=3D#7f0055><B>this</B></FONT><FONT=20
color=3D#000000>.setFocus</FONT><FONT =
color=3D#000000>()</FONT><FONT=20
color=3D#000000>;</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#000000>}</FONT><BR><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#646464>@Override</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#7f0055><B>public&nbsp;</B></FONT><FONT=20
color=3D#7f0055><B>void&nbsp;</B></FONT><FONT=20
color=3D#000000>setActionBars</FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#000000>IActionBars&nbsp;actionBars</FONT><FONT=20
color=3D#000000>)</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#000000>{</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#7f0055><B>super</B></FONT><FONT=20
color=3D#000000>.setActionBars</FONT><FONT =
color=3D#000000>(</FONT><FONT=20
color=3D#000000>actionBars</FONT><FONT =
color=3D#000000>)</FONT><FONT=20
color=3D#000000>;</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;</FONT><FONT=20
color=3D#000000>getActionBarContributor</FONT><FONT=20
color=3D#000000>()</FONT><FONT=20
color=3D#000000>.shareGlobalActions</FONT><FONT=20
color=3D#000000>(</FONT><FONT=20
color=3D#000000>this,&nbsp;actionBars</FONT><FONT=20
color=3D#000000>)</FONT><FONT =
color=3D#000000>;</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;</FONT><FONT=20
color=3D#000000>}</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </FONT><F=
ONT=20
color=3D#000000>}</FONT><FONT =
color=3D#000000>;</FONT><BR><FONT=20
=
color=3D#ffffff> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT=20
=
color=3D#000000>propertySheetPage.setPropertySourceProvider </FONT><FONT=20
color=3D#000000>(</FONT><FONT=20
color=3D#7f0055><B>new&nbsp;</B></FONT><FONT=20
color=3D#000000>AdapterFactoryContentProvider</FONT><FONT=20
color=3D#000000>(</FONT><FONT =
color=3D#000000>adapterFactory</FONT><FONT=20
color=3D#000000>))</FONT><FONT =
color=3D#000000>;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#000000>}</FONT><BR><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT ><FONT=20
color=3D#7f0055><B>return&nbsp;</B></FONT><FONT=20
color=3D#000000>propertySheetPage;</FONT><BR><FONT=20
color=3D#ffffff>&nbsp;&nbsp;</FONT><FONT =
color=3D#000000>}</FONT></CODE>=20
</TD><!-- end source code --></TR></TBODY></TABLE></DIV><!-- =
=3D END of automatically generated HTML code =3D --><!-- =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D --><BR><BR>Markus=20
Gieser wrote:=20
<BLOCKQUOTE cite=3Dmid:fndcb5$ler$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Hi All!

I read through a lot of articles discussing how to realize property =
pages,=20
but I didn't found a solution (that I understand ;-)) for getting the=20
PropertySource for an EMF element.

What I want to do is the following:
My starting point is the edit part of an element. But how can I =
manipulate=20
the underlying EMF element and automatically updating the GMF graph? And =
I=20
want to do this within a PropertyPage.

Could really need some help here (if possible... also an easy =
explanation=20
;-))

Kind regards,
Markus=20


=
</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BLOCKQUOTE><BR></BLOCKQUOTE ></BODY>=
</HTML>

------=_NextPart_000_000C_01C8610E.AB20F780--
Previous Topic:SpecializationType just takes one IEditHelperAdvice
Next Topic:How to extend the diagram xml/xmi file?
Goto Forum:
  


Current Time: Thu Sep 26 03:22:30 GMT 2024

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

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

Back to the top