Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Commands in the GEF text editing sample are not redoable
Commands in the GEF text editing sample are not redoable [message #189859] Fri, 29 July 2005 23:44 Go to next message
Josh Knauer is currently offline Josh KnauerFriend
Messages: 12
Registered: July 2009
Junior Member
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
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #190445 is a reply to message #190421] Wed, 03 August 2005 19:56 Go to previous messageGo to next message
Josh Knauer is currently offline Josh KnauerFriend
Messages: 12
Registered: July 2009
Junior Member
"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 #190715 is a reply to message #190445] Fri, 05 August 2005 16:28 Go to previous messageGo to next message
Eclipse UserFriend
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 #190802 is a reply to message #190715] Fri, 05 August 2005 21:00 Go to previous messageGo to next message
Josh Knauer is currently offline Josh KnauerFriend
Messages: 12
Registered: July 2009
Junior Member
Sorry, I'm not being very clear in these posts :)

What I was wondering was if such a method existed already (and I just
couldn't find it), or whether I would need to write my own ... I'll write my
own.

"Pratik Shah" <none@unknown.com> wrote in message
news:dd043g$k1o$1@news.eclipse.org...
> 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 Go to previous message
Eclipse UserFriend
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
>
>
Previous Topic:rotating a text label
Next Topic:Auto-positioning EditParts
Goto Forum:
  


Current Time: Thu Apr 25 06:21:27 GMT 2024

Powered by FUDForum. Page generated in 0.03104 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top