Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Checking Smart Insert Mode with menuContribution
Checking Smart Insert Mode with menuContribution [message #331376] Thu, 04 September 2008 01:29 Go to next message
Nick Sandonato is currently offline Nick SandonatoFriend
Messages: 126
Registered: July 2009
Senior Member
Hi,

I am trying to figure out how to make my editor have the Smart Insert
Mode menu item initially checked when the editor is opened.

Currently, I have an editor extending AbstractTextEditor that configures
the insert mode to allow SMART_INSERT. To add the menu item, I use a
menuContribution whose
commandId="org.eclipse.ui.edit.text.toggleInsertMode" and
style="toggle". When I launch my editor, Smart Insert Mode is enabled,
but it is not checked off. If I click on the menu item, Smart Insert
Mode is disabled, but now the item is checked.

Is there any way to set up the menu item so that Smart Insert Mode is
checked initially?

Thank you,
Nick
Re: Checking Smart Insert Mode with menuContribution [message #331382 is a reply to message #331376] Thu, 04 September 2008 08:16 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Nick Sandonato wrote:
> Hi,
>
> I am trying to figure out how to make my editor have the Smart Insert
> Mode menu item initially checked when the editor is opened.
>
> Currently, I have an editor extending AbstractTextEditor that
> configures the insert mode to allow SMART_INSERT. To add the menu
> item, I use a menuContribution whose
> commandId="org.eclipse.ui.edit.text.toggleInsertMode" and
> style="toggle". When I launch my editor, Smart Insert Mode is enabled,
> but it is not checked off. If I click on the menu item, Smart Insert
> Mode is disabled, but now the item is checked.
>
> Is there any way to set up the menu item so that Smart Insert Mode is
> checked initially?
Take a look at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor ActionContributor.fToggleInsertModeAction
and how it's done there.

Dani
>
> Thank you,
> Nick
Re: Checking Smart Insert Mode with menuContribution [message #331393 is a reply to message #331382] Thu, 04 September 2008 15:41 Go to previous messageGo to next message
Nick Sandonato is currently offline Nick SandonatoFriend
Messages: 126
Registered: July 2009
Senior Member
Thanks for the reply.

Are you saying that this is not possible without using an
ActionContributor? Originally, we had the code in contributeToMenu that
would add the fToggleInsertModeAction to the edit menu, like the JDT.
But in the process of moving our menus into the plugin.xml using
menuContributions, we removed the code from the ActionContributor. This
is when we noticed that Smart Insert Mode was added to the menu and
enabled, just not checked off.

Thanks,
Nick

Daniel Megert wrote:
> Nick Sandonato wrote:
>> Hi,
>>
>> I am trying to figure out how to make my editor have the Smart Insert
>> Mode menu item initially checked when the editor is opened.
>>
>> Currently, I have an editor extending AbstractTextEditor that
>> configures the insert mode to allow SMART_INSERT. To add the menu
>> item, I use a menuContribution whose
>> commandId="org.eclipse.ui.edit.text.toggleInsertMode" and
>> style="toggle". When I launch my editor, Smart Insert Mode is enabled,
>> but it is not checked off. If I click on the menu item, Smart Insert
>> Mode is disabled, but now the item is checked.
>>
>> Is there any way to set up the menu item so that Smart Insert Mode is
>> checked initially?
> Take a look at
> org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor ActionContributor.fToggleInsertModeAction
> and how it's done there.
>
> Dani
>>
>> Thank you,
>> Nick
Re: Checking Smart Insert Mode with menuContribution [message #331394 is a reply to message #331393] Thu, 04 September 2008 16:11 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Nick Sandonato wrote:
> Thanks for the reply.
>
> Are you saying that this is not possible without using an
> ActionContributor?
I neither said nor tried that ;-)

Dani
> Originally, we had the code in contributeToMenu that would add the
> fToggleInsertModeAction to the edit menu, like the JDT. But in the
> process of moving our menus into the plugin.xml using
> menuContributions, we removed the code from the ActionContributor.
> This is when we noticed that Smart Insert Mode was added to the menu
> and enabled, just not checked off.
>
> Thanks,
> Nick
>
> Daniel Megert wrote:
>> Nick Sandonato wrote:
>>> Hi,
>>>
>>> I am trying to figure out how to make my editor have the Smart
>>> Insert Mode menu item initially checked when the editor is opened.
>>>
>>> Currently, I have an editor extending AbstractTextEditor that
>>> configures the insert mode to allow SMART_INSERT. To add the menu
>>> item, I use a menuContribution whose
>>> commandId="org.eclipse.ui.edit.text.toggleInsertMode" and
>>> style="toggle". When I launch my editor, Smart Insert Mode is
>>> enabled, but it is not checked off. If I click on the menu item,
>>> Smart Insert Mode is disabled, but now the item is checked.
>>>
>>> Is there any way to set up the menu item so that Smart Insert Mode
>>> is checked initially?
>> Take a look at
>> org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor ActionContributor.fToggleInsertModeAction
>> and how it's done there.
>>
>> Dani
>>>
>>> Thank you,
>>> Nick
Previous Topic:Retarget MoveResourceAction & RenameResourceAction
Next Topic:[Databinding] Example Application showing Databinding, EMF, Teneo and CDO in action
Goto Forum:
  


Current Time: Mon Jul 22 02:20:34 GMT 2024

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

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

Back to the top