Exemplo n.º 1
0
 private void init() {
   IConfigurationElement[] elements =
       Platform.getExtensionRegistry()
           .getConfigurationElementsFor("org.eclipse.php.server.core.serverType"); // $NON-NLS-1$
   IServerType genericType = null;
   List<IServerType> result = new ArrayList<IServerType>();
   for (IConfigurationElement element : elements) {
     IServerType type = null;
     if ("type".equals(element.getName())) { // $NON-NLS-1$
       type = ServerType.create(element);
     }
     if (type != null) {
       if (type.getId().equals(ServerType.GENERIC_PHP_SERVER_ID)) {
         genericType = type;
       } else {
         result.add(type);
       }
     }
   }
   types = new LinkedHashMap<String, IServerType>();
   for (IServerType type : result) {
     types.put(type.getId(), type);
   }
   // Generic type always at the end
   if (genericType != null) {
     types.put(genericType.getId(), genericType);
   }
 }
 public final String getId() {
   return type.getId();
 }