KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > editor > AntElementHyperlink


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 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 package org.eclipse.ant.internal.ui.editor;
12
13 import org.eclipse.jface.text.IRegion;
14 import org.eclipse.jface.text.hyperlink.IHyperlink;
15
16 public class AntElementHyperlink implements IHyperlink {
17
18     private IRegion fRegion= null;
19     private Object JavaDoc fLinkTarget= null;
20     private AntEditor fEditor= null;
21     
22     public AntElementHyperlink(AntEditor editor, IRegion region, Object JavaDoc linkTarget) {
23         
24        fRegion= region;
25        fLinkTarget= linkTarget;
26        fEditor= editor;
27     }
28
29     /* (non-Javadoc)
30      * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
31      */

32     public IRegion getHyperlinkRegion() {
33         return fRegion;
34     }
35
36     /* (non-Javadoc)
37      * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
38      */

39     public String JavaDoc getTypeLabel() {
40         return null;
41     }
42
43     /* (non-Javadoc)
44      * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
45      */

46     public String JavaDoc getHyperlinkText() {
47         return null;
48     }
49
50     /* (non-Javadoc)
51      * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
52      */

53     public void open() {
54         fEditor.openTarget(fLinkTarget);
55     }
56 }
57
Popular Tags