Logic Example and Undo/Redo support [message #213885] |
Tue, 11 April 2006 15:50 |
Eclipse User |
|
|
|
Originally posted by: markp.softlanding.com
This is GEF 3.0.
The LogicExample seems to have hooked into the global menu and toolbars
for Undo/Redo. Can you point me to the relevant areas of the code that
make this happen?
I have them on my right-click menu within the editor, but not on the
main menu and toolbar. Those are disabled.
Thanks
Mark
|
|
|
|
Re: Logic Example and Undo/Redo support [message #214129 is a reply to message #214066] |
Wed, 12 April 2006 19:15 |
Eclipse User |
|
|
|
Originally posted by: markp.softlanding.com
Steven Shaw wrote:
> Take a look at:
>
> org.eclipse.gef.examples.logicdesigner.actions.LogicActionBa rContribut
> or
Thanks. I took a look and copied the relevant bits. However, the
toolbar and menu options still do not enable after changes are made.
The right-click menu options still work fine. So it seems like there
must be other bits in the example that control this.
Any ideas?
Mark
|
|
|
Re: Logic Example and Undo/Redo support [message #214201 is a reply to message #214129] |
Thu, 13 April 2006 20:30 |
Eclipse User |
|
|
|
Originally posted by: tom.seidel.javawiki.org
Mark Phippard wrote:
> Steven Shaw wrote:
>
>> Take a look at:
>>
>> org.eclipse.gef.examples.logicdesigner.actions.LogicActionBa rContribut
>> or
>
> Thanks. I took a look and copied the relevant bits. However, the
> toolbar and menu options still do not enable after changes are made.
> The right-click menu options still work fine. So it seems like there
> must be other bits in the example that control this.
>
> Any ideas?
>
> Mark
Hi Mark,
You're manipulating the GEF-Diagram with different Commands, right?-Then
you have to implement for every command an undo and a redo action by
overwriting #undo(), #redo() and #canUndo(). All executed commands are
on the command-stack an can be undone if the #canUndo() - method of the
special command returns true.
Cheerz,
Tom
|
|
|
Re: Logic Example and Undo/Redo support [message #214249 is a reply to message #214201] |
Fri, 14 April 2006 14:10 |
Eclipse User |
|
|
|
Originally posted by: markp.softlanding.com
Tom Seidel wrote:
> You're manipulating the GEF-Diagram with different Commands,
> right?-Then you have to implement for every command an undo and a
> redo action by overwriting #undo(), #redo() and #canUndo(). All
> executed commands are on the command-stack an can be undone if the
> #canUndo() - method of the special command returns true.
That is just how you enable undo/redo in your model. I have that
working fine. What I am asking is a UI issue. How do I get the
Eclipse IDE undo/redo menu and toolbar enabled and connected to my
code? The Logic example appears to do it. Right now, I have to
right-click in my diagram to get to the options. I just want the other
ones enabled too.
I have done it before via brute force, but it seems like the logic
example might have a better way. I just cannot figure it out.
This is in 3.0
Mark
|
|
|
Re: Logic Example and Undo/Redo support [message #214273 is a reply to message #214249] |
Fri, 14 April 2006 15:40 |
Eclipse User |
|
|
|
Originally posted by: tom.seidel.javawiki.org
Mark Phippard wrote:
> Tom Seidel wrote:
>
>> You're manipulating the GEF-Diagram with different Commands,
>> right?-Then you have to implement for every command an undo and a
>> redo action by overwriting #undo(), #redo() and #canUndo(). All
>> executed commands are on the command-stack an can be undone if the
>> #canUndo() - method of the special command returns true.
>
> That is just how you enable undo/redo in your model. I have that
> working fine. What I am asking is a UI issue. How do I get the
> Eclipse IDE undo/redo menu and toolbar enabled and connected to my
> code? The Logic example appears to do it. Right now, I have to
> right-click in my diagram to get to the options. I just want the other
> ones enabled too.
>
> I have done it before via brute force, but it seems like the logic
> example might have a better way. I just cannot figure it out.
>
> This is in 3.0
>
> Mark
Have you declared the contributor-class in your plugin.xml?
Tom
|
|
|
Re: Logic Example and Undo/Redo support [message #214281 is a reply to message #214273] |
Fri, 14 April 2006 17:17 |
Eclipse User |
|
|
|
Originally posted by: markp.softlanding.com
Tom Seidel wrote:
> Have you declared the contributor-class in your plugin.xml?
I am not sure what you mean. I look at the logic example XML and all I
see is it contributing a Print action and the stuff to declare the
editor itself and the New wizard.
Mark
|
|
|
Re: Logic Example and Undo/Redo support [message #214289 is a reply to message #214281] |
Fri, 14 April 2006 17:17 |
Eclipse User |
|
|
|
Originally posted by: markp.softlanding.com
Mark Phippard wrote:
> Tom Seidel wrote:
>
> > Have you declared the contributor-class in your plugin.xml?
>
> I am not sure what you mean. I look at the logic example XML and all
> I see is it contributing a Print action and the stuff to declare the
> editor itself and the New wizard.
Disregard. I see it now.
I will give it a try.
Thanks
Mark
|
|
|
Re: Logic Example and Undo/Redo support [message #214297 is a reply to message #214289] |
Fri, 14 April 2006 17:18 |
Eclipse User |
|
|
|
Originally posted by: markp.softlanding.com
Mark Phippard wrote:
> Mark Phippard wrote:
>
> > Tom Seidel wrote:
> >
> > > Have you declared the contributor-class in your plugin.xml?
> >
> > I am not sure what you mean. I look at the logic example XML and
> > all I see is it contributing a Print action and the stuff to
> > declare the editor itself and the New wizard.
>
> Disregard. I see it now.
>
> I will give it a try.
Actually, it turns out that Yes, I did already have that defined.
Any other ideas?
Mark
|
|
|
|
Re: Logic Example and Undo/Redo support [message #214544 is a reply to message #214536] |
Tue, 18 April 2006 12:39 |
Eclipse User |
|
|
|
Originally posted by: markp.softlanding.com
Sebu Thomas wrote:
> Mark Phippard wrote:
> > Mark Phippard wrote:
> >
> > > Mark Phippard wrote:
> > >
> > > > Tom Seidel wrote:
> > > >
> > > > > Have you declared the contributor-class in your plugin.xml?
> > > > I am not sure what you mean. I look at the logic example XML
> > > > and all I see is it contributing a Print action and the stuff to
> > > > declare the editor itself and the New wizard.
> > > Disregard. I see it now.
> > >
> > > I will give it a try.
> >
> > Actually, it turns out that Yes, I did already have that defined.
> >
> > Any other ideas?
> >
> > Mark
>
> Do you have the following in your contributor code?
>
> public void contributeToToolBar(IToolBarManager toolBarManager) {
> toolBarManager.add(getActionRegistry().getAction(ActionFacto ry.UNDO.ge
> tId()));
> toolBarManager.add(getActionRegistry().getAction(ActionFacto ry.REDO.ge
> tId())); .............. }
>
> Also part of contributor
>
> protected void buildActions() {
> addRetargetAction(new UndoRetargetAction());
> addRetargetAction(new RedoRetargetAction());
> ............
> }
>
> And you have registered your contributor class? Look in plugin.xml
> and see if you have <plugin>
>
> <extension
> point="org.eclipse.ui.editors">
> <editor
> class="my.MyEditor"
> contributorClass="my.MyContributor"
> ...........
> </plugin>
Yes, I had all of that. I finally got it working. I was doing a
couple of other things in my contributor class. I think one of these
was interefering with something or causing a side-effect. I
reorganized some of that code and then this started working.
Thanks
Mark
|
|
|
Powered by
FUDForum. Page generated in 0.05568 seconds