1
/*******************************************************************************
2
* Copyright (c) 2000, 2006 QNX Software Systems 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
* QNX Software Systems - Initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.cdt.make.internal.ui.editor;
13
import org.eclipse.cdt.make.internal.ui.MakeUIImages;
14
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
15
import org.eclipse.ui.texteditor.ITextEditor;
16
import org.eclipse.ui.texteditor.TextEditorAction;
20
public class MakefileEditorTogglePresentationAction extends TextEditorAction {
23
* Constructor for MakefileEditorTogglePresentationAction.
25
public MakefileEditorTogglePresentationAction() {
26
super(MakeUIPlugin.getDefault().getResourceBundle(), "TogglePresentation.", null); //$NON-NLS-1$
27
MakeUIImages.setImageDescriptors(this, MakeUIImages.T_TOOL, MakeUIImages.IMG_TOOLS_MAKEFILE_SEGMENT_EDIT);
32
* @see org.eclipse.jface.action.IAction#run()
35
ITextEditor editor= getTextEditor();
36
editor.resetHighlightRange();
37
boolean show = editor.showsHighlightRangeOnly();
39
editor.showHighlightRangeOnly(!show);
43
* @see org.eclipse.ui.texteditor.IUpdate#update()
45
public void update() {
46
setChecked(getTextEditor() != null && getTextEditor().showsHighlightRangeOnly());