public DesignerView(final AlphaForm form,
			final ApplicationController controller) {
		super(controller);
		this.model = form;

		this.setLayout(new BorderLayout());

		final JSplitPane jsp1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
		final JSplitPane jsp2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
		jsp1.setBorder(null);
		jsp2.setBorder(null);

		final Component parentComponent = this;
		final JToolBar toolbar = new JToolBar();
		toolbar.setFloatable(false);
		final JButton button1 = new JButton("Save");

		button1.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(final ActionEvent arg0) {
				controller.persistForm();
			}

		});
		final JButton button2 = new JButton("Go to Fill-in mode");
		button2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(final ActionEvent ev) {
				final SwitchViewSignal s = new SwitchViewSignal();
				s.setFromView(SwitchViewSignal.DESIGNER);
				s.setToView(SwitchViewSignal.VIEWER);
				SignalManager.getInstance().sendSignal(s, "designer");
			}
		});
		toolbar.add(button1);
		toolbar.add(button2);
		toolbar.addSeparator();

		final JButton btnStoreTemplates = new JButton("Export Templates");
		btnStoreTemplates.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(final ActionEvent ev) {
				final JFileChooser fc = new JFileChooser();
				fc.setMultiSelectionEnabled(false);
				fc.setFileFilter(new TemplateFileFilter());
				final int ret = fc.showSaveDialog(parentComponent);
				if (ret == JFileChooser.APPROVE_OPTION) {
					final File f = fc.getSelectedFile();
					try {
						final FileOutputStream fout = new FileOutputStream(f);
						WidgetTemplateMngr.getInstance().storeTemplates(fout);
						fout.close();
					} catch (final FileNotFoundException e) {
						e.printStackTrace();
					} catch (final IOException e) {
						e.printStackTrace();
					}
				}
			}
		});
		final JButton btnLoadTemplates = new JButton("Import Templates");
		btnLoadTemplates.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(final ActionEvent ev) {
				int ret = JOptionPane
						.showConfirmDialog(
								parentComponent,
								"This will replace all current templates in the template library. Continue?",
								"Replace templates?",
								JOptionPane.YES_NO_OPTION,
								JOptionPane.QUESTION_MESSAGE);
				if (ret == JOptionPane.YES_OPTION) {
					final JFileChooser fc = new JFileChooser();
					fc.setMultiSelectionEnabled(false);
					fc.setFileFilter(new TemplateFileFilter());
					ret = fc.showOpenDialog(parentComponent);
					if (ret == JFileChooser.APPROVE_OPTION) {
						final File f = fc.getSelectedFile();
						try {
							final FileInputStream fin = new FileInputStream(f);
							WidgetTemplateMngr.getInstance().loadTemplates(fin);
							fin.close();
						} catch (final FileNotFoundException e) {
							e.printStackTrace();
						} catch (final IOException e) {
							e.printStackTrace();
						}
					}
				}
			}
		});

		toolbar.add(btnStoreTemplates);
		toolbar.add(btnLoadTemplates);

		final JToolBar status = new JToolBar();
		status.setFloatable(false);
		this.statusLabel = new JLabel("Selected: None.");
		status.addSeparator();
		status.add(this.statusLabel);

		final WidgetPalette widgetPalette = new WidgetPalette();
		widgetPalette.setMinimumSize(new Dimension(220, 300));
		widgetPalette.registerWidgetClass(TextField.class);
		widgetPalette.registerWidgetClass(AlphaList.class);
		widgetPalette.registerWidgetClass(Option.class);
		widgetPalette.registerWidgetClass(Group.class);
		widgetPalette.registerWidgetClass(Button.class);
		widgetPalette.registerWidgetClass(Heading.class);

		this.templatePalette = new TemplatePalette();
		this.templatePalette.setMinimumSize(new Dimension(220, 300));

		final JTabbedPane tabPane = new JTabbedPane();
		tabPane.addTab("Widgets", widgetPalette);
		tabPane.addTab("Widget Templates", this.templatePalette);

		final PropertyEditorPanel propertyPanel = new PropertyEditorPanel(
				this.model);
		propertyPanel.setMinimumSize(new Dimension(220, 300));

		this.formPanel = new FormDesignerPanel(this.model);

		// jsp1.setLeftComponent(widgetPalette);
		jsp1.setLeftComponent(tabPane);
		jsp1.setRightComponent(jsp2);
		jsp2.setLeftComponent(this.formPanel);
		jsp2.setRightComponent(propertyPanel);

		this.add(toolbar, BorderLayout.NORTH);
		this.add(status, BorderLayout.SOUTH);
		this.add(jsp1, BorderLayout.CENTER);

		SignalManager.getInstance().subscribeSink(this, "formCanvas");

		final ComponentDragDrop dndListener = new ComponentDragDrop();
		// TemplateDragDrop dndTemplate = new TemplateDragDrop();
		final DragSource dragSource1 = new DragSource();
		final DragSource dragSource2 = new DragSource();
		final DropTarget dropTarget1 = new DropTarget(
				this.formPanel.getDropTargetComponent(),
				DnDConstants.ACTION_COPY, dndListener);
		// DropTarget dropTarget2 = new
		// DropTarget(formPanel.getDropTargetComponent(),
		// DnDConstants.ACTION_COPY, dndTemplate);
		final DragGestureRecognizer dndrec1 = dragSource1
				.createDefaultDragGestureRecognizer(
						widgetPalette.getDragSource(),
						DnDConstants.ACTION_COPY, dndListener);
		final DragGestureRecognizer dndrec2 = dragSource2
				.createDefaultDragGestureRecognizer(
						this.templatePalette.getDragSource(),
						DnDConstants.ACTION_COPY, dndListener);

	}