KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > registry > RegistryObjectFactory


1 /*******************************************************************************
2  * Copyright (c) 2005, 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.core.internal.registry;
12
13 /**
14  * A factory method for the creation of the registry objects.
15  */

16 public class RegistryObjectFactory {
17
18     // The extension registry that this element factory works in
19
protected ExtensionRegistry registry;
20
21     public RegistryObjectFactory(ExtensionRegistry registry) {
22         this.registry = registry;
23     }
24
25     ////////////////////////////////////////////////////////////////////////////
26
// Contribution
27
public Contribution createContribution(String JavaDoc contributorId, boolean persist) {
28         return new Contribution(contributorId, registry, persist);
29     }
30
31     ////////////////////////////////////////////////////////////////////////////
32
// Extension point
33
public ExtensionPoint createExtensionPoint(boolean persist) {
34         return new ExtensionPoint(registry, persist);
35     }
36
37     public ExtensionPoint createExtensionPoint(int self, int[] children, int dataOffset, boolean persist) {
38         return new ExtensionPoint(self, children, dataOffset, registry, persist);
39     }
40
41     ////////////////////////////////////////////////////////////////////////////
42
// Extension
43
public Extension createExtension(boolean persist) {
44         return new Extension(registry, persist);
45     }
46
47     public Extension createExtension(int self, String JavaDoc simpleId, String JavaDoc namespace, int[] children, int extraData, boolean persist) {
48         return new Extension(self, simpleId, namespace, children, extraData, registry, persist);
49     }
50
51     ////////////////////////////////////////////////////////////////////////////
52
// Configuration element
53
public ConfigurationElement createConfigurationElement(boolean persist) {
54         return new ConfigurationElement(registry, persist);
55     }
56
57     public ConfigurationElement createConfigurationElement(int self, String JavaDoc contributorId, String JavaDoc name, String JavaDoc[] propertiesAndValue, int[] children, int extraDataOffset, int parent, byte parentType, boolean persist) {
58         return new ConfigurationElement(self, contributorId, name, propertiesAndValue, children, extraDataOffset, parent, parentType, registry, persist);
59     }
60 }
61
Popular Tags