KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > javaeditor > GotoMatchingBracketAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.internal.ui.javaeditor;
13
14 import org.eclipse.core.runtime.Assert;
15
16 import org.eclipse.jface.action.Action;
17
18 import org.eclipse.ui.PlatformUI;
19
20 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
21
22
23 public class GotoMatchingBracketAction extends Action {
24
25     public final static String JavaDoc GOTO_MATCHING_BRACKET= "GotoMatchingBracket"; //$NON-NLS-1$
26

27     private final JavaEditor fEditor;
28
29     public GotoMatchingBracketAction(JavaEditor editor) {
30         super(JavaEditorMessages.GotoMatchingBracket_label);
31         Assert.isNotNull(editor);
32         fEditor= editor;
33         setEnabled(true);
34         PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.GOTO_MATCHING_BRACKET_ACTION);
35     }
36
37     public void run() {
38         fEditor.gotoMatchingBracket();
39     }
40 }
41
Popular Tags