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.pde.internal.ui.tests.macro;
11:
12: import org.eclipse.core.runtime.IPath;
13:
14: public class WidgetIdentifier {
15: public IPath contextPath;
16: public IPath widgetPath;
17:
18: public WidgetIdentifier(IPath contextPath, IPath widgetPath) {
19: this .contextPath = contextPath;
20: this .widgetPath = widgetPath;
21: }
22:
23: public String getContextId() {
24: return contextPath.toString();
25: }
26:
27: public String getWidgetId() {
28: return widgetPath.toString();
29: }
30:
31: public IPath getFullyQualifiedPath() {
32: return contextPath.append(widgetPath);
33: }
34:
35: public String getFullyQualifiedId() {
36: return getFullyQualifiedPath().toString();
37: }
38:
39: public boolean equals(Object obj) {
40: if (obj == null)
41: return false;
42: if (obj == this )
43: return true;
44: if (obj instanceof WidgetIdentifier) {
45: WidgetIdentifier wid = (WidgetIdentifier) obj;
46: return wid.contextPath.equals(contextPath)
47: && wid.widgetPath.equals(widgetPath);
48: }
49: return false;
50: }
51: }
|