View Javadoc

1   /*
2    * XMLCV - Gestion de CV sous forme XML
3    * 
4    * Copyright (C) 2004-2005, Damien Raude-Morvan
5    * 
6    * This file is part of XMLCV.
7    *
8    * XMLCV is free software; you can redistribute it and/or modify
9    * it under the terms of the GNU General Public License as published by
10   * the Free Software Foundation; either version 2 of the License, or
11   * (at your option) any later version.
12   *
13   * XMLCV is distributed in the hope that it will be useful,
14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   * GNU General Public License for more details.
17   *
18   * You should have received a copy of the GNU General Public License
19   * along with XMLCV; if not, write to the Free Software
20   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21   * 
22   * Contacts :
23   * - Sébastien Mathy <smathy@tuxfamily.org>
24   * - Emmanuel Berre <eberre@tuxfamily.org>
25   * - Damien Raude-Morvan <drazzib@drazzib.com>
26   */
27  package org.xmlcv.gui;
28  
29  import javax.swing.JButton;
30  import javax.swing.JToolBar;
31  import javax.swing.SwingConstants;
32  import javax.swing.border.BevelBorder;
33  import javax.swing.border.SoftBevelBorder;
34  
35  import org.xmlcv.gui.action.ActionNewCV;
36  import org.xmlcv.gui.action.ActionOpenCV;
37  import org.xmlcv.gui.action.ActionOutHTML;
38  import org.xmlcv.gui.action.ActionOutPDF;
39  import org.xmlcv.gui.action.ActionOutRTF;
40  import org.xmlcv.gui.action.ActionPreview;
41  
42  /***
43   * Toolbar of XMLCV window
44   * 
45   * @version $Revision: 114 $
46   * @author <a href="mailto:drazzib@drazzib.com">Damien Raude-Morvan </a>
47   */
48  public class Toolbar extends JToolBar {
49  
50  	private JButton _newcvButton, _opencvButton, _outrtfButton, _outpdfButton,
51  			_outhtmlButton, _previewButton;
52  
53  	/***
54  	 * @param parent
55  	 */
56  	public Toolbar(Frame parent) {
57  		super();
58  
59  		// Paramètres de la barre d'outils
60  		this.setRollover(true);
61  		this.setFloatable(false);
62  		this.setBorder(new SoftBevelBorder(BevelBorder.RAISED));
63  		this.setOrientation(SwingConstants.HORIZONTAL);
64  
65  		// this.setLayout(new FlowLayout(FlowLayout.LEFT));
66  
67  		// Création des boutons
68  		this._newcvButton = new JButton(ActionNewCV.instance(parent));
69  		this._opencvButton = new JButton(ActionOpenCV.instance(parent));
70  		this._outrtfButton = new JButton(ActionOutRTF.instance(parent));
71  		this._outpdfButton = new JButton(ActionOutPDF.instance(parent));
72  		this._outhtmlButton = new JButton(ActionOutHTML.instance(parent));
73  		this._previewButton = new JButton(ActionPreview.instance(parent));
74  
75  		// Insertion dans la barre
76  		this.add(this._newcvButton);
77  		this.add(this._opencvButton);
78  		this.addSeparator();
79  		this.add(this._previewButton);
80  		this.addSeparator();
81  		this.add(this._outrtfButton);
82  		this.add(this._outpdfButton);
83  		this.add(this._outhtmlButton);
84  
85  	}
86  
87  }