Revision 9608f61c
Added by Patrick Plitzner almost 7 years ago
eu.etaxonomy.taxeditor.bulkeditor/plugin.xml | ||
---|---|---|
48 | 48 |
</dynamic> |
49 | 49 |
</menuContribution> |
50 | 50 |
<menuContribution |
51 |
locationURI="popup:#BulkEditorContext"> |
|
52 |
<dynamic |
|
53 |
class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu" |
|
54 |
id="eu.etaxonomy.taxeditor.bulkeditor.cdmViewerContextMenu"> |
|
55 |
</dynamic> |
|
56 |
<separator |
|
57 |
name="taxeditor-bulkeditor.separator1" |
|
58 |
visible="true"> |
|
59 |
</separator> |
|
51 |
locationURI="popup:bulkeditor.editor"> |
|
60 | 52 |
<menu |
61 | 53 |
label="%menu.label.1"> |
62 | 54 |
<dynamic |
... | ... | |
110 | 102 |
definitionId="isMergeEnabled"> |
111 | 103 |
</reference> |
112 | 104 |
</visibleWhen> |
113 |
</command> |
|
114 |
<!--menuContribution |
|
115 |
locationURI="popup:org.eclipse.ui.popup.any"--> |
|
105 |
</command> |
|
116 | 106 |
<command |
117 | 107 |
commandId="bulkeditor.commands.mergegroup" |
118 | 108 |
label="%command.label.3" |
... | ... | |
191 | 181 |
</reference> |
192 | 182 |
</visibleWhen> |
193 | 183 |
</command> |
184 |
<dynamic |
|
185 |
class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu" |
|
186 |
id="eu.etaxonomy.taxeditor.bulkeditor.cdmViewerContextMenu"> |
|
187 |
</dynamic> |
|
188 |
<!--menuContribution |
|
189 |
locationURI="popup:org.eclipse.ui.popup.any"--> |
|
194 | 190 |
</menuContribution> |
195 | 191 |
<menuContribution |
196 | 192 |
allPopups="false" |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java | ||
---|---|---|
12 | 12 |
import org.eclipse.core.commands.operations.IUndoContext; |
13 | 13 |
import org.eclipse.core.commands.operations.UndoContext; |
14 | 14 |
import org.eclipse.core.runtime.IProgressMonitor; |
15 |
import org.eclipse.jface.action.GroupMarker; |
|
15 | 16 |
import org.eclipse.jface.action.IMenuManager; |
17 |
import org.eclipse.jface.action.MenuManager; |
|
16 | 18 |
import org.eclipse.jface.dialogs.MessageDialog; |
17 | 19 |
import org.eclipse.jface.dialogs.MessageDialogWithToggle; |
18 | 20 |
import org.eclipse.jface.preference.IPreferenceStore; |
... | ... | |
33 | 35 |
import org.eclipse.swt.layout.GridLayout; |
34 | 36 |
import org.eclipse.swt.widgets.Composite; |
35 | 37 |
import org.eclipse.swt.widgets.Control; |
38 |
import org.eclipse.swt.widgets.Menu; |
|
36 | 39 |
import org.eclipse.ui.IEditorInput; |
37 | 40 |
import org.eclipse.ui.IEditorSite; |
41 |
import org.eclipse.ui.IWorkbenchActionConstants; |
|
38 | 42 |
import org.eclipse.ui.PartInitException; |
39 | 43 |
import org.eclipse.ui.texteditor.ITextEditorActionConstants; |
40 | 44 |
|
... | ... | |
85 | 89 |
protected void initializeEditor() { |
86 | 90 |
super.initializeEditor(); |
87 | 91 |
|
88 |
/** |
|
89 |
* see AbstractTextEditor javadoc for explanation of context menu ids |
|
90 |
*/ |
|
91 |
setEditorContextMenuId("#BulkEditorContext"); |
|
92 |
|
|
93 | 92 |
// setEntityCreatorService(new BulkEditorEntityCreatorService()); |
94 | 93 |
|
95 | 94 |
setLineDisplayStrategy(new BulkEditorLineDisplay(this)); |
96 | 95 |
|
97 | 96 |
setSourceViewerConfiguration(new BulkEditorViewerConfiguration(lineDisplayStrategy)); |
97 |
|
|
98 | 98 |
} |
99 | 99 |
|
100 | 100 |
/** {@inheritDoc} */ |
... | ... | |
152 | 152 |
control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
153 | 153 |
} |
154 | 154 |
} |
155 |
|
|
156 |
//create context menu |
|
157 |
MenuManager menuManager = new MenuManager(); |
|
158 |
menuManager.setRemoveAllWhenShown(true); |
|
159 |
menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); |
|
160 |
getSite().registerContextMenu(menuManager, getSelectionProvider()); |
|
161 |
Menu menu = menuManager.createContextMenu(this.getSourceViewer().getTextWidget()); |
|
162 |
this.getSourceViewer().getTextWidget().setMenu(menu); |
|
163 |
|
|
155 | 164 |
} |
156 | 165 |
|
157 | 166 |
/** {@inheritDoc} */ |
eu.etaxonomy.taxeditor.editor/plugin.xml | ||
---|---|---|
990 | 990 |
</menuContribution> |
991 | 991 |
<menuContribution |
992 | 992 |
allPopups="false" |
993 |
locationURI="popup:#BulkEditorContext?before=taxeditor-bulkeditor.separator1">
|
|
993 |
locationURI="popup:bulkeditor.editor?before=taxeditor-bulkeditor.separator1">
|
|
994 | 994 |
<command |
995 | 995 |
commandId="eu.etaxonomy.taxeditor.group.cdmauthorities.edit" |
996 | 996 |
label="%command.label.45" |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java | ||
---|---|---|
69 | 69 |
// Add context menu to tree |
70 | 70 |
MenuManager menuMgr = new MenuManager(); |
71 | 71 |
menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); |
72 |
menuMgr.setRemoveAllWhenShown(true); |
|
72 | 73 |
getSite().registerContextMenu(menuMgr, viewer); |
73 | 74 |
|
74 | 75 |
Control control = viewer.getControl(); |
Also available in: Unified diff
Fix context menu of bulk editor and media view