if (o instanceof Item)
{
item = (Item) o;
addToolBoxItem(new ToolBoxItem(item.getDisplayText(), ItemIconMgr.getInstance().getIcon(item, FlexibleSize.MEDIUM), item
.getDescriptionText(), new BasicTransferable(item)));
refreshContent();
}
}
catch (UnsupportedFlavorException e)
{
}
catch (IOException e)
{
}
}
if (flavors[i].equals(ModelerFlavors.COLOR))
{
try
{
Color c = (Color) data.getTransferData(ModelerFlavors.COLOR);
ResourceCollection res = getPluginResourceCollection();
StringBuffer description = new StringBuffer();
description.append(res.getOptionalString("color.red"));
description.append(' ');
description.append(c.getRed());
description.append('\n');
description.append(res.getOptionalString("color.green"));
description.append(' ');
description.append(c.getGreen());
description.append('\n');
description.append(res.getOptionalString("color.blue"));
description.append(' ');
description.append(c.getBlue());
addToolBoxItem(new ToolBoxItem(res.getOptionalString("color.title"), ColorChooserPlugin.createColorDragIcon(c).getIcon(
FlexibleSize.MEDIUM), description.toString(), new BasicTransferable(c)));
refreshContent();
}
catch (UnsupportedFlavorException e)
{
}