|
Re: Commands in the GEF text editing sample are not redoable [message #190421 is a reply to message #189859] |
Wed, 03 August 2005 18:24 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
"Joshua Knauer" <joshua.knauer@businessobjects.com> wrote in message
news:dcef0i$4cr$1@news.eclipse.org...
> Hi,
>
> Commands in the GEF text editing sample are not redoable. This is because
> the MiniEdit derived classes that they are based on use object references
> that may be stale when the command is re-executed. It seems that the way
to
> fix this is change them to use an absolute character position in the model
> text to determine where to do their thing. Has anyone else tried this?
On
Open a bug report.
> a related note, it doesn't look like the text object model in example code
> has a method for determining the absolute character position of a TextRun,
> is that correct or am I missing something?
Do you mean the absolute location of the text run (or a character in that
run) on the screen? That's possible via the methods on TextFlow.
>
> Thanks,
>
> Josh
>
>
|
|
|
|
Re: Commands in the GEF text editing sample are not redoable [message #190715 is a reply to message #190445] |
Fri, 05 August 2005 16:28 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Sure you can. Why not? It might not be very easy, but you could write a
utility method that walks through the hierarchy and finds the character.
"Joshua Knauer" <joshua.knauer@businessobjects.com> wrote in message
news:dcr7hj$efj$1@news.eclipse.org...
>
> "Pratik Shah" <none@unknown.com> wrote in message
> news:dcr24s$876$1@news.eclipse.org...
> >
> > "Joshua Knauer" <joshua.knauer@businessobjects.com> wrote in message
> > news:dcef0i$4cr$1@news.eclipse.org...
> > > Hi,
> > >
> > > Commands in the GEF text editing sample are not redoable. This is
> because
> > > the MiniEdit derived classes that they are based on use object
> references
> > > that may be stale when the command is re-executed. It seems that the
> way
> > to
> > > fix this is change them to use an absolute character position in the
> model
> > > text to determine where to do their thing. Has anyone else tried
this?
> > On
> >
> > Open a bug report.
> Will do.
>
> >
> > > a related note, it doesn't look like the text object model in example
> code
> > > has a method for determining the absolute character position of a
> TextRun,
> > > is that correct or am I missing something?
> >
> > Do you mean the absolute location of the text run (or a character in
that
> > run) on the screen? That's possible via the methods on TextFlow.
> >
> What I mean is: I've got a text string that I've encoded in the GEF text
> editor object model (Containers and TextRuns). I want to figure out which
> TextRun a given character in that string falls in.
>
> > >
> > > Thanks,
> > >
> > > Josh
> > >
> > >
> >
> >
>
>
|
|
|
|
Re: Commands in the GEF text editing sample are not redoable [message #191620 is a reply to message #189859] |
Wed, 10 August 2005 17:28 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
They should be redoable. I know that many of them are. Perhaps one of the
miniedit is executing on redo, and therefore creating a new model object
instead of reusing the one it created earlier during the first execute (and
therefore other edits/commands are referencing).
The key to redoability is to reuse all instances, as you've probably
realized.
"Joshua Knauer" <joshua.knauer@businessobjects.com> wrote in message
news:dcef0i$4cr$1@news.eclipse.org...
> Hi,
>
> Commands in the GEF text editing sample are not redoable. This is because
> the MiniEdit derived classes that they are based on use object references
> that may be stale when the command is re-executed. It seems that the way
> to
> fix this is change them to use an absolute character position in the model
> text to determine where to do their thing. Has anyone else tried this?
> On
> a related note, it doesn't look like the text object model in example code
> has a method for determining the absolute character position of a TextRun,
> is that correct or am I missing something?
>
> Thanks,
>
> Josh
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03956 seconds