1
/*******************************************************************************
2
* Copyright (c) 2006 Red Hat Inc. 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
* Kyu Lee <klee@redhat.com> - initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.linuxtools.internal.changelog.core.editors;
13
import org.eclipse.core.resources.IFile;
14
import org.eclipse.jface.text.IRegion;
15
import org.eclipse.jface.text.hyperlink.IHyperlink;
16
import org.eclipse.ui.IWorkbench;
17
import org.eclipse.ui.PartInitException;
18
import org.eclipse.ui.PlatformUI;
21
* Hyperlink that opens up editor for a file.
23
* @author klee (Kyu Lee)
26
public class FileHyperlink implements IHyperlink {
28
private IFile fileLoc;
30
private IRegion region;
32
public FileHyperlink(IRegion regionIn, IFile fileIn) {
37
public IRegion getHyperlinkRegion() {
41
public String getTypeLabel() {
42
// TODO Auto-generated method stub
46
public String getHyperlinkText() {
47
// TODO Auto-generated method stub
52
* Opens the hyperlink in new editor window.
55
IWorkbench ws = PlatformUI.getWorkbench();
59
org.eclipse.ui.ide.IDE.openEditor(ws.getActiveWorkbenchWindow()
60
.getActivePage(), fileLoc, true);
61
} catch (PartInitException e) {