Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mylyn-integrators] Adding content to a new task before it opens

You could check out:

 org.eclipse.mylyn.internal.bugzilla.ide.actions.NewTaskFromErrorAction

Maybe this is more what you want since it is more generic and works
with repository tasks.  You will need a separate action to run this
type of code though since the generic one will only (maybe) take into
account your current selection in the tasklist.  I have never tried
doing what you want to do, but it might be possible using some tricks
when listening for part opened events, etc.

Shawn

On 10/25/07, John Anvik <janvik@xxxxxxxxxx> wrote:
> Thanks Shawn.
>
> That will work for my current need, however I was aiming for something
> that made better reuse of the existing Mylyn code.
>
> My thought was to extend the NewTaskAction and use it's run method since
> it looks to handle the cases of new local task vs. new repository task
> so nicely (admittedly I haven't explored new repository tasks yet, so
> maybe this won't really work in the end).
>
> This is what motivated my question about being able to catch an "a new
> task editor is about to open" event so that I could squeeze in there and
> add some content. Is this possible?
>
> If not, I can use the existing the code from NewTaskAction as a model
> and create separate actions for the two cases or mimic what is done there.
>
> John Anvik
>
> Shawn Minto wrote:
> > Hey John,
> >
> > With my testing, this works to set the notes:
> >
> > AbstractTask task =
> > TasksUiPlugin.getTaskListManager().createNewLocalTask(title);
> > if (task != null){
> >       task.setNotes("this is a test");
> >       TasksUiUtil.openEditor(task, true);
> > }
> >
> >
> > Hope this helps
> > Shawn
> >
> > On 10/25/07, John Anvik <janvik@xxxxxxxxxx> wrote:
> >> I would like to add some information to a new task before it opens.
> >> I tried catching the open event using a PartListener, but of course that
> >> didn't work (at least the text that I inserted using
> >> AbstractTask.setNotes() didn't work).
> >>
> >> How do I catch the creation of a task editor event so that I can
> >> add some information to a new task before the editor opens?
> >>
> >> Pointers to code or tutorials also accepted. :)
> >>
> >> John Anvik
> >> _______________________________________________
> >> mylyn-integrators mailing list
> >> mylyn-integrators@xxxxxxxxxxx
> >> https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
> >>
> >
> >
> _______________________________________________
> mylyn-integrators mailing list
> mylyn-integrators@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>


-- 
Shawn Minto
sminto@xxxxxxxxx
----------------------------------------


Back to the top