01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.console;
11:
12: import org.eclipse.jface.text.Position;
13: import org.eclipse.ui.console.ConsolePlugin;
14: import org.eclipse.ui.console.IHyperlink;
15:
16: /**
17: * Describes the postition of a hyperlink within the Console's document.
18: *
19: * @since 3.1
20: */
21: public class ConsoleHyperlinkPosition extends Position {
22:
23: public static final String HYPER_LINK_CATEGORY = ConsolePlugin
24: .getUniqueIdentifier()
25: + ".CONSOLE_HYPERLINK_POSITION"; //$NON-NLS-1$
26:
27: private IHyperlink fLink = null;
28:
29: public ConsoleHyperlinkPosition(IHyperlink link, int offset,
30: int length) {
31: super (offset, length);
32: fLink = link;
33: }
34:
35: public IHyperlink getHyperLink() {
36: return fLink;
37: }
38:
39: /**
40: * @see java.lang.Object#equals(java.lang.Object)
41: */
42: public boolean equals(Object arg) {
43: return arg instanceof ConsoleHyperlinkPosition
44: && super .equals(arg)
45: && getHyperLink()
46: .equals(
47: ((ConsoleHyperlinkPosition) arg)
48: .getHyperLink());
49: }
50:
51: /**
52: * @see java.lang.Object#hashCode()
53: */
54: public int hashCode() {
55: return super.hashCode() + getHyperLink().hashCode();
56: }
57:
58: }
|