@Override
	public void actionPerformed(ActionEvent e) {
		Object source = e.getSource();
		if (source == btnOpenTemplate) {
			JFileChooser fc = new JFileChooser();
			FileNameExtensionFilter filter = new FileNameExtensionFilter(Strings.ACTION_OPEN_TEMPLATE, "odt");
			fc.setFileFilter(filter);
			int result = fc.showOpenDialog(frame.getContentPane());
			if (result == JFileChooser.APPROVE_OPTION) {
				try {
					docProcessor.setFile(fc.getSelectedFile());
					//String content = this.docProcessor.getText();
					String content = docProcessor.getHtml();
					previewPane.setText(content);
					previewScrollPane.scrollRectToVisible(new Rectangle());
					initTabs();
				} catch (JDOMException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				} catch (IOException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
			}
		}
		else if (source == btnSaveDocument) {
			JFileChooser fc = new JFileChooser();
			FileNameExtensionFilter filter = new FileNameExtensionFilter(Strings.ACTION_SAVE_REPORT, "odt");
			fc.setFileFilter(filter);
			int result = fc.showSaveDialog(frame.getContentPane());
			if (result == JFileChooser.APPROVE_OPTION) {
				File file = fc.getSelectedFile();
				try {
					docProcessor.saveToFile(file);
				} catch (IOException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
			}
		}
		else if (source == btnRefreshPreview) {
			docProcessor.refreshValues();
			String content = docProcessor.getHtml();
			Rectangle visibleRect = previewScrollPane.getVisibleRect();
			previewPane.setText(content);
			previewScrollPane.scrollRectToVisible(visibleRect);
		}
	}