KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > core > BaseSiteLocalFactory


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.update.internal.core;
12 import org.eclipse.update.core.model.*;
13 import org.eclipse.update.internal.model.*;
14 /**
15  *
16  */

17 public class BaseSiteLocalFactory {
18     /*
19      *
20      */

21     public InstallConfigurationModel createInstallConfigurationModel() {
22         return new InstallConfiguration();
23     }
24     /*
25      *
26      */

27     public ConfigurationActivityModel createConfigurationActivityModel() {
28         return new ConfigurationActivity();
29     }
30     /*
31      *
32      */

33     public ConfiguredSiteModel createConfigurationSiteModel() {
34         return new ConfiguredSite();
35     }
36     /*
37      *
38      */

39     public ConfigurationPolicyModel createConfigurationPolicyModel() {
40         return new ConfigurationPolicy();
41     }
42     /**
43      *
44      */

45     public ConfiguredSiteModel createConfigurationSiteModel(SiteModel site, int policy) {
46         //create config site
47
ConfiguredSiteModel configSite = this.createConfigurationSiteModel();
48         configSite.setSiteModel(site);
49         ConfigurationPolicyModel policyModel = this.createConfigurationPolicyModel();
50         policyModel.setPolicy(policy);
51         configSite.setConfigurationPolicyModel(policyModel);
52         ((ConfigurationPolicy) policyModel).setConfiguredSiteModel(configSite);
53         return configSite;
54     }
55 }
56
Popular Tags