KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > site > SiteModelFactory


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 package org.eclipse.pde.internal.core.site;
12
13 import org.eclipse.pde.internal.core.isite.ISite;
14 import org.eclipse.pde.internal.core.isite.ISiteArchive;
15 import org.eclipse.pde.internal.core.isite.ISiteCategory;
16 import org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition;
17 import org.eclipse.pde.internal.core.isite.ISiteDescription;
18 import org.eclipse.pde.internal.core.isite.ISiteFeature;
19 import org.eclipse.pde.internal.core.isite.ISiteModel;
20 import org.eclipse.pde.internal.core.isite.ISiteModelFactory;
21 import org.eclipse.pde.internal.core.isite.ISiteObject;
22
23 public class SiteModelFactory implements ISiteModelFactory {
24     private ISiteModel model;
25     public SiteModelFactory(ISiteModel model) {
26         this.model = model;
27     }
28
29     /**
30      * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createSite()
31      */

32     public ISite createSite() {
33         Site site = new Site();
34         site.model = model;
35         site.parent = null;
36         return site;
37     }
38
39     /**
40      * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createFeature()
41      */

42     public ISiteFeature createFeature() {
43         SiteFeature feature = new SiteFeature();
44         feature.model = model;
45         feature.parent = model.getSite();
46         return feature;
47     }
48
49     /**
50      * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createCategory()
51      */

52     public ISiteCategory createCategory(ISiteFeature feature) {
53         SiteCategory category = new SiteCategory();
54         category.model = model;
55         category.parent = feature;
56         return category;
57     }
58
59     /**
60      * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createCategoryDefinition()
61      */

62     public ISiteCategoryDefinition createCategoryDefinition() {
63         SiteCategoryDefinition def = new SiteCategoryDefinition();
64         def.model = model;
65         def.parent = model.getSite();
66         return def;
67     }
68
69     /**
70      * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createDescription()
71      */

72     public ISiteDescription createDescription(ISiteObject parent) {
73         SiteDescription desc = new SiteDescription();
74         desc.model = model;
75         desc.parent = parent;
76         return desc;
77     }
78
79     /**
80      * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createArchive()
81      */

82     public ISiteArchive createArchive() {
83         SiteArchive archive = new SiteArchive();
84         archive.model = model;
85         archive.parent = model.getSite();
86         return archive;
87     }
88
89 }
90
Popular Tags