Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » UIJob Problem
UIJob Problem [message #663495] Tue, 05 April 2011 11:45 Go to next message
Hussein Kobeisi is currently offline Hussein Kobeisi
Messages: 49
Registered: December 2010
Member

hey ppl,

I have a TreeUpdateJob Class which updates the Tree when a new element is created, but it doesnt work, because in the UIJob class the RWTLifeCycle.getSessionDisplay() gives back a null, and this comment was inserted // RAP [fappel]: discovering the display at runtime of a job is not is there another way to update the tree?

thanks,
Hussein
Re: UIJob Problem [message #663511 is a reply to message #663495] Tue, 05 April 2011 12:25 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1839
Registered: July 2009
Senior Member
Hi Hussein,
could you provide a little snippet of UIJob usage?
Best,
Ivan

On 4/5/2011 2:45 PM, Hussein Kobeisi wrote:
>
> hey ppl,
> I have a TreeUpdateJob Class which updates the Tree when a new element
> is created, but it doesnt work, because in the UIJob class the
> RWTLifeCycle.getSessionDisplay() gives back a null, and this comment
> was inserted // RAP [fappel]: discovering the display at runtime of a
> job is not is there another way to update the tree?
> thanks, Hussein
>
Re: UIJob Problem [message #663513 is a reply to message #663511] Tue, 05 April 2011 13:11 Go to previous messageGo to next message
Hussein Kobeisi is currently offline Hussein Kobeisi
Messages: 49
Registered: December 2010
Member
Hi Ivan,

public class TreeUpdateJob extends UIJob {

private final UniqueMultiValueMap _addSet;

private final Set<Object> _removeSet;

private final Set<Object> _refreshSet;

private final UniqueMultiValueMap _updateSet;

private final TreeViewer _treeViewer;

private final TreeArtefactRepository _treeArtefactRepository;


/**
* @param addSet
* @param removeSet
* @param refreshSet
* @param updateSet
*/
public TreeUpdateJob(
DefaultContentProvider contentProvider,
TreeViewer treeViewer,
TreeArtefactRepository treeArtefactRepository,
UniqueMultiValueMap addSet,
Set<Object> removeSet,
Set<Object> refreshSet,
UniqueMultiValueMap updateSet) {
super(Messages.getString("DefaultContentProvider.updateJob.label ")); //$NON-NLS-1$
hier it give back a null
_treeViewer = treeViewer;
_treeArtefactRepository = treeArtefactRepository;
_addSet = addSet;
_removeSet = removeSet;
_refreshSet = refreshSet;
_updateSet = updateSet;
}


thx for your help,
Hussein
Re: UIJob Problem [message #663522 is a reply to message #663513] Tue, 05 April 2011 13:44 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1839
Registered: July 2009
Senior Member
Hi Hussein,
try to provide the display from the outside by using the other UIJob
ctor - UIJob(Display jobDisplay, String name).
HTH,
Ivan

On 4/5/2011 4:11 PM, Hussein Kobeisi wrote:
> Hi Ivan,
>
> public class TreeUpdateJob extends UIJob {
>
> private final UniqueMultiValueMap _addSet;
>
> private final Set<Object> _removeSet;
>
> private final Set<Object> _refreshSet;
>
> private final UniqueMultiValueMap _updateSet;
>
> private final TreeViewer _treeViewer;
>
> private final TreeArtefactRepository _treeArtefactRepository;
>
>
> /**
> * @param addSet
> * @param removeSet
> * @param refreshSet
> * @param updateSet
> */
> public TreeUpdateJob(
> DefaultContentProvider contentProvider,
> TreeViewer treeViewer,
> TreeArtefactRepository treeArtefactRepository,
> UniqueMultiValueMap addSet,
> Set<Object> removeSet,
> Set<Object> refreshSet,
> UniqueMultiValueMap updateSet) {
> super(Messages.getString("DefaultContentProvider.updateJob.label
> ")); //$NON-NLS-1$
> hier it give back a null _treeViewer = treeViewer;
> _treeArtefactRepository = treeArtefactRepository;
> _addSet = addSet;
> _removeSet = removeSet;
> _refreshSet = refreshSet;
> _updateSet = updateSet;
> }
>
>
> thx for your help,
> Hussein
Re: UIJob Problem [message #663530 is a reply to message #663522] Tue, 05 April 2011 14:08 Go to previous messageGo to next message
Hussein Kobeisi is currently offline Hussein Kobeisi
Messages: 49
Registered: December 2010
Member
hi ivan

i tried what you said but it gives me this Exception
Exception in thread "Tree Update Thread" java.lang.IllegalStateException: No context available outside of the request service lifecycle.
at org.eclipse.rwt.internal.service.ContextProvider.getContext( ContextProvider.java:107)
at org.eclipse.rwt.internal.service.ContextProvider.getStateInf o(ContextProvider.java:160)
at org.eclipse.rwt.SessionSingletonBase.getInstance(SessionSing letonBase.java:84)
at org.eclipse.ui.internal.Workbench.getInstance(Workbench.java :378)
at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:94)
at aquintos.vpr.provider.TreeUpdateJob.<init>(TreeUpdateJob.java:75)
at aquintos.vpr.provider.TreeUpdatesConsumerRunnable.run(TreeUp datesConsumerRunnable.java:72)
at java.lang.Thread.run(Unknown Source)


maybe iam giving the Display wrong :i used PlatformUI.getWorkbench().egtDisplay()


regards,
Hussein
Re: UIJob Problem [message #663537 is a reply to message #663530] Tue, 05 April 2011 14:26 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1839
Registered: July 2009
Senior Member
Hi Hussein,
get it from treeViewer.getTree().getDisplay()
HTH,
Ivan

On 4/5/2011 5:08 PM, Hussein Kobeisi wrote:
> hi ivan
> i tried what you said but it gives me this Exception
> Exception in thread "Tree Update Thread"
> java.lang.IllegalStateException: No context available outside of the
> request service lifecycle.
> at org.eclipse.rwt.internal.service.ContextProvider.getContext(
> ContextProvider.java:107)
> at org.eclipse.rwt.internal.service.ContextProvider.getStateInf
> o(ContextProvider.java:160)
> at org.eclipse.rwt.SessionSingletonBase.getInstance(SessionSing
> letonBase.java:84)
> at org.eclipse.ui.internal.Workbench.getInstance(Workbench.java
> :378)
> at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:94)
> at aquintos.vpr.provider.TreeUpdateJob.<init>(TreeUpdateJob.java:75)
> at aquintos.vpr.provider.TreeUpdatesConsumerRunnable.run(TreeUp
> datesConsumerRunnable.java:72)
> at java.lang.Thread.run(Unknown Source)
>
> maybe iam giving the Display wrong :i used
> PlatformUI.getWorkbench().egtDisplay()
>
>
> regards,
> Hussein
Re: UIJob Problem [message #663542 is a reply to message #663537] Tue, 05 April 2011 14:52 Go to previous message
Hussein Kobeisi is currently offline Hussein Kobeisi
Messages: 49
Registered: December 2010
Member
Hi Ivan,


thank you very much for your help,
now it works.

Regards,
Hussein
Previous Topic:Theme is not applied in deployable war
Next Topic:Missing Constraint: Import-Package: org.apache.jasper.servlet
Goto Forum:
  


Current Time: Thu Oct 23 08:47:56 GMT 2014

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

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