Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2003-09-07 19:44:27 +0000
committerAlain Magloire2003-09-07 19:44:27 +0000
commit11fbc47cb25c5a1a0974174aecd5b822e71c6246 (patch)
tree1a3b7d9389ea293dc52c865a43c4bd2755167c36 /build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java
parent91470138363766275dccba150a3ff338643d5291 (diff)
downloadorg.eclipse.cdt-11fbc47cb25c5a1a0974174aecd5b822e71c6246.tar.gz
org.eclipse.cdt-11fbc47cb25c5a1a0974174aecd5b822e71c6246.tar.xz
org.eclipse.cdt-11fbc47cb25c5a1a0974174aecd5b822e71c6246.zip
Rename to Makefile*.java instead of Make*.java
Files are for managing Makefile related things.
Diffstat (limited to 'build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java')
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java61
1 files changed, 61 insertions, 0 deletions
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java
new file mode 100644
index 00000000000..9577ac6f845
--- /dev/null
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java
@@ -0,0 +1,61 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.make.internal.ui.editor;
+
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.texteditor.BasicTextEditorActionContributor;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ */
+public class MakefileEditorActionContributor extends BasicTextEditorActionContributor {
+ private MakefileEditorTogglePresentationAction togglePresentationAction;
+ private static final String TOGGLE_PRESENTATION = "makefile_toggle_presentation"; //$NON-NLS-1$
+
+ /**
+ * Constructor for MakefileEditorActionContributor.
+ */
+ public MakefileEditorActionContributor() {
+ super();
+ togglePresentationAction = new MakefileEditorTogglePresentationAction();
+ }
+
+ /**
+ * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(IEditorPart)
+ */
+ public void setActiveEditor(IEditorPart targetEditor) {
+ super.setActiveEditor(targetEditor);
+ ITextEditor textEditor = null;
+ if (targetEditor instanceof ITextEditor)
+ textEditor = (ITextEditor) targetEditor;
+
+ togglePresentationAction.setEditor(textEditor);
+ }
+
+ /**
+ * @see org.eclipse.ui.part.EditorActionBarContributor#init(IActionBars)
+ */
+ public void init(IActionBars bars) {
+ super.init(bars);
+ bars.setGlobalActionHandler(TOGGLE_PRESENTATION, togglePresentationAction);
+ }
+
+ /**
+ * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(IToolBarManager)
+ */
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ super.contributeToToolBar(toolBarManager);
+ toolBarManager.add(togglePresentationAction);
+ }
+
+}

Back to the top