I’m fairly new to RCP development, and have been
working on a small standalone client application for use by our customers.
As this is a tool designed for ‘non-technical’
users, we’re trying to get away from the IDE feel of typical RCPs (we
ship a separate product for technical users on the eclipse platform) so I was
very excited to come across the Riena project, as it’s exactly what our
project management is looking for
(they’re going to be even happy with your plan to roll out detached views
J )
So as I work towards porting my existing RCP, I’ve run
into a snag. My contributed viewparts and commands seem to show up as expected
in the new navigation paradigm, but the handler (extends AbstractHandler,
implements IHandler) that I have contributed to handle a command isn’t
working. The command wraps a potentially long-running task (it updates the
model which serves as the input to the table view) in a workbench job with a
progress monitor as shown below:
<snip>
// get the
workbench view and window handles
final IWorkbenchPart
part = HandlerUtil.getActivePartChecked(event);
final
IWorkbenchWindow win = HandlerUtil
.getActiveWorkbenchWindowChecked(event);
// wrap the
workbench job in a try/catch block
try {
win.run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor)
throws
InvocationTargetException,
InterruptedException {
</snip>
Stepping through, it seems that creating the new
IRunnableWithProgress bails, because the call to ModalContext.run() encounters
an error with the progress monitor. The monitor used is a StatusLineManager,
and it seems that the underlying statusLine is null. Now in my RCP, I
initialized the status line in the ApplicationWorkbenchWindowAdvisor, do I have
to do something similar to get things working with Riena?
As an aside, I’m wondering if this is the best way to
handle long-running tasks that update UI components in Riena? Is there another
method that you’d recommend? I’ve read over the getting started
docs regarding injection of services etc… but I haven’t seen
anything specifically related to local task/job management for a simple client
app, so I’m defaulting to the ‘workbench way’. Alternate
suggestions are welcome.
Thanks,
Todd
Todd Lee
Member
of Technical Staff
Software
Tools Development
Medical
Division
ON
Semiconductor
todd.lee@xxxxxxxxxx
+1
519 884-9696 ext. 2242
http://onsemi.com