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  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Goto Forum:
Current Time: Mon Feb 17 18:57:41 GMT 2025
Powered by FUDForum. Page generated in 1.05535 seconds
|