KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 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 java.util.Vector JavaDoc;
14
15 import org.eclipse.core.runtime.IConfigurationElement;
16 import org.eclipse.ui.views.properties.*;
17
18 public class ConfigurationElementPropertySource extends RegistryPropertySource {
19     private IConfigurationElement config;
20
21 public ConfigurationElementPropertySource(IConfigurationElement config) {
22     this.config = config;
23 }
24 public IPropertyDescriptor[] getPropertyDescriptors() {
25     Vector JavaDoc result = new Vector JavaDoc();
26
27     String JavaDoc [] atts = config.getAttributeNames();
28     for (int i=0; i<atts.length; i++) {
29        result.addElement(new PropertyDescriptor(atts[i], atts[i]));
30     }
31     return toDescriptorArray(result);
32 }
33 public Object JavaDoc getPropertyValue(Object JavaDoc name) {
34     return config.getAttribute(name.toString());
35 }
36 }
37
Popular Tags