[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: Any way to "go back" after "Open Declaration"?

Yes, and I got it to work by following the example.  That doesn't make me
particularily comfortable. A caveman might be able to learn to drive a car
by watching someone else drive it. That doesn't mean he'd have a clue what
to do when the car ran out of gas. :)

Also, you presume that the developer who wrote AbstractTextEditor
understands  INavigationLocationProvider. Perhaps.  Or perhaps he just
fiddled with it till he got something that worked for him. I don't know.

That said, I will file a bug report, as you suggest.

Mike


"Bob Foster" <bob@xxxxxxxxxx> wrote in message
news:b7kuvn$7t0$1@xxxxxxxxxxxxxxxx
> I agree the docs could be better and I hope you do file that bug, but you
> can see an example in selectAndReveal() that was written by someone who
did
> know how it works.
>
> Bob
>
> "Michael Conner" <michael.conner@xxxxxxxxx> wrote in message
> news:b7kc7a$rbd$1@xxxxxxxxxxxxxxxx
> > As I've indicated, I've already started to dig.  The problem is
separating
> > the kernel from the chaff, so to speak.  To my mind, there's some things
> > going on there that just happen to work out because of the way the
> mergeInto
> > method works.  At least, I think so.  Or perhaps that's the only way it
> can
> > work.  Without a couple of lines of documentation for a method, its hard
> to
> > know what you are supposed to do.
> >
> > The javadoc for INavigationLocation reads:
> >
> > public void restoreLocation()
> >     Restore the context saved by this location.
> >
> > public void update()
> >     The message update is sent to the active location before another
> > location becomes active.
> >
> > OK, but in the first, are there any other responsibilities (i.e.: mark
the
> > current location, as is done in the AbstractTextEditor implementation)
for
> > it to work correctly?
> >  If there was any supplemental documentation, I could live with this
> rather
> > terse description, but I haven't found any other documentation.  (Is it
> too
> > much to ask to put 3 lines of description in java docs which are being
> > released to the public?)  I guess I could duplicate what
> AbstractTextEditor
> > does, and worry about understanding it later.
> >
> > -Mike
> >
> >
> >
> > "John Arthorne" <John_Arthorne@xxxxxxxx> wrote in message
> > news:3E9DAF32.3050901@xxxxxxxxxxx
> > > I'm actually not intimately familiar with how it works.  I was just
> > > pointing you to the basic API in case you hadn't found it yourself.
> > > I'll have to defer to someone on the platform UI team for more
detailed
> > > help. My best suggestion is to dig into how the AbstractTextEditor
makes
> > > use of it.
> > > --
> > >
> > >
> > > Michael Conner wrote:
> > > > John,
> > > >
> > > > I found the INavigationLocationProvider docs (actually, before you
> > posted
> > > > the reply).  The documentation is sparse, and I'm not sure that I
> > understand
> > > > the sequence of events.  I tried to get it working, but it seems to
be
> > > > acting erratic, so I assume I'm doing something wrong.  What is the
> > typical
> > > > sequence for this?
> > > >
> > > > That is, should I call markInNavigationHistory() when the editor is
> > first
> > > > created?
> > > >
> > > > Do I need to call markInNavigationHistory() for both the starting
> point
> > and
> > > > the endpoint when I make a jump?
> > > >
> > > > Do I always need to implement mergeTo() intelligently, or can I
simply
> > > > return false?
> > > >
> > > > Do I have to mark the current location when restoring another? (That
> > appears
> > > > to be the way
> > > > TextSelectionNavigationLocation works.)
> > > >
> > > > Also, what is the purpose of update().  Why would I update a
location
> of
> > > > where I once was, or is it used solely to update the current
location
> > (i.e.
> > > > just before jumping to a previous one)?
> > > >
> > > > -Mike
> > > >
> > > >
> > > >
> > > > "John Arthorne" <John_Arthorne@xxxxxxxx> wrote in message
> > > > news:3E9D63ED.7050805@xxxxxxxxxxx
> > > >
> > > >>Your editor should implement
> org.eclipse.ui.INavigationLocationProvider.
> > > >>  Look at the related interfaces INavigationLocation and
> > > >>INavigationHistory for more details.  For an example, you can look
at
> > > >>how it's implemented in AbstractTextEditor (all in
> > > >>org.eclipse.ui.workbench plug-in).
> > > >>--
> > > >>
> > > >>eclipse wrote:
> > > >>
> > > >>>How do you hook into this programatically?  I'm looking to extend
an
> > > >>
> > > > editor
> > > >
> > > >>>generated by EMF, and the default functionality simply goes to the
> > > >>
> > > > previous
> > > >
> > > >>>resource, not to a particular model element.
> > > >>>
> > > >>>Mike Conner
> > > >>>
> > > >>>
> > > >>>"Jared Burns" <jared-eclipse@xxxxxxxxx> wrote in message
> > > >>>news:asjnut$ibr$1@xxxxxxxxxxxxxxxx
> > > >>>
> > > >>>
> > > >>>>In current 2.1 builds there are back and forward buttons in the
> > toolbar.
> > > >>>>Alt+left/right works as well.
> > > >>>>
> > > >>>>- Jared
> > > >>>>
> > > >>>>Mark Streich wrote:
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>>When using the Java editor, and I use the "Open Declaration" [F3]
> > > >>>>>command, and it takes me to the declaration elsewhere in the
> current
> > > >>>>>file, is there also a command to take me back to where I was
> > > >>>>>previously?
> > > >>>>>
> > > >>>>>Thanks,
> > > >>>>>
> > > >>>>>Mark
> > > >>>>
> > > >>>
> > > >
> > > >
> > >
> >
> >
>
>