diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:36:50 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 15:25:03 +0100 |
commit | 41ac47d732eed8392d60d0f6773e5a279d49b999 (patch) | |
tree | cf19d099db9cfdb8d73aa21c31e7aa1cc86ff860 /plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/editors/bitbake/RecipeEditorActionContributor.java | |
download | eclipse-poky-juno-41ac47d732eed8392d60d0f6773e5a279d49b999.tar.gz |
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/editors/bitbake/RecipeEditorActionContributor.java')
-rw-r--r-- | plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/editors/bitbake/RecipeEditorActionContributor.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/editors/bitbake/RecipeEditorActionContributor.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/editors/bitbake/RecipeEditorActionContributor.java new file mode 100644 index 0000000..f27951b --- /dev/null +++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/editors/bitbake/RecipeEditorActionContributor.java | |||
@@ -0,0 +1,47 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright (c) 2009 Ken Gilmer | ||
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 | ||
7 | * | ||
8 | * Contributors: | ||
9 | * Ken Gilmer - initial API and implementation | ||
10 | *******************************************************************************/ | ||
11 | package org.yocto.bc.ui.editors.bitbake; | ||
12 | |||
13 | import org.eclipse.jface.action.IMenuManager; | ||
14 | import org.eclipse.ui.IEditorPart; | ||
15 | import org.eclipse.ui.IWorkbenchActionConstants; | ||
16 | import org.eclipse.ui.editors.text.TextEditorActionContributor; | ||
17 | import org.eclipse.ui.texteditor.ITextEditor; | ||
18 | import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; | ||
19 | import org.eclipse.ui.texteditor.RetargetTextEditorAction; | ||
20 | |||
21 | public class RecipeEditorActionContributor extends TextEditorActionContributor { | ||
22 | |||
23 | private RetargetTextEditorAction fContentAssist; | ||
24 | |||
25 | public RecipeEditorActionContributor() { | ||
26 | fContentAssist= new RetargetTextEditorAction(RecipeEditorMessages.getBundle(), "contentAssist."); //$NON-NLS-1$ | ||
27 | fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); | ||
28 | } | ||
29 | |||
30 | @Override | ||
31 | public void contributeToMenu(IMenuManager menu) { | ||
32 | super.contributeToMenu(menu); | ||
33 | |||
34 | IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); | ||
35 | if (editMenu != null) { | ||
36 | editMenu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fContentAssist); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | @Override | ||
41 | public void setActiveEditor(IEditorPart part) { | ||
42 | super.setActiveEditor(part); | ||
43 | if (part instanceof ITextEditor) { | ||
44 | fContentAssist.setAction(getAction((ITextEditor) part, BitBakeFileEditor.CONTENT_ASSIST)); | ||
45 | } | ||
46 | } | ||
47 | } | ||