/**
  * Constructs a tree item for generic ("Advanced") component blocks for component types that
  * appear in form.
  *
  * @param form only component types that appear in this Form will be included
  * @return tree item for this form
  */
 public TreeItem getGenericComponentsTree(MockForm form) {
   Map<String, String> typesAndIcons = Maps.newHashMap();
   form.collectTypesAndIcons(typesAndIcons);
   TreeItem advanced = new TreeItem(new HTML("<span>" + MESSAGES.anyComponentLabel() + "</span>"));
   List<String> typeList = new ArrayList<String>(typesAndIcons.keySet());
   Collections.sort(typeList);
   for (final String typeName : typeList) {
     TreeItem itemNode =
         new TreeItem(
             new HTML(
                 "<span>"
                     + typesAndIcons.get(typeName)
                     + MESSAGES.textAnyComponentLabel()
                     + TranslationDesignerPallete.getCorrespondingString(typeName)
                     + "</span>"));
     SourceStructureExplorerItem sourceItem =
         new BlockSelectorItem() {
           @Override
           public void onSelected() {
             fireGenericDrawerSelected(typeName);
           }
         };
     itemNode.setUserObject(sourceItem);
     advanced.addItem(itemNode);
   }
   return advanced;
 }
  @Override
  public void onDrop(DragSource source, int x, int y, int offsetX, int offsetY) {
    MockComponent sourceComponent = ((SimplePaletteItem) source).createMockComponent();

    // Add component to the form
    form.addComponent(sourceComponent);

    // Add component to this panel
    addComponent(sourceComponent);
    sourceComponent.select();
  }