]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/jdt-before/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementHyperlinkImplementationDetector.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / ui / org / eclipse / jdt / internal / ui / javaeditor / JavaElementHyperlinkImplementationDetector.java
CommitLineData
1b2798f6
EK
1/*******************************************************************************
2 * Copyright (c) 2010, 2011 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 *******************************************************************************/
11package org.eclipse.jdt.internal.ui.javaeditor;
12
13import java.util.List;
14
15import org.eclipse.jface.text.IRegion;
16import org.eclipse.jface.text.hyperlink.IHyperlink;
17
18import org.eclipse.jdt.core.IJavaElement;
19import org.eclipse.jdt.core.IMethod;
20
21import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
22
23import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
24
25
26/**
27 * Java element implementation hyperlink detector for methods.
28 *
29 * @since 3.5
30 */
31public class JavaElementHyperlinkImplementationDetector extends JavaElementHyperlinkDetector {
32
33 /*
34 * @see org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlinkDetector#createHyperlink(org.eclipse.jface.text.IRegion, org.eclipse.jdt.ui.actions.SelectionDispatchAction, org.eclipse.jdt.core.IJavaElement, boolean, org.eclipse.ui.texteditor.ITextEditor)
35 * @since 3.5
36 */
37 @Override
38 protected void addHyperlinks(List<IHyperlink> hyperlinksCollector, IRegion wordRegion, SelectionDispatchAction openAction, IJavaElement element, boolean qualify, JavaEditor editor) {
39 if (element.getElementType() == IJavaElement.METHOD && SelectionConverter.canOperateOn(editor)) {
40 hyperlinksCollector.add(new JavaElementImplementationHyperlink(wordRegion, openAction, (IMethod)element, qualify, editor));
41 }
42 }
43}