| Re: Custom editor development [message #389888] |
Thu, 09 December 2004 09:25  |
Eclipse User |
|
|
|
Originally posted by: emmerich.salt.ac.za
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
From a previous posting entitled "Custom editor development" by Sugato
Bagchi on 2004/04/19 19:34<br>
[Sugato]
<blockquote cite="midc612af$rv1$2@eclipse.org" type="cite">
<pre wrap="">Is there an example that shows how the EMF generated editor could be
customized? For example, I would like to create a tree editor page that has
a different tree representation than the one deduced from the UML
containment structure.
</pre>
</blockquote>
[Roy]<br>
A little bit of background. Let me explain what I'm trying to do. I'm
writing an astronomical application for the Southern African Large
Telescope <a class="moz-txt-link-rfc2396E" href="http://www.salt.ac.za"><http://www.salt.ac.za></a> which will basically edit an
RTML file (Remote Telescope
Markup Language <<a class="moz-txt-link-abbreviated"
href="http://www.rtml.de">http://www.rtml.de</a>>). So I have a
well defined schema. According to the RTML schema a valid XML document
could look something like this (simplified):<br>
<br>
<font color="#ff0000"><RTML version="3.0f"></font><br>
<font color="#9999ff"><History><br>
</History><br>
<Project><br>
</Project></font><br>
<font color="#33cc00"><Target <font color="#3333ff">name="abc"</font>><br>
</Target><br>
<Target <font color="#3333ff">name="xyz"</font>><br>
</Target></font><br>
<font color="#ff0000"></RTML></font><br>
<br>
How I want this to be depicted in my tree viewer is like this:<br>
<br>
<font color="#9999ff">Proposal</font> (representing the <font
color="#ff0000"><RTML></font> tag. Will show <font
color="#9999ff"><History></font> & <font color="#9999ff"><Project></font>
tags combined in custom property page)<br>
'-- <font color="#33cc00">Targets</font> (a phantom object)<br>
|-- <font color="#3333ff">abc <font color="#000000">(1:1
mapping with a target)</font><br>
<font color="#000000">'--</font> xyz </font><font
color="#3333ff"><font color="#000000">(1:1
mapping with a target)<br>
<br>
The phantom object idea I got from the "</font></font>Providing content
for an EMF model" section of the EMF.Edit Framework Overview<br>
<a class="moz-txt-link-rfc2396E"
href=" http://download.eclipse.org/tools/emf/scripts/docs.php?doc=r eferences/overview/EMF.Edit.html "> <http://download.eclipse.org/tools/emf/scripts/docs.p hp?doc=references/overview/EMF.Edit.html> </a><br>
<font color="#3333ff"><font color="#000000"><br>
From a previous posting entitled "[newbie] Supressing one level of
objects in a tree view" by Paul Trevithick on 2004/09/10 04:15 I've
managed to figure out how to suppress the <font color="#9999ff"><History></font>
& <font color="#9999ff"><Project></font> tags in the tree
view.<br>
<br>
My questions:<br>
1. How do I insert the phantom <font color="#33cc00">Targets</font>
item programatically into the treeviewer upon opening an existing RTML
file or upon the creation of a new one?<br>
2. What form must this phantom object take? Should I manually create a <font
color="#cc0000">TargetsItemProvider</font>? From the </font></font>EMF.Edit
Framework Overview it claims that it can be any java <font
color="#cc0000">Object</font>. I'm assuming it must at least implement
<font color="#cc0000">ITreeItemContentProvider</font> to be visible in
the treeviewer? Suggestions?<br>
3. When a user right clicks on the <font color="#3333ff"><font
color="#000000"><font color="#33cc00">Targets</font></font></font>
item in the treeviewer I need it to display to the user that they can
create a new target as a child of <font color="#3333ff"><font
color="#000000"><font color="#33cc00">Targets</font></font></font>. I
assume that to add this behaviour I need to be delving into the <font
color="#cc0000">ActionBarContributer</font> in the .editor code? Any
other tips (I admit I haven't done much trawling on this subject but I
assume if there isn't much about phantom objects there won't be much
about this)<br>
<font color="#3333ff"><font color="#000000"><br>
Many thanks for your time. It's a great newsgroup and a fantastic
framework!<br>
<br>
Roy</font></font><br>
<pre class="moz-signature" cols="72">--
Roy Emmerich
Software Engineer
SALT - Southern African Large Telescope
emmerich(at)salt.ac.za (email)
<a class="moz-txt-link-abbreviated" href="http://www.salt.ac.za">www.salt.ac.za</a> (web)
</pre>
</body>
</html>
|
|
|
|
| Re: Custom editor development [message #389908 is a reply to message #389888] |
Fri, 10 December 2004 09:48  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------070508020109070804040201
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Roy,
As Amin explains, the book has good details on this. The basic idea is
to use a derived version of the ProposalItemProvider to represent the
hand written TargetsItemProvider. It can already show Targets children
just how you want, and you only need to change the label and suppress
some of the things you don't want.
Roy Emmerich wrote:
> From a previous posting entitled "Custom editor development" by Sugato
> Bagchi on 2004/04/19 19:34
> [Sugato]
>
>>Is there an example that shows how the EMF generated editor could be
>>customized? For example, I would like to create a tree editor page that has
>>a different tree representation than the one deduced from the UML
>>containment structure.
>>
>>
> [Roy]
> A little bit of background. Let me explain what I'm trying to do. I'm
> writing an astronomical application for the Southern African Large
> Telescope <http://www.salt.ac.za> which will basically edit an RTML
> file (Remote Telescope Markup Language <http://www.rtml.de>). So I
> have a well defined schema. According to the RTML schema a valid XML
> document could look something like this (simplified):
>
> <RTML version="3.0f">
> <History>
> </History>
> <Project>
> </Project>
> <Target name="abc">
> </Target>
> <Target name="xyz">
> </Target>
> </RTML>
>
> How I want this to be depicted in my tree viewer is like this:
>
> Proposal (representing the <RTML> tag. Will show <History> &
> <Project> tags combined in custom property page)
> '-- Targets (a phantom object)
> |-- abc (1:1 mapping with a target)
> '-- xyz (1:1 mapping with a target)
>
> The phantom object idea I got from the "Providing content for an EMF
> model" section of the EMF.Edit Framework Overview
> < http://download.eclipse.org/tools/emf/scripts/docs.php?doc=r eferences/overview/EMF.Edit.html >
>
> From a previous posting entitled "[newbie] Supressing one level of
> objects in a tree view" by Paul Trevithick on 2004/09/10 04:15 I've
> managed to figure out how to suppress the <History> & <Project> tags
> in the tree view.
>
> My questions:
> 1. How do I insert the phantom Targets item programatically into the
> treeviewer upon opening an existing RTML file or upon the creation of
> a new one?
> 2. What form must this phantom object take? Should I manually create a
> TargetsItemProvider? From the EMF.Edit Framework Overview it claims
> that it can be any java Object. I'm assuming it must at least
> implement ITreeItemContentProvider to be visible in the treeviewer?
> Suggestions?
> 3. When a user right clicks on the Targets item in the treeviewer I
> need it to display to the user that they can create a new target as a
> child of Targets. I assume that to add this behaviour I need to be
> delving into the ActionBarContributer in the .editor code? Any other
> tips (I admit I haven't done much trawling on this subject but I
> assume if there isn't much about phantom objects there won't be much
> about this)
>
> Many thanks for your time. It's a great newsgroup and a fantastic
> framework!
>
> Roy
>
>--
>Roy Emmerich
>Software Engineer
>SALT - Southern African Large Telescope
>emmerich(at)salt.ac.za (email)
>www.salt.ac.za (web)
>
>
--------------070508020109070804040201
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">
Roy,<br>
<br>
As Amin explains, the book has good details on this. The basic idea is
to use a derived version of the ProposalItemProvider to represent the
hand written TargetsItemProvider. It can already show Targets children
just how you want, and you only need to change the label and suppress
some of the things you don't want.<br>
<br>
<br>
Roy Emmerich wrote:
<blockquote cite="midcp9n9e$6na$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
From a previous posting entitled "Custom editor development" by Sugato
Bagchi on 2004/04/19 19:34<br>
[Sugato]
<blockquote cite="midc612af$rv1$2@eclipse.org" type="cite">
<pre wrap="">Is there an example that shows how the EMF generated editor could be
customized? For example, I would like to create a tree editor page that has
a different tree representation than the one deduced from the UML
containment structure.
</pre>
</blockquote>
[Roy]<br>
A little bit of background. Let me explain what I'm trying to do. I'm
writing an astronomical application for the Southern African Large
Telescope <a class="moz-txt-link-rfc2396E" href="http://www.salt.ac.za"><http://www.salt.ac.za></a>
which will basically edit an
RTML file (Remote Telescope
Markup Language <<a class="moz-txt-link-abbreviated"
href="http://www.rtml.de">http://www.rtml.de</a>>). So I have a
well defined schema. According to the RTML schema a valid XML document
could look something like this (simplified):<br>
<br>
<font color="#ff0000"><RTML version="3.0f"></font><br>
<font color="#9999ff"><History><br>
</History><br>
<Project><br>
</Project></font><br>
<font color="#33cc00"><Target <font color="#3333ff">name="abc"</font>><br>
</Target><br>
<Target <font color="#3333ff">name="xyz"</font>><br>
</Target></font><br>
<font color="#ff0000"></RTML></font><br>
<br>
How I want this to be depicted in my tree viewer is like this:<br>
<br>
<font color="#9999ff">Proposal</font> (representing the <font
color="#ff0000"><RTML></font> tag. Will show <font
color="#9999ff"><History></font> & <font color="#9999ff"><Project></font>
tags combined in custom property page)<br>
'-- <font color="#33cc00">Targets</font> (a phantom object)<br>
|-- <font color="#3333ff">abc <font color="#000000">(1:1
mapping with a target)</font><br>
<font color="#000000">'--</font> xyz </font><font
color="#3333ff"><font color="#000000">(1:1
mapping with a target)<br>
<br>
The phantom object idea I got from the "</font></font>Providing content
for an EMF model" section of the EMF.Edit Framework Overview<br>
<a class="moz-txt-link-rfc2396E"
href=" http://download.eclipse.org/tools/emf/scripts/docs.php?doc=r eferences/overview/EMF.Edit.html "> <http://download.eclipse.org/tools/emf/scripts/docs.p hp?doc=references/overview/EMF.Edit.html> </a><br>
<font color="#3333ff"><font color="#000000"><br>
From a previous posting entitled "[newbie] Supressing one level of
objects in a tree view" by Paul Trevithick on 2004/09/10 04:15 I've
managed to figure out how to suppress the <font color="#9999ff"><History></font>
& <font color="#9999ff"><Project></font> tags in the tree
view.<br>
<br>
My questions:<br>
1. How do I insert the phantom <font color="#33cc00">Targets</font>
item programatically into the treeviewer upon opening an existing RTML
file or upon the creation of a new one?<br>
2. What form must this phantom object take? Should I manually create a <font
color="#cc0000">TargetsItemProvider</font>? From the </font></font>EMF.Edit
Framework Overview it claims that it can be any java <font
color="#cc0000">Object</font>. I'm assuming it must at least implement
<font color="#cc0000">ITreeItemContentProvider</font> to be visible
in
the treeviewer? Suggestions?<br>
3. When a user right clicks on the <font color="#3333ff"><font
color="#000000"><font color="#33cc00">Targets</font></font></font>
item in the treeviewer I need it to display to the user that they can
create a new target as a child of <font color="#3333ff"><font
color="#000000"><font color="#33cc00">Targets</font></font></font>. I
assume that to add this behaviour I need to be delving into the <font
color="#cc0000">ActionBarContributer</font> in the .editor code? Any
other tips (I admit I haven't done much trawling on this subject but I
assume if there isn't much about phantom objects there won't be much
about this)<br>
<font color="#3333ff"><font color="#000000"><br>
Many thanks for your time. It's a great newsgroup and a fantastic
framework!<br>
<br>
Roy</font></font><br>
<pre class="moz-signature" cols="72">--
Roy Emmerich
Software Engineer
SALT - Southern African Large Telescope
emmerich(at)salt.ac.za (email)
<a class="moz-txt-link-abbreviated" href="http://www.salt.ac.za">www.salt.ac.za</a> (web)
</pre>
</blockquote>
<br>
</body>
</html>
--------------070508020109070804040201--
|
|
|
Powered by
FUDForum. Page generated in 0.04337 seconds