Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Source -> Format menu
Source -> Format menu [message #328718] Mon, 02 June 2008 18:25 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I created a source formatter for my plugin, attached to the source
viewer and I can execute it from a menu of my own; However, I'd like it
to be run from the Source -> Format menu that it appears in the project
explorer... how can this be done?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: Source -> Format menu [message #329054 is a reply to message #328718] Wed, 11 June 2008 13:38 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Lorenzo Bettini wrote:
> Hi
>
> I created a source formatter for my plugin, attached to the source
> viewer and I can execute it from a menu of my own; However, I'd like
> it to be run from the Source -> Format menu that it appears in the
> project explorer... how can this be done?
You need to define the command, the key binding and the action in your
plugin.xml. Take a look at "org.eclipse.jdt.ui.edit.text.java.format" in
/org.eclipse.jdt.ui/plugin.xml.

Dani
>
> thanks in advance
> Lorenzo
>
Re: Source -> Format menu [message #329385 is a reply to message #329054] Sun, 22 June 2008 13:40 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Daniel Megert wrote:
> Lorenzo Bettini wrote:
>> Hi
>>
>> I created a source formatter for my plugin, attached to the source
>> viewer and I can execute it from a menu of my own; However, I'd like
>> it to be run from the Source -> Format menu that it appears in the
>> project explorer... how can this be done?
> You need to define the command, the key binding and the action in your
> plugin.xml. Take a look at "org.eclipse.jdt.ui.edit.text.java.format" in
> /org.eclipse.jdt.ui/plugin.xml.
>

thanks, I'll take a look!

I was only surprised that "Source" is not one of the standard menus (I
mean, I didn't find an id for that, while there's one for edit, etc.),
or am I wrong?

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: Source -> Format menu [message #329855 is a reply to message #329054] Tue, 08 July 2008 15:50 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Daniel Megert wrote:
> Lorenzo Bettini wrote:
>> Hi
>>
>> I created a source formatter for my plugin, attached to the source
>> viewer and I can execute it from a menu of my own; However, I'd like
>> it to be run from the Source -> Format menu that it appears in the
>> project explorer... how can this be done?
> You need to define the command, the key binding and the action in your
> plugin.xml. Take a look at "org.eclipse.jdt.ui.edit.text.java.format" in
> /org.eclipse.jdt.ui/plugin.xml.

Hi

I actually haven't found any example of this; however, I'd need to be
able to associate an action to the "Source -> Format" menu that is in
the context menu in the package explorer; this shows for every file, but
it says that the action is not enabled for my files...

any doc or example on-line, please?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Previous Topic:Removing Import export from pop-up Menu
Next Topic:Contribution to Eclipse toolbar is not hidden on switching the perspective
Goto Forum:
  


Current Time: Sat Jul 27 18:38:41 GMT 2024

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

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

Back to the top