Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Context-sensitive usage of the global save menu item
Context-sensitive usage of the global save menu item [message #108346] Thu, 07 August 2003 16:14 Go to next message
Eclipse UserFriend
Originally posted by: vgusev.graphlogic.com

Hello,

Is it possible to intercept a user's clicking on Save Button in a custom
view and attach a custom action to it? Seems pretty basic thing to ask, but
I could not find any pointers, which would be greatly appreciated.

Thanks a lot.

Vladimir
Re: Context-sensitive usage of the global save menu item [message #108405 is a reply to message #108346] Thu, 07 August 2003 18:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: knut_radloff.oti.com

The save action is a retargetable action so you should be able to hook an action handler. See IActionBars.setGlobalActionHandler.
The id is IWorkbenchActionConstants.SAVE

Knut
"Vladimir" <vgusev@graphlogic.com> wrote in message news:bgubu3$l4j$1@eclipse.org...
> Hello,
>
> Is it possible to intercept a user's clicking on Save Button in a custom
> view and attach a custom action to it? Seems pretty basic thing to ask, but
> I could not find any pointers, which would be greatly appreciated.
>
> Thanks a lot.
>
> Vladimir
>
>
Re: Context-sensitive usage of the global save menu item [message #108444 is a reply to message #108405] Thu, 07 August 2003 19:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vgusev.graphlogic.com

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C35D18.1E40FE40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Knut,=20

Thanks a lot for your suggestiong I have just tried to use

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
SaveAction saveAction;
......

saveAction =3D new SaveAction(getViewSite().getWorkbenchWindow()) {
public void run(){=20
persistModel();
}
};
.....
=
getViewSite().getActionBars().setGlobalActionHandler(org.ecl ipse.ui.IWork=
benchActionConstants.SAVE,saveAction);
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
however, my saveAction.run() is never called.

I think one problem that I have is that the Save menu item is not even =
active. How can I make it active from my view? Thanks again.

Vladimir


"Knut Radloff" <knut_radloff@oti.com> wrote in message =
news:bgui8e$rna$1@eclipse.org...
> The save action is a retargetable action so you should be able to hook =
an action handler. See IActionBars.setGlobalActionHandler.
> The id is IWorkbenchActionConstants.SAVE
>=20
> Knut
> "Vladimir" <vgusev@graphlogic.com> wrote in message =
news:bgubu3$l4j$1@eclipse.org...
> > Hello,
> >
> > Is it possible to intercept a user's clicking on Save Button in a =
custom
> > view and attach a custom action to it? Seems pretty basic thing to =
ask, but
> > I could not find any pointers, which would be greatly appreciated.
> >
> > Thanks a lot.
> >
> > Vladimir
> >
> >
>=20
>
------=_NextPart_000_000A_01C35D18.1E40FE40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Knut, </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks a lot for your suggestiong I =
have just tried=20
to use</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>SaveAction =
saveAction;</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>......</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>saveAction =3D new=20
SaveAction(getViewSite().getWorkbenchWindow()) {</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>&nbsp;&nbsp;&nbsp; =
public void=20
run(){ </FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; persistModel();</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>};</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>.....</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff=20
=
size=3D2> getViewSite().getActionBars().setGlobalActionHandler(org.ecl ipse=
..ui.IWorkbenchActionConstants.SAVE,saveAction);</FONT></DIV ></BLOCKQUOTE>=

<DIV><FONT face=3DArial =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D </FONT></DIV>=

<DIV><FONT face=3DArial size=3D2>however, my saveAction.run() is never=20
called.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I think one problem that I have is that =
the Save=20
menu item is not even active. How can I make it active from my view? =
Thanks=20
again.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Vladimir</FONT></DIV>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P>
<DIV><FONT face=3DArial size=3D2>"Knut Radloff" &lt;</FONT><A=20
href=3D"mailto:knut_radloff@oti.com"><FONT face=3DArial=20
size=3D2>knut_radloff@oti.com</FONT></A><FONT face=3DArial size=3D2>&gt; =
wrote in=20
message </FONT><A href=3D"news:bgui8e$rna$1@eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:bgui8e$rna$1@eclipse.org</FONT></A><FONT face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; The save =
action is a=20
retargetable action so you should be able to hook an action handler. See =

IActionBars.setGlobalActionHandler.<BR>&gt; The id is=20
IWorkbenchActionConstants.SAVE<BR>&gt; <BR>&gt; Knut<BR>&gt; "Vladimir"=20
&lt;</FONT><A href=3D"mailto:vgusev@graphlogic.com"><FONT face=3DArial=20
size=3D2>vgusev@graphlogic.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A href=3D"news:bgubu3$l4j$1@eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:bgubu3$l4j$1@eclipse.org</FONT></A><FONT face=3DArial=20
size=3D2>...<BR>&gt; &gt; Hello,<BR>&gt; &gt;<BR>&gt; &gt; Is it =
possible to=20
intercept a user's clicking on Save Button in a custom<BR>&gt; &gt; view =
and=20
attach a custom action to it? Seems pretty basic thing to ask, =
but<BR>&gt; &gt;=20
I could not find any pointers, which would be greatly =
appreciated.<BR>&gt;=20
&gt;<BR>&gt; &gt; Thanks a lot.<BR>&gt; &gt;<BR>&gt; &gt; =
Vladimir<BR>&gt;=20
&gt;<BR>&gt; &gt;<BR>&gt; <BR>&gt; </FONT></BODY></HTML>

------=_NextPart_000_000A_01C35D18.1E40FE40--
Re: Context-sensitive usage of the global save menu item [message #111286 is a reply to message #108444] Fri, 15 August 2003 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: knut_radloff.oti.com

The action is disabled even if your view is active/has focus?
Does your SaveAction do any enabling/disabling?

Knut
"Vladimir" <vgusev@graphlogic.com> wrote in message news:bgumf9$vhg$1@eclipse.org...
Knut,

Thanks a lot for your suggestiong I have just tried to use

==========
SaveAction saveAction;
......

saveAction = new SaveAction(getViewSite().getWorkbenchWindow()) {
public void run(){
persistModel();
}
};
.....
getViewSite().getActionBars().setGlobalActionHandler(org.ecl ipse.ui.IWorkbenchActionConstants.SAVE,saveAction);
=================
however, my saveAction.run() is never called.

I think one problem that I have is that the Save menu item is not even active. How can I make it active from my view? Thanks again.

Vladimir


"Knut Radloff" <knut_radloff@oti.com> wrote in message news:bgui8e$rna$1@eclipse.org...
> The save action is a retargetable action so you should be able to hook an action handler. See IActionBars.setGlobalActionHandler.
> The id is IWorkbenchActionConstants.SAVE
>
> Knut
> "Vladimir" <vgusev@graphlogic.com> wrote in message news:bgubu3$l4j$1@eclipse.org...
> > Hello,
> >
> > Is it possible to intercept a user's clicking on Save Button in a custom
> > view and attach a custom action to it? Seems pretty basic thing to ask, but
> > I could not find any pointers, which would be greatly appreciated.
> >
> > Thanks a lot.
> >
> > Vladimir
> >
> >
>
>
Re: Context-sensitive usage of the global save menu item [message #111309 is a reply to message #108444] Fri, 15 August 2003 08:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: knut_radloff.oti.com

Did you call updateActionBars?

"Vladimir" <vgusev@graphlogic.com> wrote in message news:bgumf9$vhg$1@eclipse.org...
Knut,

Thanks a lot for your suggestiong I have just tried to use

==========
SaveAction saveAction;
......

saveAction = new SaveAction(getViewSite().getWorkbenchWindow()) {
public void run(){
persistModel();
}
};
.....
getViewSite().getActionBars().setGlobalActionHandler(org.ecl ipse.ui.IWorkbenchActionConstants.SAVE,saveAction);
=================
however, my saveAction.run() is never called.

I think one problem that I have is that the Save menu item is not even active. How can I make it active from my view? Thanks again.

Vladimir


"Knut Radloff" <knut_radloff@oti.com> wrote in message news:bgui8e$rna$1@eclipse.org...
> The save action is a retargetable action so you should be able to hook an action handler. See IActionBars.setGlobalActionHandler.
> The id is IWorkbenchActionConstants.SAVE
>
> Knut
> "Vladimir" <vgusev@graphlogic.com> wrote in message news:bgubu3$l4j$1@eclipse.org...
> > Hello,
> >
> > Is it possible to intercept a user's clicking on Save Button in a custom
> > view and attach a custom action to it? Seems pretty basic thing to ask, but
> > I could not find any pointers, which would be greatly appreciated.
> >
> > Thanks a lot.
> >
> > Vladimir
> >
> >
>
>
Re: Context-sensitive usage of the global save menu item [message #119020 is a reply to message #108444] Thu, 28 August 2003 16:00 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_02D7_01C36D7D.91E04700
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

saveAction.setEnabled(true) // declared by Action
"Vladimir" <vgusev@graphlogic.com> wrote in message =
news:bgumf9$vhg$1@eclipse.org...
Knut,=20

Thanks a lot for your suggestiong I have just tried to use

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
SaveAction saveAction;
......

saveAction =3D new SaveAction(getViewSite().getWorkbenchWindow()) {
public void run(){=20
persistModel();
}
};
.....
=
getViewSite().getActionBars().setGlobalActionHandler(org.ecl ipse.ui.IWork=
benchActionConstants.SAVE,saveAction);
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
however, my saveAction.run() is never called.

I think one problem that I have is that the Save menu item is not even =
active. How can I make it active from my view? Thanks again.

Vladimir


"Knut Radloff" <knut_radloff@oti.com> wrote in message =
news:bgui8e$rna$1@eclipse.org...
> The save action is a retargetable action so you should be able to =
hook an action handler. See IActionBars.setGlobalActionHandler.
> The id is IWorkbenchActionConstants.SAVE
>=20
> Knut
> "Vladimir" <vgusev@graphlogic.com> wrote in message =
news:bgubu3$l4j$1@eclipse.org...
> > Hello,
> >
> > Is it possible to intercept a user's clicking on Save Button in a =
custom
> > view and attach a custom action to it? Seems pretty basic thing to =
ask, but
> > I could not find any pointers, which would be greatly appreciated.
> >
> > Thanks a lot.
> >
> > Vladimir
> >
> >
>=20
>
------=_NextPart_000_02D7_01C36D7D.91E04700
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial =
size=3D2> saveAction.setEnabled(true)&nbsp;&nbsp;&nbsp;&am p;nbsp;=20
// declared by Action</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Vladimir" &lt;<A=20
href=3D"mailto:vgusev@graphlogic.com">vgusev@graphlogic.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:bgumf9$vhg$1@eclipse.org">news:bgumf9$vhg$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>Knut, </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks a lot for your suggestiong I =
have just=20
tried to use</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>SaveAction=20
saveAction;</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>......</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>saveAction =3D new=20
SaveAction(getViewSite().getWorkbenchWindow()) {</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>&nbsp;&nbsp;&nbsp; =
public void=20
run(){ </FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; persistModel();</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>};</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>.....</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff=20
=
size=3D2> getViewSite().getActionBars().setGlobalActionHandler(org.ecl ipse=
..ui.IWorkbenchActionConstants.SAVE,saveAction);</FONT></DIV ></BLOCKQUOTE>=

<DIV><FONT face=3DArial =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D </FONT></DIV>=

<DIV><FONT face=3DArial size=3D2>however, my saveAction.run() is never =

called.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I think one problem that I have is =
that the Save=20
menu item is not even active. How can I make it active from my view? =
Thanks=20
again.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Vladimir</FONT></DIV>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P>
<DIV><FONT face=3DArial size=3D2>"Knut Radloff" &lt;</FONT><A=20
href=3D"mailto:knut_radloff@oti.com"><FONT face=3DArial=20
size=3D2>knut_radloff@oti.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A href=3D"news:bgui8e$rna$1@eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:bgui8e$rna$1@eclipse.org</FONT></A><FONT face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; The save =
action is a=20
retargetable action so you should be able to hook an action handler. =
See=20
IActionBars.setGlobalActionHandler.<BR>&gt; The id is=20
IWorkbenchActionConstants.SAVE<BR>&gt; <BR>&gt; Knut<BR>&gt; =
"Vladimir"=20
&lt;</FONT><A href=3D"mailto:vgusev@graphlogic.com"><FONT face=3DArial =

size=3D2>vgusev@graphlogic.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A href=3D"news:bgubu3$l4j$1@eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:bgubu3$l4j$1@eclipse.org</FONT></A><FONT face=3DArial=20
size=3D2>...<BR>&gt; &gt; Hello,<BR>&gt; &gt;<BR>&gt; &gt; Is it =
possible to=20
intercept a user's clicking on Save Button in a custom<BR>&gt; &gt; =
view and=20
attach a custom action to it? Seems pretty basic thing to ask, =
but<BR>&gt;=20
&gt; I could not find any pointers, which would be greatly=20
appreciated.<BR>&gt; &gt;<BR>&gt; &gt; Thanks a lot.<BR>&gt; =
&gt;<BR>&gt; &gt;=20
Vladimir<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; <BR>&gt;=20
</FONT></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_02D7_01C36D7D.91E04700--
Re: Context-sensitive usage of the global save menu item [message #119046 is a reply to message #119020] Thu, 28 August 2003 16:21 Go to previous message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

This is a multi-part message in MIME format.

------=_NextPart_000_0009_01C36D80.6EB3E270
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Save is not a retarget action. It only works for editors which are =
dirty. View changes are supposed to be saved as soon as they are made. =
If you need a "open-edit-save" lifecycle, then maybe your view should be =
an editor instead.

Maybe if you described your use case we could provide options for you to =
look at

Simon :-)

"Chris Laffra" <Chris_Laffra@oti.com> wrote in message =
news:biln1c$21r$1@eclipse.org...
saveAction.setEnabled(true) // declared by Action
"Vladimir" <vgusev@graphlogic.com> wrote in message =
news:bgumf9$vhg$1@eclipse.org...
Knut,=20

Thanks a lot for your suggestiong I have just tried to use

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
SaveAction saveAction;
......

saveAction =3D new SaveAction(getViewSite().getWorkbenchWindow()) =
{
public void run(){=20
persistModel();
}
};
.....
=
getViewSite().getActionBars().setGlobalActionHandler(org.ecl ipse.ui.IWork=
benchActionConstants.SAVE,saveAction);
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
however, my saveAction.run() is never called.

I think one problem that I have is that the Save menu item is not =
even active. How can I make it active from my view? Thanks again.

Vladimir


"Knut Radloff" <knut_radloff@oti.com> wrote in message =
news:bgui8e$rna$1@eclipse.org...
> The save action is a retargetable action so you should be able to =
hook an action handler. See IActionBars.setGlobalActionHandler.
> The id is IWorkbenchActionConstants.SAVE
>=20
> Knut
> "Vladimir" <vgusev@graphlogic.com> wrote in message =
news:bgubu3$l4j$1@eclipse.org...
> > Hello,
> >
> > Is it possible to intercept a user's clicking on Save Button in =
a custom
> > view and attach a custom action to it? Seems pretty basic thing =
to ask, but
> > I could not find any pointers, which would be greatly =
appreciated.
> >
> > Thanks a lot.
> >
> > Vladimir
> >
> >
>=20
>
------=_NextPart_000_0009_01C36D80.6EB3E270
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Save is not a retarget action. It only =
works for=20
editors which are dirty. View changes are supposed to be saved as soon =
as they=20
are made. If you need a "open-edit-save" lifecycle, then maybe your view =
should=20
be an editor instead.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Maybe if you described your use case we =
could=20
provide options for you to look at</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Simon :-)</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Chris Laffra" &lt;<A=20
href=3D"mailto:Chris_Laffra@oti.com">Chris_Laffra@oti.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:biln1c$21r$1@eclipse.org">news:biln1c$21r$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial=20
size=3D2> saveAction.setEnabled(true)&nbsp;&nbsp;&nbsp;&am p;nbsp; // =
declared by=20
Action</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Vladimir" &lt;<A=20
href=3D"mailto:vgusev@graphlogic.com">vgusev@graphlogic.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:bgumf9$vhg$1@eclipse.org">news:bgumf9$vhg$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>Knut, </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks a lot for your suggestiong I =
have just=20
tried to use</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>SaveAction=20
saveAction;</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff =
size=3D2>......</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>saveAction =3D =
new=20
SaveAction(getViewSite().getWorkbenchWindow()) {</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;&nbsp;&nbsp; public void=20
run(){ </FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; persistModel();</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;&nbsp;&nbsp;=20
}</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>};</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff =
size=3D2>.....</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff=20
=
size=3D2> getViewSite().getActionBars().setGlobalActionHandler(org.ecl ipse=
..ui.IWorkbenchActionConstants.SAVE,saveAction);</FONT></DIV ></BLOCKQUOTE>=

<DIV><FONT face=3DArial =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D </FONT></DIV>=

<DIV><FONT face=3DArial size=3D2>however, my saveAction.run() is =
never=20
called.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I think one problem that I have is =
that the=20
Save menu item is not even active. How can I make it active from my =
view?=20
Thanks again.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Vladimir</FONT></DIV>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P>
<DIV><FONT face=3DArial size=3D2>"Knut Radloff" &lt;</FONT><A=20
href=3D"mailto:knut_radloff@oti.com"><FONT face=3DArial=20
size=3D2>knut_radloff@oti.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A href=3D"news:bgui8e$rna$1@eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:bgui8e$rna$1@eclipse.org</FONT></A><FONT face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; The save =
action is a=20
retargetable action so you should be able to hook an action handler. =
See=20
IActionBars.setGlobalActionHandler.<BR>&gt; The id is=20
IWorkbenchActionConstants.SAVE<BR>&gt; <BR>&gt; Knut<BR>&gt; =
"Vladimir"=20
&lt;</FONT><A href=3D"mailto:vgusev@graphlogic.com"><FONT =
face=3DArial=20
size=3D2>vgusev@graphlogic.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A href=3D"news:bgubu3$l4j$1@eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:bgubu3$l4j$1@eclipse.org</FONT></A><FONT face=3DArial=20
size=3D2>...<BR>&gt; &gt; Hello,<BR>&gt; &gt;<BR>&gt; &gt; Is it =
possible to=20
intercept a user's clicking on Save Button in a custom<BR>&gt; &gt; =
view and=20
attach a custom action to it? Seems pretty basic thing to ask, =
but<BR>&gt;=20
&gt; I could not find any pointers, which would be greatly=20
appreciated.<BR>&gt; &gt;<BR>&gt; &gt; Thanks a lot.<BR>&gt; =
&gt;<BR>&gt;=20
&gt; Vladimir<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; <BR>&gt;=20
</FONT></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0009_01C36D80.6EB3E270--
Previous Topic:Update Eclipse SDK using local files
Next Topic:Unable to run eclipse on HP-UX
Goto Forum:
  


Current Time: Fri May 02 01:01:30 EDT 2025

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

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

Back to the top