KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > console > HyperlinkPosition


1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.internal.ui.views.console;
12
13
14 import org.eclipse.debug.internal.ui.DebugUIPlugin;
15 import org.eclipse.debug.ui.console.IConsoleHyperlink;
16 import org.eclipse.jface.text.Position;
17
18 /**
19  */

20 public class HyperlinkPosition extends Position {
21     
22     public static final String JavaDoc HYPER_LINK_CATEGORY = DebugUIPlugin.getUniqueIdentifier() + ".HYPER_LINK"; //$NON-NLS-1$
23

24     private IConsoleHyperlink fLink = null;
25
26     /**
27      *
28      */

29     public HyperlinkPosition(IConsoleHyperlink link, int offset, int length) {
30         super(offset, length);
31         fLink = link;
32     }
33     
34     public IConsoleHyperlink getHyperLink() {
35         return fLink;
36     }
37
38     /**
39      * @see java.lang.Object#equals(java.lang.Object)
40      */

41     public boolean equals(Object JavaDoc arg) {
42         return arg instanceof HyperlinkPosition && super.equals(arg) && getHyperLink().equals(((HyperlinkPosition)arg).getHyperLink());
43     }
44
45     /**
46      * @see java.lang.Object#hashCode()
47      */

48     public int hashCode() {
49         return super.hashCode() + getHyperLink().hashCode();
50     }
51
52 }
53
Popular Tags