KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > console > ConsoleHyperlinkPosition


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.ui.internal.console;
12
13 import org.eclipse.jface.text.Position;
14 import org.eclipse.ui.console.ConsolePlugin;
15 import org.eclipse.ui.console.IHyperlink;
16
17 /**
18  * Describes the postition of a hyperlink within the Console's document.
19  *
20  * @since 3.1
21  */

22 public class ConsoleHyperlinkPosition extends Position {
23     
24     public static final String JavaDoc HYPER_LINK_CATEGORY = ConsolePlugin.getUniqueIdentifier() + ".CONSOLE_HYPERLINK_POSITION"; //$NON-NLS-1$
25

26     private IHyperlink fLink = null;
27
28     public ConsoleHyperlinkPosition(IHyperlink link, int offset, int length) {
29         super(offset, length);
30         fLink = link;
31     }
32     
33     public IHyperlink getHyperLink() {
34         return fLink;
35     }
36
37     /**
38      * @see java.lang.Object#equals(java.lang.Object)
39      */

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

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