Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Refactoring: add new refactoring
Refactoring: add new refactoring [message #124002] Wed, 03 December 2003 04:06 Go to next message
Eclipse UserFriend
Originally posted by: scheglov_ke.nlmk.ru

We need to add new refactoring for out project. I know that refactoring API
is currently internal, but I want to clarify for myself several quiestions.

1. Will refactoring become public API in 3.0?

2. How to add new refactoring in "Refactor" menu? I want to show refactoring
action only when my editor is active, so I add it as editorActions and set
menubarPath as for other actions in JDT UI plugin.xml:
"org.eclipse.jdt.ui.refactoring.menu/reorgGroup" But Eclipse complains that
such menu path does not exist. So is it possible at all?

Here is full extention:

<extension
point="org.eclipse.ui.editorActions">
<editorContribution
targetID="com.swtdesigner.editors.MultiPageEditor"
id="org.eclipse.ui.texteditor.ruler.actions">
<action
definitionId="com.swtdesigner.refactoring.extract.frame.action "
label="Extract Frame"
class="com.swtdesigner.refactoring.ExtractFrameAction"
menubarPath="org.eclipse.jdt.ui.refactoring.menu/reorgGroup "
id="com.swtdesigner.refactoring.ExtractFrameAction">
</action>
</editorContribution>
</extension>


3. Most probably here is not right place to ask this question, but just to
ask all of them... Refactoring action should be enabled not just when me editor
is active, but also when some conditions are satisfied, so I try to use setEnabled()
method, but menu item is enabled always, even when I call setEnabled(false).

--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
Re: Refactoring: add new refactoring [message #127507 is a reply to message #124002] Mon, 15 December 2003 13:32 Go to previous messageGo to next message
Eclipse UserFriend
From what I understand in to JDT UI plan, the refactoring API will be
opened up. (see http://www.eclipse.org/jdt/index.html, go to "UI", then
in "What's happening" go to "plan").


On Wed, 03 Dec 2003 12:06:55 +0300, Konstantin Scheglov wrote:

> We need to add new refactoring for out project. I know that refactoring
> API
> is currently internal, but I want to clarify for myself several
> quiestions.
>
> 1. Will refactoring become public API in 3.0?
>
> 2. How to add new refactoring in "Refactor" menu? I want to show
> refactoring action only when my editor is active, so I add it as
> editorActions and set menubarPath as for other actions in JDT UI
> plugin.xml: "org.eclipse.jdt.ui.refactoring.menu/reorgGroup" But Eclipse
> complains that such menu path does not exist. So is it possible at all?
>
> Here is full extention:
>
> <extension
> point="org.eclipse.ui.editorActions">
> <editorContribution
> targetID="com.swtdesigner.editors.MultiPageEditor"
> id="org.eclipse.ui.texteditor.ruler.actions">
> <action
> definitionId="com.swtdesigner.refactoring.extract.frame.action "
> label="Extract Frame"
> class="com.swtdesigner.refactoring.ExtractFrameAction"
> menubarPath="org.eclipse.jdt.ui.refactoring.menu/reorgGroup "
> id="com.swtdesigner.refactoring.ExtractFrameAction">
> </action>
> </editorContribution>
> </extension>
>
>
> 3. Most probably here is not right place to ask this question, but just to
> ask all of them... Refactoring action should be enabled not just when me
> editor is active, but also when some conditions are satisfied, so I try to
> use setEnabled() method, but menu item is enabled always, even when I call
> setEnabled(false).
Re: Refactoring: add new refactoring [message #128683 is a reply to message #127507] Fri, 19 December 2003 05:42 Go to previous message
Eclipse UserFriend
A little late, but the reason why the action doesn't show up in the
context menu of the editor is, that you have to redefine the menu.

Here an example for a new refactoring action as an object contribution
and a contribution to a editor's context menu.

<extension point="org.eclipse.ui.popupMenus">

<viewerContribution

id="myId"

targetID="#CompilationUnitEditorContext">


<menu

id="org.eclipse.jdt.ui.refactoring.menu"

label="Refactor"

path="additions">

<separator name="undoRedoGroup"/>

<separator name="reorgGroup"/>

<separator name="typeGroup"/>

<separator name="codingGroup"/>

<separator name="myGroup"/>

</menu>


<action

id="myRefactoring"

label="My Refactoring"

menubarPath="org.eclipse.jdt.ui.refactoring.menu/myGroup"

class="MyClass">

</action>

</viewerContribution>


<objectContribution

id="watson"

objectClass="org.eclipse.jdt.core.IType">


<menu

id="org.eclipse.jdt.ui.refactoring.menu"

label="Refactor"

path="additions">

<separator name="undoRedoGroup"/>

<separator name="reorgGroup"/>

<separator name="typeGroup"/>

<separator name="codingGroup"/>

<separator name="myGroup"/>

</menu>


<action

id="myRefactoring"

label="My Refactoring"

menubarPath="org.eclipse.jdt.ui.refactoring.menu/myGroup"

class="MyClass">

</action>

</objectContribution>


</extension>



"Guillaume Pothier" <gpothier@free.fr> wrote in message
news:pan.2003.12.15.18.32.21.107224@free.fr...
> From what I understand in to JDT UI plan, the refactoring API will be
> opened up. (see http://www.eclipse.org/jdt/index.html, go to "UI", then
> in "What's happening" go to "plan").
>
>
> On Wed, 03 Dec 2003 12:06:55 +0300, Konstantin Scheglov wrote:
>
> > We need to add new refactoring for out project. I know that
refactoring
> > API
> > is currently internal, but I want to clarify for myself several
> > quiestions.
> >
> > 1. Will refactoring become public API in 3.0?
> >
> > 2. How to add new refactoring in "Refactor" menu? I want to show
> > refactoring action only when my editor is active, so I add it as
> > editorActions and set menubarPath as for other actions in JDT UI
> > plugin.xml: "org.eclipse.jdt.ui.refactoring.menu/reorgGroup" But Eclipse
> > complains that such menu path does not exist. So is it possible at all?
> >
> > Here is full extention:
> >
> > <extension
> > point="org.eclipse.ui.editorActions">
> > <editorContribution
> > targetID="com.swtdesigner.editors.MultiPageEditor"
> > id="org.eclipse.ui.texteditor.ruler.actions">
> > <action
> >
definitionId="com.swtdesigner.refactoring.extract.frame.action "
> > label="Extract Frame"
> > class="com.swtdesigner.refactoring.ExtractFrameAction"
> >
menubarPath="org.eclipse.jdt.ui.refactoring.menu/reorgGroup "
> > id="com.swtdesigner.refactoring.ExtractFrameAction">
> > </action>
> > </editorContribution>
> > </extension>
> >
> >
> > 3. Most probably here is not right place to ask this question, but just
to
> > ask all of them... Refactoring action should be enabled not just when me
> > editor is active, but also when some conditions are satisfied, so I try
to
> > use setEnabled() method, but menu item is enabled always, even when I
call
> > setEnabled(false).
>
Previous Topic:Step Filtering
Next Topic:my plug-in crashes IDE
Goto Forum:
  


Current Time: Tue Jul 22 14:50:07 EDT 2025

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

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

Back to the top