package com.github.aureliano.edocs.app.gui;

import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JToolBar;

import com.github.aureliano.edocs.app.cmd.NewDocumentCommand;
import com.github.aureliano.edocs.common.locale.EdocsLocale;

public class VerticalToolBar extends JToolBar {

	private static final long serialVersionUID = -176640015146742392L;

	private JButton buttonFindDocuments;
	private JButton buttonNewDocument;
	
	public VerticalToolBar() {
		super.setFloatable(false);
		super.setOrientation(JToolBar.VERTICAL);
		super.setMargin(new Insets(10, 5, 5, 5));
		
		this.configureButtons();
		
		super.add(this.buttonFindDocuments);
		super.add(this.buttonNewDocument);
	}

	private void configureButtons() {
		EdocsLocale locale = EdocsLocale.instance();
		
		this.buttonFindDocuments = new JButton();
		this.buttonFindDocuments.setToolTipText(locale.getMessage("gui.toolbar.vertical.button.find.document.tooltip"));
		
		this.buttonNewDocument = new JButton();
		this.buttonNewDocument.setToolTipText(locale.getMessage("gui.toolbar.vertical.button.new.document.tooltip"));
		this.buttonNewDocument.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				new NewDocumentCommand().execute();
			}
		});
	}
}
@@ -256,16 +256,72 @@
 ommand;%0A
+import com.github.aureliano.edocs.app.helper.GuiHelper;%0A
 import c
@@ -946,32 +946,108 @@
  new JButton();%0A
+%09%09this.buttonFindDocuments.setIcon(GuiHelper.createIcon(%22img/search.png%22));%0A
 %09%09this.buttonFin
@@ -1182,32 +1182,109 @@
  new JButton();%0A
+%09%09this.buttonNewDocument.setIcon(GuiHelper.createIcon(%22img/documents.png%22));%0A
 %09%09this.buttonNew

Add icons to buttons of vertical tool bar.