Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Question about removing selected job from job view

Why don't you send the patch and I'll take a look? Anybody who would like to volunteer to re-write the ParallelJobView, please let me know!

Greg

On Aug 30, 2007, at 1:20 PM, Dave Wootton wrote:

Greg
My action does extend ParallelAction. I tried your suggestion using the jobTableViewer and it works. In order to get access to the jobTableViewer object, I found that I needed to pass it as a parameter on the constructor
for my action in addition to the ParallelJobsView object.
Dave



Greg Watson <g.watson@xxxxxxxxxxxx>
Sent by: ptp-dev-bounces@xxxxxxxxxxx
08/30/2007 11:03 AM
Please respond to
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>


To
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
cc

Subject
Re: [ptp-dev] Question about removing selected job from job view






Dave,

Usually the way to do this is as follows:

ISelection selection = viewer.getSelection();
if (!selection.isEmpty()) {
                 IPJob job = (IPJob) ((IStructuredSelection)
selection).getFirstElement();
                 doWhatever(job);
}

I'm not sure why you're getting an empty IElements array. Is your
action extending ParallelAction? In any case you might want to try
the above, but use
jobTableViewer for the viewer.

Greg

On Aug 30, 2007, at 9:59 AM, Dave Wootton wrote:

Greg
That seems to work.
One thing that bothers me a bit is that in order for me to remove
the job,
I need to pass the IPJob object for the job I want to remove as a
parameter in the constructor for my action (or implement a method
in my
action which I then call to set the job object immediately after I
create
it). I may not be understanding how things are supposed to work,
but I am
required to implement 'run(IElementt[] elements)' in my action,
where I
would have expected the IElements array to have the set of objects
selected at the time I right clicked in the jobs view, so in this
case I
would expect an object representing the job, where I could get the
IPJob
object from that object and use that. However, stepping thru this
code in
debug, I see that I am getting a zero-element IElements array, and
so have
to get the IPJob object by passing it in in the constructor.

If this is all working the way it is supposed to, then I have a
patch I
can submit for this.
Dave



Greg Watson <g.watson@xxxxxxxxxxxx>
Sent by: ptp-dev-bounces@xxxxxxxxxxx
08/29/2007 04:00 PM
Please respond to
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>


To
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
cc

Subject
Re: [ptp-dev] Question about removing selected job from job view






Try calling changeJobRefresh(null) and see what happens.

Greg

On Aug 29, 2007, at 3:45 PM, Dave Wootton wrote:

I'm making an attempt to fix the job view so a selected terminated
job can
be removed from the job view (todo list #44). I have this mostly
working,
but have run into a quirk. In the ParallelJobsView, I added code to
the
jobTableViewer mouse listener to save the job state and IPJob
object for
the job that the mouse was over when it was right-clicked. If the
job is
in terminated state, then I add an additional action to the popup
menu in
fillJobContextMenu, passing the saved IPJob object to the
constructor for
my new action. In the run method in that action, I call the removeJob
method in the JobManager class.

This sort of works, in that the job gets deleted from the view, but
the
job only disappears after I perform another action that updates the
job
view, such as submit another job. In looking at the JobManager
class, I
see that the removeAllStoppedJobs method finds the correct IPQueue
object
and calls getResourceManager().removeTerminatedJobs in that IPQueue
object. Do I need to do something similar to the logic flow in the
removeTerminatedJobs method and what it calls, but only removing the
matching IPJob object?

Have I gone way off track in trying to fix this?

Dave
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev


_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev


_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev


_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev


_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev




Back to the top