Sharing new technologies and best practices

 
alt

Chris Connor

 
Follow ChrisJConnor on Twitter
Chat with me

getCurrentElement() null issue in Java UI Classes for Eclipse

Chris Connor  May 21 2012 11:38:50 AM
Seems to be this behaviour is a "feature" of the product which may be fixed over time.

A similar threads on DeveloperWorks forum (or Notes.net as I still like to call it..)

Kevin Duan  http://www-10.lotus.com/ldd/nd8forum.nsf/5f27803bba85d8e285256bf10054620d/e0da559819b54d0b852579a20034ce5c?OpenDocument

Also being hinted at in some other places that the view behaviour is unreliable at best.

 At the moment (until I can come up with a better idea) I am running some code as follows for this condition in the job thread

        if(elem==null){
                return Status.CANCEL_STATUS;
        }
....
....
....
return Status.OK_STATUS;


I then check in my calling code to see what the jobs status was returning as follows

if(job.getResult().equals(Status.CANCEL_STATUS)){
                MessageDialog.openInformation(composite.getShell(),"Document Not Uploaded","Document NOT Uploaded. Instead of running this process from a view please retry again from an open document.");
}

This is far from ideal. However, it is at least catching the null situation and informing the user. It is also allowing the user to attempt to perform the action from the view screen.

Anyone know of a better approach?


About Me

Java / Web Development consultant with 17 years experience. Focus on XPages, Java / JSF / J2EE, Websphere Portal, Spring / Hibernate, RCP, jQuery, Dojo, RCP, Eclipse, RAD, Phonegap and general Mobile development. Experienced public speaker at several global events.

My day job is building Web applications for my customers using the best technologies for the job. This blog discusses the issues in delivering these modern collaborative solutions.

I am available for hire through my business BSS IT Solutions. We are an IBM Business Partner based in Scotland serving the UK and beyond!