@Override
	public void drop(final DropTargetDropEvent ev) {
		ev.acceptDrop(ev.getDropAction());
		try {
			final Object source = ev.getTransferable().getTransferData(
					ComponentDragDrop.supportedFlavors[0]);
			FormWidget cmp = null;
			final FormCanvas canvas = (FormCanvas) ev.getDropTargetContext()
					.getComponent();
			final FormDesignerPanel container = canvas.getParentPanel();
			final Point loc = new Point(ev.getLocation().x + this.offset.x,
					ev.getLocation().y + this.offset.y);
			if (this.object instanceof WidgetTemplate) {
				cmp = ((WidgetTemplate) this.object).createWidgetFromTemplate();
				cmp.setName(WidgetNameGenerator
						.getName((WidgetTemplate) this.object));
			} else {
				final FormWidget component = (FormWidget) source;
				try {
					final Constructor<? extends FormWidget> c = component
							.getClass().getConstructor(String.class);
					cmp = c.newInstance(WidgetNameGenerator.getName(component));
				} catch (final SecurityException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (final NoSuchMethodException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (final IllegalArgumentException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (final InvocationTargetException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (final InstantiationException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (final IllegalAccessException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

			}
			container.addWidget(cmp, loc);
			container.repaint();
		} catch (final Exception ex) {
			ex.printStackTrace();
		}
		ev.dropComplete(true);
	}