KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > wizards > templates > PluginReference


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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
12 package org.eclipse.pde.internal.ui.wizards.templates;
13
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.pde.core.plugin.IPluginReference;
16
17 public class PluginReference implements IPluginReference {
18     private int match = NONE;
19     private String JavaDoc version;
20     private String JavaDoc id;
21
22     /**
23      * Constructor for PluginReference.
24      */

25     public PluginReference() {
26         super();
27     }
28     
29     public boolean equals(Object JavaDoc object) {
30         if (object instanceof IPluginReference) {
31             IPluginReference source = (IPluginReference)object;
32             if (id==null) return false;
33             if (id.equals(source.getId())==false) return false;
34             if (version==null && source.getVersion()==null) return true;
35             return version.equals(source.getVersion());
36         }
37         return false;
38     }
39     
40     public PluginReference(String JavaDoc id, String JavaDoc version, int match) {
41         this.id = id;
42         this.version = version;
43         this.match = match;
44     }
45
46     /*
47      * @see IPluginReference#getMatch()
48      */

49     public int getMatch() {
50         return match;
51     }
52
53     /*
54      * @see IPluginReference#getVersion()
55      */

56     public String JavaDoc getVersion() {
57         return version;
58     }
59
60     /*
61      * @see IPluginReference#setMatch(int)
62      */

63     public void setMatch(int match) throws CoreException {
64         this.match = match;
65     }
66
67     /*
68      * @see IPluginReference#setVersion(String)
69      */

70     public void setVersion(String JavaDoc version) throws CoreException {
71         this.version = version;
72     }
73
74     /*
75      * @see IIdentifiable#getId()
76      */

77     public String JavaDoc getId() {
78         return id;
79     }
80
81     /*
82      * @see IIdentifiable#setId(String)
83      */

84     public void setId(String JavaDoc id) throws CoreException {
85         this.id = id;
86     }
87
88 }
89
Popular Tags