Home » Modeling » EMF » Unable to View contents in EMF Editor
Unable to View contents in EMF Editor [message #417322] |
Wed, 05 March 2008 08:31  |
Eclipse User |
|
|
|
Hi,
I am playing with the Generated EMF editor by removing the inline pages
and creating the Pages as Seperate EditorParts and adding the same to the
Multipage editor.
When my input to the Editor Part is called i see the a XXXResourceImpl is
passed as input
I have added the AdapterFactoryContent and LabelProvider to my tree, when
the editor is opened I am unable to see the Root Element Object or
anything else in the Tree , just an empty tree is visible ..
Can anyone let me know where i would have gone wrong ??
My EditorPart code snippet :
public class TableTreeEditorPart extends AbstractPortalStructureEditPart {
private TreeViewer treeViewer;
private Tree tree;
public TableTreeEditorPart(PortalStructureEditor editor) {
super(editor);
}
/*
* (non-Javadoc)
*
* @see
org.eclipse.ui.part.WorkbenchPart#createPartControl(org.ecli pse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
treeViewer = new TreeViewer(parent, SWT.NONE);
tree = treeViewer.getTree();
tree.setLayout(new FillLayout());
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
treeViewer.setContentProvider(new AdapterFactoryContentProvider(
getAdapterFactory()));
treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(
getAdapterFactory()));
createContextMenuFor(treeViewer);
getEditorSite().setSelectionProvider(treeViewer);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
@Override
public void setFocus() {
tree.setFocus();
}
/*
* (non-Javadoc)
*
* @see
com.accenture.portal.tools.xasgen.portalstructure.presentati on.parts.AbstractPortalStructureEditPart#setInput(java.lang. Object)
*/
@Override
public void setInput(Object input) {
System.out.println("TableTreeEditorPart.setInput() : " + input);
assert input != null;
assert treeViewer != null;
treeViewer.setInput(input);
}
}
|
|
| | | | | |
Re: Unable to View contents in EMF Editor [message #417333 is a reply to message #417331] |
Wed, 05 March 2008 11:01   |
Eclipse User |
|
|
|
Thanks Ed. I am able to rectify it .. Also i do have a one more question on
the Selection ,
I am using the MultipageSelectionProvider for the Editor , in my tree when i
click on the node and add a child or sibling my Selection still remains on
the Node from which I initiated the Command , my question is how do I move
the selection to the newly added element ???
This works fine with the Generated editor , my doubt is that am making a
mess with the Selection with my dissected EMF editor ???
Thoughts please ...
"Ed Merks" <merks@ca.ibm.com> wrote in message
news:fqmfqi$du0$2@build.eclipse.org...
> Kamesh,
>
> The generated editor's handleContentOutlineSelection shows how to do that
> doesn't it?
>
>
> Kamesh Sampath wrote:
>> Hi Ed,
>>
>> I debugged the issue , the issue was with the ContentOutlineSelection.
>> Its not able to provide the proper selection element since there was a
>> bug in the code that I wrote..
>> I also gave a treeviwer.refresh() after setting the input ..
>> I have one quick question, how to make the Tree listen to the
>> ContentOutlineSelection by just navigating to the Selected Element in the
>> Outline view , I dont need it to go to its children , just stay at the
>> same element selected by the Outline.
>>
|
|
|
Re: Unable to View contents in EMF Editor [message #417335 is a reply to message #417333] |
Wed, 05 March 2008 11:13   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------070604040008000608000209
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Kamesh,
The generated editor's setCurrentView method handles updating the
selection and listening to the current view to forward its selection.
So I guess you need to hook up your MultipageSelectionProvider thing so
that it serves the same kind of purpose...
Kamesh Sampath wrote:
> Thanks Ed. I am able to rectify it .. Also i do have a one more question on
> the Selection ,
>
> I am using the MultipageSelectionProvider for the Editor , in my tree when i
> click on the node and add a child or sibling my Selection still remains on
> the Node from which I initiated the Command , my question is how do I move
> the selection to the newly added element ???
>
> This works fine with the Generated editor , my doubt is that am making a
> mess with the Selection with my dissected EMF editor ???
>
> Thoughts please ...
>
>
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:fqmfqi$du0$2@build.eclipse.org...
>
>> Kamesh,
>>
>> The generated editor's handleContentOutlineSelection shows how to do that
>> doesn't it?
>>
>>
>> Kamesh Sampath wrote:
>>
>>> Hi Ed,
>>>
>>> I debugged the issue , the issue was with the ContentOutlineSelection.
>>> Its not able to provide the proper selection element since there was a
>>> bug in the code that I wrote..
>>> I also gave a treeviwer.refresh() after setting the input ..
>>> I have one quick question, how to make the Tree listen to the
>>> ContentOutlineSelection by just navigating to the Selected Element in the
>>> Outline view , I dont need it to go to its children , just stay at the
>>> same element selected by the Outline.
>>>
>>>
>
>
>
--------------070604040008000608000209
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">
Kamesh,<br>
<br>
The generated editor's setCurrentView method handles updating the
selection and listening to the current view to forward its selection.
So I guess you need to hook up your MultipageSelectionProvider thing so
that it serves the same kind of purpose...<br>
<br>
<br>
Kamesh Sampath wrote:
<blockquote cite="mid:fqmg51$hjj$1@build.eclipse.org" type="cite">
<pre wrap="">Thanks Ed. I am able to rectify it .. Also i do have a one more question on
the Selection ,
I am using the MultipageSelectionProvider for the Editor , in my tree when i
click on the node and add a child or sibling my Selection still remains on
the Node from which I initiated the Command , my question is how do I move
the selection to the newly added element ???
This works fine with the Generated editor , my doubt is that am making a
mess with the Selection with my dissected EMF editor ???
Thoughts please ...
"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com"><merks@ca.ibm.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:fqmfqi$du0$2@build.eclipse.org">news:fqmfqi$du0$2@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Kamesh,
The generated editor's handleContentOutlineSelection shows how to do that
doesn't it?
Kamesh Sampath wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi Ed,
I debugged the issue , the issue was with the ContentOutlineSelection.
Its not able to provide the proper selection element since there was a
bug in the code that I wrote..
I also gave a treeviwer.refresh() after setting the input ..
I have one quick question, how to make the Tree listen to the
ContentOutlineSelection by just navigating to the Selected Element in the
Outline view , I dont need it to go to its children , just stay at the
same element selected by the Outline.
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------070604040008000608000209--
|
|
|
Re: Unable to View contents in EMF Editor [message #417337 is a reply to message #417335] |
Wed, 05 March 2008 12:25  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_000B_01C87F14.09C1FA00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Ed,
Thanks for your toughts ! The reason it was not working is that 1. As =
you said the currentViewer was not set and there by when the commands =
are fired the setSelectionToViewer method was not able to perform its =
task of setting the selection to recentlyAffectedObjects .
So I tried to set the CurrentViewer on pageChange where each page of my =
multipage editor part is associated with an StructuredViewer.
~Kamesh
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:fqmgs9$o5b$1@build.eclipse.org...
Kamesh,
The generated editor's setCurrentView method handles updating the =
selection and listening to the current view to forward its selection. =
So I guess you need to hook up your MultipageSelectionProvider thing so =
that it serves the same kind of purpose...
Kamesh Sampath wrote:=20
Thanks Ed. I am able to rectify it .. Also i do have a one more question =
on=20
the Selection ,
I am using the MultipageSelectionProvider for the Editor , in my tree =
when i=20
click on the node and add a child or sibling my Selection still remains =
on=20
the Node from which I initiated the Command , my question is how do I =
move=20
the selection to the newly added element ???
This works fine with the Generated editor , my doubt is that am making =
a=20
mess with the Selection with my dissected EMF editor ???
Thoughts please ...
"Ed Merks" <merks@ca.ibm.com> wrote in message=20
news:fqmfqi$du0$2@build.eclipse.org...
Kamesh,
The generated editor's handleContentOutlineSelection shows how to do =
that=20
doesn't it?
Kamesh Sampath wrote:
Hi Ed,
I debugged the issue , the issue was with the ContentOutlineSelection.=20
Its not able to provide the proper selection element since there was a=20
bug in the code that I wrote..
I also gave a treeviwer.refresh() after setting the input ..
I have one quick question, how to make the Tree listen to the=20
ContentOutlineSelection by just navigating to the Selected Element in =
the=20
Outline view , I dont need it to go to its children , just stay at the=20
same element selected by the Outline.
=20
=20
------=_NextPart_000_000B_01C87F14.09C1FA00
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>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16608" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DVerdana size=3D2>Ed,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>Thanks for your toughts ! The reason =
it was not=20
working is that 1. As you said the currentViewer was not set and =
there by=20
when the commands are fired the setSelectionToViewer method was not able =
to=20
perform its task of setting the selection to recentlyAffectedObjects=20
..</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>So I tried to set the CurrentViewer =
on pageChange=20
where each page of my multipage editor part is associated with an=20
StructuredViewer.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>~Kamesh</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" <<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>>=20
wrote in message <A=20
=
href=3D"news:fqmgs9$o5b$1@build.eclipse.org">news:fqmgs9$o5b$1@build.ecli=
pse.org</A>...</DIV>Kamesh,<BR><BR>The=20
generated editor's setCurrentView method handles updating the =
selection and=20
listening to the current view to forward its selection. So I =
guess you=20
need to hook up your MultipageSelectionProvider thing so that it =
serves the=20
same kind of purpose...<BR><BR><BR>Kamesh Sampath wrote:=20
<BLOCKQUOTE cite=3Dmid:fqmg51$hjj$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Thanks Ed. I am able to rectify it .. Also =
i do have a one more question on=20
the Selection ,
I am using the MultipageSelectionProvider for the Editor , in my tree =
when i=20
click on the node and add a child or sibling my Selection still remains =
on=20
the Node from which I initiated the Command , my question is how do I =
move=20
the selection to the newly added element ???
This works fine with the Generated editor , my doubt is that am making =
a=20
mess with the Selection with my dissected EMF editor ???
Thoughts please ...
"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:merks@ca.ibm.com"><merks@ca.ibm.com></A> wrote in =
message=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:fqmfqi$du0$2@build.eclipse.org">news:fqmfqi$du0$2@build.ecli=
pse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Kamesh,
The generated editor's handleContentOutlineSelection shows how to do =
that=20
doesn't it?
Kamesh Sampath wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Hi Ed,
I debugged the issue , the issue was with the ContentOutlineSelection.=20
Its not able to provide the proper selection element since there was a=20
bug in the code that I wrote..
I also gave a treeviwer.refresh() after setting the input ..
I have one quick question, how to make the Tree listen to the=20
ContentOutlineSelection by just navigating to the Selected Element in =
the=20
Outline view , I dont need it to go to its children , just stay at the=20
same element selected by the Outline.
</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->
</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_000B_01C87F14.09C1FA00--
|
|
|
Goto Forum:
Current Time: Tue Jul 08 05:35:08 EDT 2025
Powered by FUDForum. Page generated in 0.05544 seconds
|