KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > runtime > registry > ExtensionAdapter


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.runtime.registry;
12
13 import org.eclipse.core.runtime.IConfigurationElement;
14 import org.eclipse.core.runtime.IExtension;
15
16 public class ExtensionAdapter extends ParentAdapter {
17
18     public ExtensionAdapter(Object JavaDoc object) {
19         super(object);
20     }
21
22     protected Object JavaDoc[] createChildren() {
23         IExtension extension = (IExtension) getObject();
24
25         IConfigurationElement[] elements = extension.getConfigurationElements();
26         Object JavaDoc[] result = new ConfigurationElementAdapter[elements.length];
27         for (int i = 0; i < elements.length; i++) {
28             IConfigurationElement config = elements[i];
29             result[i] = new ConfigurationElementAdapter(config);
30         }
31         return result;
32     }
33 }
34
Popular Tags