Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Setting The Input Data Of IViewPart Subclass
Setting The Input Data Of IViewPart Subclass [message #14194] Thu, 11 June 2009 12:28
Kap Pak is currently offline Kap PakFriend
Messages: 52
Registered: July 2009
Member
Hello Everybody,
I am sorry if here is not the right place to post this question. If
there is a different place then point me there. I have posted this
question aleady in the swt newsgroup but later i found that here may be
the right place to post it. Sorry for any inconveniences

Thanks.

This is my challenge:

1)
I have a user interface class with form(Text area and a button). The
purpose of the form is for the user to type in a query and after clicking
on the button, the query will be sent to the server.

eg:

public class QueryDialog{
//.... code here

ProcessQuery p = new ProcessQuery();
p.processResults(argument);

//... code here
}

2)
I have a class which processes the results from the server and store the
results in an a certain class.

public class ProcessQuery{
//.... additional code here

private static ProcessQuery content;
cPackage pack = new cPackage();

public void processResults(String str){

//...code here

variable "pack" is given the results from the server in this method

//...code here


}

public cPackage getInputs(){
return pack;
}

// A singleton
public static synchronized ProcessQuery getInstance() {
if (content != null) {
return content;
}
content = new ProcessQuery ();
return content;
}

//...additional code here
}


3)
I also have the view class which extends the IViewPart class. It is in
this class that the TreeViewer class is declared and all the content
providers are set.

4)
The whole procedure is this:
After running the plugin, the user open the dialog form and type in the
query in the text area and click on the button, the query is sent to the
server for processing. Afterwards, the results is sent back from the
server.

*****************QUESTIONS**************
A)
At first i called the "getInput()" of the "ProcessQuery" class in the
"setInput()" method [setInput(ProcessQuery.getInstance().getInputs())]of
the IViewPart subclass but i get NullPointerExcepton becos the "pack"
variable gets the results in the "processResults()" method. I read a forum
that i must add singleton that is why the "ProcessQuery" class is
singleton.
How can i send the results from the server which is stored in the "pack"
variable to the "setInput()" method of the IViewPart subclass. I can't
figure out what to do. I was thinking of calling the IViewPart subclass
inside the
"QueryDialog" class but i think the view classes are not called in this
way.

I think this is the procedure : It must be like first the query must be
executed and results returned from the server and the results populated in
the "ProcessQuery" class and then the populated class must be given to the
IViewPart subclass. I really have know idea now. Need Help

I appreciate all suggestions and recommendations.

I would like someone to help me because i have spent several days but it
is not working for me. I don't know how to pass the data from the server
to the view class(IViewPart subclass).


Thank you all.


Regards,
Eddy.
Previous Topic:Issue with EditingSupport#canEdit
Next Topic:Databinding with Button
Goto Forum:
  


Current Time: Thu Apr 25 22:17:22 GMT 2024

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

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

Back to the top