Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Refreshing Console View
Refreshing Console View [message #177622] Thu, 14 April 2005 17:47 Go to next message
Eclipse UserFriend
Originally posted by: gunjan_sir.yahoo.com

Hi! All,
I've created a view(named it as Console View)by extending ViewPart.I'm
displaying on the Console View,some strings which are specific to the my
model objects.These strings are displayed when the user clicks on the
model objects on the editor.
So every time the user click on the different objects on the editor, the
Console View is refreshed with new strings,corrosponding to the object.

I've used ListViewer to display the strings in the console.
My contentprovider implements IStructuredContentProvider for which I need
to implement three API's in it:
1)public void inputChanged(Viewer v, Object oldInput, Object newInput) {}
2)public Object[] getElements(Object parent) {
return new String[] { "Error String1","Error String2","Error String3" };}
3)public void dispose() {}

Plus i will need to call viewer.refresh to refresh the Console View.
Below is the code for content provider:
public class ViewContentProvider implements IStructuredContentProvider{

ListViewer viewer;

public void inputChanged(Viewer v, Object oldInput, Object newInput) {
}

public void dispose() {
}
public Object[] getElements(Object parent) {
return new String[] { "String1","String2","String3" };
}
}
These methods are called by the framework,as per my understanding....
Here i've passed static strings to getElements()
Now my question is:
Ques 1)How do i give a call to getElements(Object parent) to pass the
dynamic strings in it.
Ques 2)What do i need to do/implement in the inputChanged(Viewer v,Object
oldInput,Object newInput) method.
Ques 3)How and where will i give call to viewer.refresh() to actually
refresh the view part.

Thanking in advance for any suggestion.

Many Regards
Ved Gunjan
Re: Refreshing Console View [message #177941 is a reply to message #177622] Fri, 15 April 2005 19:26 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
org.eclipse.jface.viewer.ListViewer.
You're on the wrong newsgroup.

"ved gunjan" <gunjan_sir@yahoo.com> wrote in message
news:af4e4a313eee631f24c38954487d2727$1@www.eclipse.org...
>
> Hi! All,
> I've created a view(named it as Console View)by extending ViewPart.I'm
> displaying on the Console View,some strings which are specific to the my
> model objects.These strings are displayed when the user clicks on the
> model objects on the editor.
> So every time the user click on the different objects on the editor, the
> Console View is refreshed with new strings,corrosponding to the object.
>
> I've used ListViewer to display the strings in the console.
> My contentprovider implements IStructuredContentProvider for which I need
> to implement three API's in it:
> 1)public void inputChanged(Viewer v, Object oldInput, Object newInput) {}
> 2)public Object[] getElements(Object parent) {
> return new String[] { "Error String1","Error String2","Error
String3" };}
> 3)public void dispose() {}
>
> Plus i will need to call viewer.refresh to refresh the Console View.
> Below is the code for content provider:
> public class ViewContentProvider implements IStructuredContentProvider{
>
> ListViewer viewer;
>
> public void inputChanged(Viewer v, Object oldInput, Object newInput) {
> }
>
> public void dispose() {
> }
> public Object[] getElements(Object parent) {
> return new String[] { "String1","String2","String3" };
> }
> }
> These methods are called by the framework,as per my understanding....
> Here i've passed static strings to getElements()
> Now my question is:
> Ques 1)How do i give a call to getElements(Object parent) to pass the
> dynamic strings in it.
> Ques 2)What do i need to do/implement in the inputChanged(Viewer v,Object
> oldInput,Object newInput) method.
> Ques 3)How and where will i give call to viewer.refresh() to actually
> refresh the view part.
>
> Thanking in advance for any suggestion.
>
> Many Regards
> Ved Gunjan
>
>
>
Previous Topic:Reveal does not show selection handles
Next Topic:double click event on GraphicalViewer?
Goto Forum:
  


Current Time: Mon Jan 30 12:36:25 GMT 2023

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

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

Back to the top