1
/*******************************************************************************
2
* Copyright (c) 2000, 2009 IBM Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM Corporation - initial API and implementation
10
* Anton Leherbauer (Wind River Systems) - Adapted for CDT
11
*******************************************************************************/
12
package org.eclipse.cdt.ui.actions;
14
import java.util.ArrayList;
15
import java.util.Iterator;
16
import java.util.List;
18
import org.eclipse.core.runtime.Assert;
19
import org.eclipse.jface.action.IAction;
20
import org.eclipse.jface.action.IMenuManager;
21
import org.eclipse.jface.action.MenuManager;
22
import org.eclipse.jface.action.Separator;
23
import org.eclipse.jface.viewers.ISelection;
24
import org.eclipse.jface.viewers.ISelectionChangedListener;
25
import org.eclipse.jface.viewers.ISelectionProvider;
26
import org.eclipse.jface.viewers.IStructuredSelection;
27
import org.eclipse.ui.IActionBars;
28
import org.eclipse.ui.IViewPart;
29
import org.eclipse.ui.IWorkbenchSite;
30
import org.eclipse.ui.actions.ActionGroup;
31
import org.eclipse.ui.actions.AddBookmarkAction;
32
import org.eclipse.ui.actions.AddTaskAction;
33
import org.eclipse.ui.handlers.IHandlerService;
34
import org.eclipse.ui.ide.IDEActionFactory;
35
import org.eclipse.ui.part.Page;
36
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
37
import org.eclipse.ui.texteditor.IUpdate;
38
import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
40
import org.eclipse.cdt.ui.refactoring.actions.GettersAndSettersAction;
41
import org.eclipse.cdt.ui.refactoring.actions.ImplementMethodAction;
43
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
44
import org.eclipse.cdt.internal.ui.actions.ActionMessages;
45
import org.eclipse.cdt.internal.ui.editor.AddIncludeOnSelectionAction;
46
import org.eclipse.cdt.internal.ui.editor.CEditor;
47
import org.eclipse.cdt.internal.ui.editor.ICEditorActionDefinitionIds;
50
* Action group that adds the source and generate actions to a part's context
51
* menu and installs handlers for the corresponding global menu actions.
54
* This class may be instantiated; it is not intended to be subclassed.
57
* @noextend This class is not intended to be subclassed by clients.
60
public class GenerateActionGroup extends ActionGroup {
63
* Pop-up menu: id of the source sub menu (value <code>org.eclipse.cdt.ui.source.menu</code>).
65
public static final String MENU_ID= "org.eclipse.cdt.ui.source.menu"; //$NON-NLS-1$
68
* Pop-up menu: id of the organize group of the source sub menu (value
69
* <code>organizeGroup</code>).
71
public static final String GROUP_ORGANIZE= "organizeGroup"; //$NON-NLS-1$
74
* Pop-up menu: id of the generate group of the source sub menu (value
75
* <code>generateGroup</code>).
77
public static final String GROUP_GENERATE= "generateGroup"; //$NON-NLS-1$
80
* Pop-up menu: id of the code group of the source sub menu (value
81
* <code>codeGroup</code>).
83
public static final String GROUP_CODE= "codeGroup"; //$NON-NLS-1$
86
* Pop-up menu: id of the externalize group of the source sub menu (value
87
* <code>externalizeGroup</code>).
89
private static final String GROUP_EXTERNALIZE= "externalizeGroup"; //$NON-NLS-1$
92
* Pop-up menu: id of the comment group of the source sub menu (value
93
* <code>commentGroup</code>).
95
private static final String GROUP_COMMENT= "commentGroup"; //$NON-NLS-1$
98
* Pop-up menu: id of the edit group of the source sub menu (value
99
* <code>editGroup</code>).
101
private static final String GROUP_EDIT= "editGroup"; //$NON-NLS-1$
103
private CEditor fEditor;
104
private IWorkbenchSite fSite;
105
private String fGroupName= IContextMenuConstants.GROUP_REORGANIZE;
106
private List<ISelectionChangedListener> fRegisteredSelectionListeners;
108
private AddIncludeOnSelectionAction fAddInclude;
109
// private OverrideMethodsAction fOverrideMethods;
110
// private GenerateHashCodeEqualsAction fHashCodeEquals;
111
private GettersAndSettersAction fAddGetterSetter;
112
private ImplementMethodAction fImplementMethod;
113
// private AddDelegateMethodsAction fAddDelegateMethods;
114
// private AddUnimplementedConstructorsAction fAddUnimplementedConstructors;
115
// private GenerateNewConstructorUsingFieldsAction fGenerateConstructorUsingFields;
116
// private AddJavaDocStubAction fAddCppDocStub;
117
private AddBookmarkAction fAddBookmark;
118
private AddTaskAction fAddTaskAction;
119
// private ExternalizeStringsAction fExternalizeStrings;
120
// private CleanUpAction fCleanUp;
122
// private OrganizeIncludesAction fOrganizeIncludes;
123
// private SortMembersAction fSortMembers;
124
// private FormatAllAction fFormatAll;
125
// private CopyQualifiedNameAction fCopyQualifiedNameAction;
127
// private static final String QUICK_MENU_ID= "org.eclipse.cdt.ui.edit.text.c.source.quickMenu"; //$NON-NLS-1$
129
// private class RefactorQuickAccessAction extends CDTQuickMenuAction {
130
// public RefactorQuickAccessAction(CEditor editor) {
131
// super(editor, QUICK_MENU_ID);
133
// protected void fillMenu(IMenuManager menu) {
134
// fillQuickMenu(menu);
138
// private RefactorQuickAccessAction fQuickAccessAction;
139
// private IKeyBindingService fKeyBindingService;
142
* Note: This constructor is for internal use only. Clients should not call this constructor.
143
* @param editor the C editor
144
* @param groupName the group name to add the action to
146
* @noreference This constructor is not intended to be referenced by clients.
148
public GenerateActionGroup(CEditor editor, String groupName) {
149
fSite= editor.getSite();
151
fGroupName= groupName;
153
fAddInclude= new AddIncludeOnSelectionAction(editor);
154
fAddInclude.setActionDefinitionId(ICEditorActionDefinitionIds.ADD_INCLUDE);
155
editor.setAction("AddIncludeOnSelection", fAddInclude); //$NON-NLS-1$
157
// fOrganizeIncludes= new OrganizeIncludesAction(editor);
158
// fOrganizeIncludes.setActionDefinitionId(ICEditorActionDefinitionIds.ORGANIZE_INCLUDES);
159
// editor.setAction("OrganizeIncludes", fOrganizeIncludes); //$NON-NLS-1$
161
// fSortMembers= new SortMembersAction(editor);
162
// fSortMembers.setActionDefinitionId(ICEditorActionDefinitionIds.SORT_MEMBERS);
163
// editor.setAction("SortMembers", fSortMembers); //$NON-NLS-1$
165
// IAction pastAction= editor.getAction(ITextEditorActionConstants.PASTE);//IWorkbenchActionDefinitionIds.PASTE);
166
// fCopyQualifiedNameAction= new CopyQualifiedNameAction(editor, null, pastAction);
167
// fCopyQualifiedNameAction.setActionDefinitionId(CopyQualifiedNameAction.JAVA_EDITOR_ACTION_DEFINITIONS_ID);
168
// editor.setAction("CopyQualifiedName", fCopyQualifiedNameAction); //$NON-NLS-1$
170
// fOverrideMethods= new OverrideMethodsAction(editor);
171
// fOverrideMethods.setActionDefinitionId(ICEditorActionDefinitionIds.OVERRIDE_METHODS);
172
// editor.setAction("OverrideMethods", fOverrideMethods); //$NON-NLS-1$
174
fAddGetterSetter= new GettersAndSettersAction(editor);
175
fAddGetterSetter.setActionDefinitionId(ICEditorActionDefinitionIds.GETTERS_AND_SETTERS);
176
editor.setAction("org.eclipse.cdt.ui.refactor.getters.and.setters", fAddGetterSetter); //$NON-NLS-1$
178
fImplementMethod = new ImplementMethodAction(editor);
179
fImplementMethod.setActionDefinitionId(ICEditorActionDefinitionIds.IMPLEMENT_METHOD);
180
editor.setAction("org.eclipse.cdt.ui.refactor.implement.method", fImplementMethod); //$NON-NLS-1$
182
// fAddDelegateMethods= new AddDelegateMethodsAction(editor);
183
// fAddDelegateMethods.setActionDefinitionId(ICEditorActionDefinitionIds.CREATE_DELEGATE_METHODS);
184
// editor.setAction("AddDelegateMethods", fAddDelegateMethods); //$NON-NLS-1$
186
// fAddUnimplementedConstructors= new AddUnimplementedConstructorsAction(editor);
187
// fAddUnimplementedConstructors.setActionDefinitionId(ICEditorActionDefinitionIds.ADD_UNIMPLEMENTED_CONTRUCTORS);
188
// editor.setAction("AddUnimplementedConstructors", fAddUnimplementedConstructors); //$NON-NLS-1$
190
// fGenerateConstructorUsingFields= new GenerateNewConstructorUsingFieldsAction(editor);
191
// fGenerateConstructorUsingFields.setActionDefinitionId(ICEditorActionDefinitionIds.GENERATE_CONSTRUCTOR_USING_FIELDS);
192
// editor.setAction("GenerateConstructorUsingFields", fGenerateConstructorUsingFields); //$NON-NLS-1$
194
// fHashCodeEquals= new GenerateHashCodeEqualsAction(editor);
195
// fHashCodeEquals.setActionDefinitionId(ICEditorActionDefinitionIds.GENERATE_HASHCODE_EQUALS);
196
// editor.setAction("GenerateHashCodeEquals", fHashCodeEquals); //$NON-NLS-1$
198
// fAddCppDocStub= new AddJavaDocStubAction(editor);
199
// fAddCppDocStub.setActionDefinitionId(ICEditorActionDefinitionIds.ADD_JAVADOC_COMMENT);
200
// editor.setAction("AddJavadocComment", fAddCppDocStub); //$NON-NLS-1$
202
// fCleanUp= new CleanUpAction(editor);
203
// fCleanUp.setActionDefinitionId(ICEditorActionDefinitionIds.CLEAN_UP);
204
// editor.setAction("CleanUp", fCleanUp); //$NON-NLS-1$
206
// fExternalizeStrings= new ExternalizeStringsAction(editor);
207
// fExternalizeStrings.setActionDefinitionId(ICEditorActionDefinitionIds.EXTERNALIZE_STRINGS);
208
// editor.setAction("ExternalizeStrings", fExternalizeStrings); //$NON-NLS-1$
210
// fQuickAccessAction= new RefactorQuickAccessAction(editor);
211
// fKeyBindingService= editor.getEditorSite().getKeyBindingService();
212
// fKeyBindingService.registerAction(fQuickAccessAction);
216
* Creates a new <code>GenerateActionGroup</code>. The group
217
* requires that the selection provided by the page's selection provider
218
* is of type <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
220
* @param page the page that owns this action group
222
public GenerateActionGroup(Page page) {
223
this(page.getSite(), null);
227
* Creates a new <code>GenerateActionGroup</code>. The group
228
* requires that the selection provided by the part's selection provider
229
* is of type <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
231
* @param part the view part that owns this action group
233
public GenerateActionGroup(IViewPart part) {
234
this(part.getSite(), (IHandlerService)part.getSite().getService(IHandlerService.class));
237
private GenerateActionGroup(IWorkbenchSite site, IHandlerService handlerService) {
239
ISelectionProvider provider= fSite.getSelectionProvider();
240
ISelection selection= provider.getSelection();
242
// fOverrideMethods= new OverrideMethodsAction(site);
243
// fOverrideMethods.setActionDefinitionId(ICEditorActionDefinitionIds.OVERRIDE_METHODS);
245
// fAddGetterSetter= new AddGetterSetterAction(site);
246
// fAddGetterSetter.setActionDefinitionId(ICEditorActionDefinitionIds.CREATE_GETTER_SETTER);
248
// fAddDelegateMethods= new AddDelegateMethodsAction(site);
249
// fAddDelegateMethods.setActionDefinitionId(ICEditorActionDefinitionIds.CREATE_DELEGATE_METHODS);
251
// fAddUnimplementedConstructors= new AddUnimplementedConstructorsAction(site);
252
// fAddUnimplementedConstructors.setActionDefinitionId(ICEditorActionDefinitionIds.ADD_UNIMPLEMENTED_CONTRUCTORS);
254
// fGenerateConstructorUsingFields= new GenerateNewConstructorUsingFieldsAction(site);
255
// fGenerateConstructorUsingFields.setActionDefinitionId(ICEditorActionDefinitionIds.GENERATE_CONSTRUCTOR_USING_FIELDS);
257
// fHashCodeEquals= new GenerateHashCodeEqualsAction(site);
258
// fHashCodeEquals.setActionDefinitionId(ICEditorActionDefinitionIds.GENERATE_HASHCODE_EQUALS);
260
// fAddCppDocStub= new AddJavaDocStubAction(site);
261
// fAddCppDocStub.setActionDefinitionId(ICEditorActionDefinitionIds.ADD_JAVADOC_COMMENT);
263
fAddBookmark= new AddBookmarkAction(site, true);
264
fAddBookmark.setActionDefinitionId(IWorkbenchActionDefinitionIds.ADD_BOOKMARK);
266
fAddTaskAction= new AddTaskAction(site);
267
fAddTaskAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.ADD_TASK);
269
// fExternalizeStrings= new ExternalizeStringsAction(site);
270
// fExternalizeStrings.setActionDefinitionId(ICEditorActionDefinitionIds.EXTERNALIZE_STRINGS);
272
// fOrganizeIncludes= new OrganizeIncludesAction(site);
273
// fOrganizeIncludes.setActionDefinitionId(ICEditorActionDefinitionIds.ORGANIZE_INCLUDES);
275
// fSortMembers= new SortMembersAction(site);
276
// fSortMembers.setActionDefinitionId(ICEditorActionDefinitionIds.SORT_MEMBERS);
278
// fFormatAll= new FormatAllAction(site);
279
// fFormatAll.setActionDefinitionId(ICEditorActionDefinitionIds.FORMAT);
281
// fCleanUp= new CleanUpAction(site);
282
// fCleanUp.setActionDefinitionId(ICEditorActionDefinitionIds.CLEAN_UP);
285
// fOverrideMethods.update(selection);
286
// fAddGetterSetter.update(selection);
287
// fAddDelegateMethods.update(selection);
288
// fAddUnimplementedConstructors.update(selection);
289
// fGenerateConstructorUsingFields.update(selection);
290
// fHashCodeEquals.update(selection);
291
// fAddCppDocStub.update(selection);
292
// fExternalizeStrings.update(selection);
293
// fFindNLSProblems.update(selection);
294
// fCleanUp.update(selection);
295
// fOrganizeIncludes.update(selection);
296
// fSortMembers.update(selection);
297
// fFormatAll.update(selection);
298
if (selection instanceof IStructuredSelection) {
299
IStructuredSelection ss= (IStructuredSelection)selection;
300
fAddBookmark.selectionChanged(ss);
301
fAddTaskAction.selectionChanged(ss);
303
fAddBookmark.setEnabled(false);
304
fAddTaskAction.setEnabled(false);
307
// registerSelectionListener(provider, fOverrideMethods);
308
// registerSelectionListener(provider, fAddGetterSetter);
309
// registerSelectionListener(provider, fAddDelegateMethods);
310
// registerSelectionListener(provider, fAddUnimplementedConstructors);
311
// registerSelectionListener(provider, fGenerateConstructorUsingFields);
312
// registerSelectionListener(provider, fHashCodeEquals);
313
// registerSelectionListener(provider, fAddCppDocStub);
314
registerSelectionListener(provider, fAddBookmark);
315
// registerSelectionListener(provider, fExternalizeStrings);
316
// registerSelectionListener(provider, fFindNLSProblems);
317
// registerSelectionListener(provider, fOrganizeIncludes);
318
// registerSelectionListener(provider, fFormatAll);
319
// registerSelectionListener(provider, fSortMembers);
320
registerSelectionListener(provider, fAddTaskAction);
321
// registerSelectionListener(provider, fCleanUp);
323
// fKeyBindingService= keyBindingService;
324
// if (fKeyBindingService != null) {
325
// fQuickAccessAction= new RefactorQuickAccessAction(null);
326
// fKeyBindingService.registerAction(fQuickAccessAction);
330
private void registerSelectionListener(ISelectionProvider provider, ISelectionChangedListener listener) {
331
if (fRegisteredSelectionListeners == null)
332
fRegisteredSelectionListeners= new ArrayList<ISelectionChangedListener>(10);
333
provider.addSelectionChangedListener(listener);
334
fRegisteredSelectionListeners.add(listener);
338
* The state of the editor owning this action group has changed.
339
* This method does nothing if the group's owner isn't an
343
* Note: This method is for internal use only. Clients should not call this method.
345
public void editorStateChanged() {
346
Assert.isTrue(isEditorOwner());
350
* Method declared in ActionGroup
353
public void fillActionBars(IActionBars actionBar) {
354
super.fillActionBars(actionBar);
355
setGlobalActionHandlers(actionBar);
359
* Method declared in ActionGroup
362
public void fillContextMenu(IMenuManager menu) {
363
super.fillContextMenu(menu);
364
String menuText= ActionMessages.getString("SourceMenu_label"); //$NON-NLS-1$
365
// if (fQuickAccessAction != null) {
366
// menuText= fQuickAccessAction.addShortcut(menuText);
368
IMenuManager subMenu= new MenuManager(menuText, MENU_ID);
370
if (isEditorOwner()) {
371
added= fillEditorSubMenu(subMenu);
373
added= fillViewSubMenu(subMenu);
376
menu.appendToGroup(fGroupName, subMenu);
379
// private void fillQuickMenu(IMenuManager menu) {
380
// if (isEditorOwner()) {
381
// fillEditorSubMenu(menu);
383
// fillViewSubMenu(menu);
387
private int fillEditorSubMenu(IMenuManager source) {
389
source.add(new Separator(GROUP_COMMENT));
390
added+= addEditorAction(source, "ToggleComment"); //$NON-NLS-1$
391
added+= addEditorAction(source, "AddBlockComment"); //$NON-NLS-1$
392
added+= addEditorAction(source, "RemoveBlockComment"); //$NON-NLS-1$
393
// added+= addAction(source, fAddCppDocStub);
394
source.add(new Separator(GROUP_EDIT));
395
added+= addEditorAction(source, ITextEditorActionConstants.SHIFT_RIGHT);
396
added+= addEditorAction(source, ITextEditorActionConstants.SHIFT_LEFT);
397
added+= addEditorAction(source, "Indent"); //$NON-NLS-1$
398
added+= addEditorAction(source, "Format"); //$NON-NLS-1$
399
source.add(new Separator(GROUP_ORGANIZE));
400
added+= addAction(source, fAddInclude);
401
// added+= addAction(source, fOrganizeIncludes);
402
// added+= addAction(source, fSortMembers);
403
// added+= addAction(source, fCleanUp);
404
source.add(new Separator(GROUP_GENERATE));
405
added+= addEditorAction(source, "ContentAssistProposal"); //$NON-NLS-1$
406
// added+= addAction(source, fOverrideMethods);
407
added+= addAction(source, fAddGetterSetter);
408
added+= addAction(source, fImplementMethod);
409
// added+= addAction(source, fAddDelegateMethods);
410
// added+= addAction(source, fHashCodeEquals);
411
// added+= addAction(source, fGenerateConstructorUsingFields);
412
// added+= addAction(source, fAddUnimplementedConstructors);
413
source.add(new Separator(GROUP_CODE));
414
source.add(new Separator(GROUP_EXTERNALIZE));
415
// added+= addAction(source, fExternalizeStrings);
419
private int fillViewSubMenu(IMenuManager source) {
421
source.add(new Separator(GROUP_COMMENT));
422
// added+= addAction(source, fAddCppDocStub);
423
source.add(new Separator(GROUP_EDIT));
424
// added+= addAction(source, fFormatAll);
425
source.add(new Separator(GROUP_ORGANIZE));
426
added+= addAction(source, fAddInclude);
427
// added+= addAction(source, fOrganizeIncludes);
428
// added+= addAction(source, fSortMembers);
429
// added+= addAction(source, fCleanUp);
430
source.add(new Separator(GROUP_GENERATE));
431
// added+= addAction(source, fOverrideMethods);
432
added+= addAction(source, fAddGetterSetter);
433
added+= addAction(source, fImplementMethod);
434
// added+= addAction(source, fAddDelegateMethods);
435
// added+= addAction(source, fHashCodeEquals);
436
// added+= addAction(source, fGenerateConstructorUsingFields);
437
// added+= addAction(source, fAddUnimplementedConstructors);
438
source.add(new Separator(GROUP_CODE));
439
source.add(new Separator(GROUP_EXTERNALIZE));
440
// added+= addAction(source, fExternalizeStrings);
441
// added+= addAction(source, fFindNLSProblems);
446
* Method declared in ActionGroup
449
public void dispose() {
450
if (fRegisteredSelectionListeners != null) {
451
ISelectionProvider provider= fSite.getSelectionProvider();
452
for (Iterator<ISelectionChangedListener> iter= fRegisteredSelectionListeners.iterator(); iter.hasNext();) {
453
ISelectionChangedListener listener= iter.next();
454
provider.removeSelectionChangedListener(listener);
457
// if (fQuickAccessAction != null && fKeyBindingService != null) {
458
// fKeyBindingService.unregisterAction(fQuickAccessAction);
464
private void setGlobalActionHandlers(IActionBars actionBar) {
465
actionBar.setGlobalActionHandler(CdtActionConstants.ADD_INCLUDE, fAddInclude);
466
// actionBar.setGlobalActionHandler(CdtActionConstants.OVERRIDE_METHODS, fOverrideMethods);
467
actionBar.setGlobalActionHandler(CdtActionConstants.GETTERS_AND_SETTERS, fAddGetterSetter);
468
actionBar.setGlobalActionHandler(CdtActionConstants.IMPLEMENT_METHOD, fImplementMethod);
469
// actionBar.setGlobalActionHandler(CdtActionConstants.GENERATE_DELEGATE_METHODS, fAddDelegateMethods);
470
// actionBar.setGlobalActionHandler(CdtActionConstants.ADD_CONSTRUCTOR_FROM_SUPERCLASS, fAddUnimplementedConstructors);
471
// actionBar.setGlobalActionHandler(CdtActionConstants.GENERATE_CONSTRUCTOR_USING_FIELDS, fGenerateConstructorUsingFields);
472
// actionBar.setGlobalActionHandler(CdtActionConstants.GENERATE_HASHCODE_EQUALS, fHashCodeEquals);
473
// actionBar.setGlobalActionHandler(CdtActionConstants.ADD_CPP_DOC_COMMENT, fAddCppDocStub);
474
// actionBar.setGlobalActionHandler(CdtActionConstants.EXTERNALIZE_STRINGS, fExternalizeStrings);
475
// actionBar.setGlobalActionHandler(CdtActionConstants.CLEAN_UP, fCleanUp);
476
// actionBar.setGlobalActionHandler(CdtActionConstants.ORGANIZE_INCLUDES, fOrganizeIncludes);
477
// actionBar.setGlobalActionHandler(CdtActionConstants.SORT_MEMBERS, fSortMembers);
478
if (!isEditorOwner()) {
479
// editor provides its own implementation of these actions.
480
actionBar.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), fAddBookmark);
481
actionBar.setGlobalActionHandler(IDEActionFactory.ADD_TASK.getId(), fAddTaskAction);
482
// actionBar.setGlobalActionHandler(CdtActionConstants.FORMAT, fFormatAll);
484
// actionBar.setGlobalActionHandler(CopyQualifiedNameAction.ACTION_HANDLER_ID, fCopyQualifiedNameAction);
488
private int addAction(IMenuManager menu, IAction action) {
489
if (action instanceof IUpdate)
490
((IUpdate)action).update();
491
if (action != null && action.isEnabled()) {
498
private int addEditorAction(IMenuManager menu, String actionID) {
501
IAction action= fEditor.getAction(actionID);
504
if (action instanceof IUpdate)
505
((IUpdate)action).update();
506
if (action.isEnabled()) {
513
private boolean isEditorOwner() {
514
return fEditor != null;