@Override
  public void execute(Object p) {
    if (p instanceof ComponentPanel && !(p instanceof ComponentTypePanel)) {

      ComponentPanel panel = (ComponentPanel) p;
      ContainerNode node = (ContainerNode) kernel.getUifactory().getMapping().get(nodepanel);
      ComponentInstance type = (ComponentInstance) kernel.getUifactory().getMapping().get(p);

      if (!node.getComponents().contains(type)) {
        panel.getParent().remove(panel);
        nodepanel.add(panel);
        node.addComponents(type);
      }

      kernel.getModelHandler().notifyChanged();
    }
  }
Example #2
0
 private String[] getWebServerName(ContainerRoot model) {
   for (ContainerNode node : model.getNodes()) {
     for (ComponentInstance component : node.getComponents()) {
       //				for (TypeDefinition typeDefinition :
       // component.getTypeDefinition().getSuperTypesForJ()) {
       org.kevoree.log.Log.debug(component.getTypeDefinition().getName());
       if ("SprayWebServer"
           .equals(
               component
                   .getTypeDefinition()
                   .getName())) { // must be change if the webserver implementation is changed
         return new String[] {component.getName(), node.getName()};
       }
       //				}
     }
   }
   return null;
 }