1 11 package org.eclipse.pde.internal.ui.wizards; 12 13 import java.util.StringTokenizer ; 14 15 import org.eclipse.core.runtime.IConfigurationElement; 16 17 public class Category { 18 private IConfigurationElement config; 19 private String [] parentCategoryPath; 20 public static final String ATT_ID="id"; public static final String ATT_CATEGORY="parentCategory"; public static final String ATT_NAME="name"; 24 public Category(IConfigurationElement aConfig) { 25 config = aConfig; 26 } 27 public String getID() { 28 return config.getAttribute(ATT_ID); 29 } 30 public String getLabel() { 31 return config.getAttribute(ATT_NAME); 32 } 33 public String [] getParentCategoryPath() { 34 if (parentCategoryPath!=null) return parentCategoryPath; 35 String category = config.getAttribute(ATT_CATEGORY); 36 if (category==null) return null; 37 StringTokenizer stok = new StringTokenizer (category, "/"); parentCategoryPath = new String [stok.countTokens()]; 39 for (int i=0; stok.hasMoreTokens(); i++) { 40 parentCategoryPath[i]=stok.nextToken(); 41 } 42 return parentCategoryPath; 43 44 45 } 46 } 47 | Popular Tags |