Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » add a "console-like" view to the diagram
add a "console-like" view to the diagram [message #468194] Tue, 04 August 2009 13:29 Go to next message
daniele Mising name is currently offline daniele Mising nameFriend
Messages: 48
Registered: July 2009
Member
Hi! in my diagram, now I have an editor (where add nodes and links), an
overview and the property sheet. I would add another view where write the
log. Now I use the console and the System.out.print , but when I will
build my rcp, I would use a view for the log.

I saw that views are in DiagramEditorPerspective, but I think that the
standard views of IPageLayout can't meet my requirement. How can I create
my view?

Thanks,

Daniele.
Re: add a "console-like" view to the diagram [message #471904 is a reply to message #468194] Wed, 05 August 2009 19:06 Go to previous messageGo to next message
Seweryn Niemiec is currently offline Seweryn NiemiecFriend
Messages: 80
Registered: July 2009
Member
Daniele Fanì wrote:
> Hi! in my diagram, now I have an editor (where add nodes and links), an
> overview and the property sheet. I would add another view where write
> the log. Now I use the console and the System.out.print , but when I
> will build my rcp, I would use a view for the log.

You can create you own custom view (there are tens of tutorials about it
in the Internet) or use Eclipse's standard "Error Log".

--
Greetings,
Seweryn
Re: add a "console-like" view to the diagram [message #478882 is a reply to message #471904] Fri, 07 August 2009 10:56 Go to previous messageGo to next message
daniele Mising name is currently offline daniele Mising nameFriend
Messages: 48
Registered: July 2009
Member
I've tried to add a view adding an extension in the manifest. I used the
"sample view" of the GMF. Ok... it works. But I need to use this view to
print some events. How can I link the model with the view? I read that I
have to use the content provider.

This is the content-provider of the Sample View


=======================================================
class ViewContentProvider implements IStructuredContentProvider {
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
}
public void dispose() {
}
public Object[] getElements(Object parent) {
return new String[] { "One", "Two", "Three" };
}
=======================================================

but I don't understand what is oldinput and newinput... and how modify
the method.
Re: add a "console-like" view to the diagram [message #479218 is a reply to message #478882] Mon, 10 August 2009 10:07 Go to previous messageGo to next message
Seweryn Niemiec is currently offline Seweryn NiemiecFriend
Messages: 80
Registered: July 2009
Member
daniele wrote:
> I've tried to add a view adding an extension in the manifest. I used the

Try those:
http://www.eclipse.org/articles/viewArticle/ViewArticle2.htm l
http://www.vogella.de/articles/RichClientPlatform/article.ht ml#views_add

--
Greetings,
Seweryn
Re: add a "console-like" view to the diagram [message #484317 is a reply to message #479218] Sun, 06 September 2009 12:48 Go to previous messageGo to next message
daniele Mising name is currently offline daniele Mising nameFriend
Messages: 48
Registered: July 2009
Member
I've been away on August, I've just read your answer. Many thanks, I hope
this can help me.
Re: add a "console-like" view to the diagram [message #484496 is a reply to message #479218] Mon, 07 September 2009 18:38 Go to previous messageGo to next message
daniele Mising name is currently offline daniele Mising nameFriend
Messages: 48
Registered: July 2009
Member
mm... i read the article. yes, it was useful to understanding better the
way it works, but I can't yet do what i want to do.
In the example, views are linked among them. I need to link a view to a
Class that is not a view, but it's an external class. I want to use the
view like a console, to print the log.
Re: add a "console-like" view to the diagram [SOLVED] [message #484562 is a reply to message #479218] Tue, 08 September 2009 09:15 Go to previous message
daniele Mising name is currently offline daniele Mising nameFriend
Messages: 48
Registered: July 2009
Member
oook!! problem solved!! I just create a static method "refresh" in the
view.

refresh(String event) add the event to the view, and I use the method
"viewer.setInput("null"); " to refresh grafically the table. that's work
fine, and I can invoke the method wherever I want, simply by

SampleView.refresh(event);

bye
Previous Topic:how to set the value of a new element referencing a dragged element
Next Topic:Pop up menu does not work
Goto Forum:
  


Current Time: Fri Apr 19 08:36:52 GMT 2024

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

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

Back to the top