KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > ui > model > ConfiguredSiteAdapter


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.update.internal.ui.model;
12
13 import org.eclipse.update.configuration.*;
14
15 /**
16  * @version 1.0
17  * @author
18  */

19 public class ConfiguredSiteAdapter
20     extends UIModelObject
21     implements IConfiguredSiteAdapter {
22     private IInstallConfiguration config;
23     private IConfiguredSite csite;
24         
25     public ConfiguredSiteAdapter(IInstallConfiguration config, IConfiguredSite csite) {
26         this.csite = csite;
27         this.config = config;
28     }
29     
30     public IConfiguredSite getConfiguredSite() {
31         return csite;
32     }
33
34     public IInstallConfiguration getInstallConfiguration() {
35         return config;
36     }
37     
38     public boolean equals(Object JavaDoc object) {
39         if (object==null) return false;
40         if (object == this) return true;
41         if (object instanceof ConfiguredSiteAdapter) {
42             ConfiguredSiteAdapter adapter = (ConfiguredSiteAdapter)object;
43             return csite!=null && csite.getSite().equals(adapter.getConfiguredSite().getSite());
44         }
45         return false;
46     }
47     
48     public String JavaDoc toString() {
49         return getConfiguredSite().getSite().getURL().toString();
50     }
51 }
52
Popular Tags