-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathplugin.xml
156 lines (143 loc) · 7.33 KB
/
plugin.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<!--
| AutoRefactor - Eclipse plugin to automatically refactor Java code bases.
|
| Copyright (C) 2013-2018 Jean-Noël Rouvignac - initial API and implementation
|
| This program is free software: you can redistribute it and/or modify
| it under the terms of the GNU General Public License as published by
| the Free Software Foundation, either version 3 of the License, or
| any later version.
|
| This program is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU General Public License
| along with this program under LICENSE-GNUGPL. If not, see
| <http://www.gnu.org/licenses/>.
|
|
| All rights reserved. This program and the accompanying materials
| are made available under the terms of the Eclipse Public License v1.0
| which accompanies this distribution under LICENSE-ECLIPSE, and is
| available at http://www.eclipse.org/legal/epl-v10.html
-->
<plugin>
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="popup:org.eclipse.jdt.ui.PackageExplorer?after=org.eclipse.jdt.ui.source.menu">
<!-- See http://blog.richclientgui.com/?p=50
"Eclipse RCP Commands Part 3: visibleWhen and Core Expressions"
http://wiki.eclipse.org/Platform_Expression_Framework
http://blog.eclipse-tips.com/2009/01/commands-part-2-selection-and.html
http://unicase.blogspot.fr/2011/02/curious-case-of-visiblewhen.html
-->
<visibleWhen checkEnabled="false">
<iterate ifEmpty="false" operator="or">
<or>
<instanceof value="org.eclipse.jdt.core.IJavaProject" />
<instanceof value="org.eclipse.jdt.core.IPackageFragment" />
<instanceof value="org.eclipse.jdt.core.ICompilationUnit" />
</or>
</iterate>
</visibleWhen>
<menu label="Source (AutoRefactor)">
<command style="push"
commandId="org.autorefactor.automatic.refactoring" />
<command style="push"
commandId="org.autorefactor.choose.refactorings" />
</menu>
</menuContribution>
<menuContribution locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?after=org.eclipse.jdt.ui.source.menu">
<visibleWhen checkEnabled="false">
<iterate ifEmpty="false" operator="or">
<or>
<instanceof value="org.eclipse.jdt.core.IJavaProject" />
<instanceof value="org.eclipse.jdt.core.IPackageFragment" />
<instanceof value="org.eclipse.jdt.core.ICompilationUnit" />
</or>
</iterate>
</visibleWhen>
<menu label="Source (AutoRefactor)">
<command style="push"
commandId="org.autorefactor.automatic.refactoring" />
<command style="push"
commandId="org.autorefactor.choose.refactorings" />
</menu>
</menuContribution>
<!-- Cannot add to Refactor sub menu: @see https://issues.jboss.org/browse/JBIDE-1077 from Alexey Kazakov:
More precisely @see https://issues.jboss.org/browse/JBIDE-1077#comment-12466929:
"Unfortunately we can't use this context menu... "Refactor" is assembled programmatically by JDT and it ignores any custom extensions."
and @see https://issues.jboss.org/browse/JBIDE-1077#comment-12466953
"Me, Viktor and Denis tried to find a way to add any custom action in "Refactor" menu. We tried to use standard Eclipse extension points to point it to the same menu as JDT does but without success.
Viktor found out that JDT hard codes items for that menu and it seems that there is no way to add our item there. But it was almost a year ago and maybe JDT has changed something... I doubt that but anyway let's research it in Eclipse 3.5."
@see org.eclipse.jdt.ui.actions.RefactorActionGroup
-->
<menuContribution locationURI="popup:#CompilationUnitEditorContext?after=org.eclipse.jdt.ui.source.menu">
<menu label="Source (AutoRefactor)">
<command style="push"
commandId="org.autorefactor.automatic.refactoring" />
<command style="push"
commandId="org.autorefactor.choose.refactorings" />
</menu>
</menuContribution>
</extension>
<extension point="org.eclipse.ui.bindings">
<!-- @see http://www.vogella.com/articles/EclipseCommandsKeybindings/article.html -->
<!-- TODO JNR org.eclipse.ui.textEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration
contextId="org.eclipse.ui.editors"
-->
<key
commandId="org.autorefactor.automatic.refactoring"
contextId="org.eclipse.ui.contexts.window"
sequence="M2+M3+Y"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" />
</extension>
<extension point="org.eclipse.ui.commands">
<command
categoryId="org.eclipse.jdt.ui.category.refactoring"
defaultHandler="org.autorefactor.ui.AutoRefactorHandler"
description="Execute all enabled AutoRefactor refactorings on selection"
id="org.autorefactor.automatic.refactoring"
name="AutoRefactor Clean Up">
</command>
<command
categoryId="org.eclipse.jdt.ui.category.refactoring"
defaultHandler="org.autorefactor.ui.ChooseRefactoringsWizardHandler"
description="Choose AutoRefactor refactorings to execute on selection"
id="org.autorefactor.choose.refactorings"
name="Choose cleanups...">
</command>
</extension>
<extension point="org.eclipse.jdt.ui.cleanUps">
<cleanUp
id="autorefactor_clean_up"
class="org.autorefactor.ui.AutoRefactorCleanUp">
</cleanUp>
<cleanUpOptionsInitializer
class="org.autorefactor.ui.AutoRefactorOptionsInitializer"
cleanUpKind="cleanUp">
</cleanUpOptionsInitializer>
<cleanUpOptionsInitializer
class="org.autorefactor.ui.AutoRefactorSaveActionOptionsInitializer"
cleanUpKind="saveAction">
</cleanUpOptionsInitializer>
<cleanUpConfigurationUI
class="org.autorefactor.ui.AutoRefactorTabPage"
name="AutoRefactor" cleanUpKind="cleanUp">
</cleanUpConfigurationUI>
</extension>
<!-- Workspace wide preferences -->
<extension point="org.eclipse.ui.preferencePages">
<page
category="org.eclipse.jdt.ui.preferences.CodeStylePreferencePage"
class="org.autorefactor.ui.preferences.WorkspacePreferencePage"
id ="org.autorefactor.ui.preferences.PreferencePage"
name="AutoRefactor" />
</extension>
<extension point="org.eclipse.core.runtime.preferences">
<initializer class="org.autorefactor.ui.preferences.PreferenceInitializer" />
</extension>
</plugin>