diff options
author | spingel | 2007-03-09 00:47:59 +0000 |
---|---|---|
committer | spingel | 2007-03-09 00:47:59 +0000 |
commit | 4ec4a17737892a0a94eea87bda1ff9d010f5f570 (patch) | |
tree | 9e05c381cb11ddae337796151bf2e6386db3398a /org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/WebHyperlink.java | |
parent | 38735c8b874412431fa963489903704323c925b4 (diff) | |
download | org.eclipse.mylyn.tasks-4ec4a17737892a0a94eea87bda1ff9d010f5f570.tar.gz org.eclipse.mylyn.tasks-4ec4a17737892a0a94eea87bda1ff9d010f5f570.tar.xz org.eclipse.mylyn.tasks-4ec4a17737892a0a94eea87bda1ff9d010f5f570.zip |
NEW - bug 176566: Hyperlinking support for Trac
https://bugs.eclipse.org/bugs/show_bug.cgi?id=176566
Diffstat (limited to 'org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/WebHyperlink.java')
-rw-r--r-- | org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/WebHyperlink.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/WebHyperlink.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/WebHyperlink.java new file mode 100644 index 000000000..e5ad6def1 --- /dev/null +++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/WebHyperlink.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2004 - 2006 University Of British Columbia and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * University Of British Columbia - initial API and implementation + *******************************************************************************/ +package org.eclipse.mylar.internal.trac.ui; + +import org.eclipse.jface.text.IRegion; +import org.eclipse.jface.text.hyperlink.IHyperlink; +import org.eclipse.mylar.tasks.ui.TasksUiUtil; + +/** + * @author Steffen Pingel + */ +public class WebHyperlink implements IHyperlink { + + private final IRegion region; + + private String url; + + public WebHyperlink(IRegion region, String url) { + this.region = region; + this.url = url; + } + + public IRegion getHyperlinkRegion() { + return region; + } + + public String getTypeLabel() { + return null; + } + + public String getHyperlinkText() { + return "Open URL " + url; + } + + public void open() { + TasksUiUtil.openBrowser(url); + } + + public String getURLString() { + return url; + } + +} |