~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to results/plugins/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorTogglePresentationAction.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
7
 
 *
8
 
 * Contributors:
9
 
 *     QNX Software Systems - Initial API and implementation
10
 
 *******************************************************************************/
11
 
package org.eclipse.cdt.make.internal.ui.editor;
12
 
 
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;
17
 
 
18
 
/**
19
 
 */
20
 
public class MakefileEditorTogglePresentationAction extends TextEditorAction {
21
 
 
22
 
        /**
23
 
         * Constructor for MakefileEditorTogglePresentationAction.
24
 
         */
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);
28
 
                update();
29
 
        }
30
 
 
31
 
        /**
32
 
         * @see org.eclipse.jface.action.IAction#run()
33
 
         */
34
 
        public void run() {
35
 
                ITextEditor editor= getTextEditor();
36
 
                editor.resetHighlightRange();
37
 
                boolean show = editor.showsHighlightRangeOnly();
38
 
                setChecked(!show);
39
 
                editor.showHighlightRangeOnly(!show);
40
 
        }
41
 
 
42
 
        /**
43
 
         * @see org.eclipse.ui.texteditor.IUpdate#update()
44
 
         */
45
 
        public void update() {
46
 
                setChecked(getTextEditor() != null && getTextEditor().showsHighlightRangeOnly());
47
 
                setEnabled(true);
48
 
        }
49
 
 
50
 
}