/*
 * JrxmlEditorToolbar.java
 *
 * Created on 23 ottobre 2007, 16.57
 */

package com.jaspersoft.ireport.designer.tools;

import com.jaspersoft.ireport.designer.JrxmlPreviewView;

/**
 *
 * @author  gtoffoli
 */
public class JrxmlPreviewToolbar extends javax.swing.JPanel {
    
    JrxmlPreviewView view = null;
    /** Creates new form JrxmlEditorToolbar */
    public JrxmlPreviewToolbar(JrxmlPreviewView view) {
        initComponents();
        this.view = view;
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBar1 = new javax.swing.JToolBar();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        jButton1 = new javax.swing.JButton();

        setLayout(new java.awt.BorderLayout());

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);
        jToolBar1.add(jSeparator1);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jaspersoft/ireport/designer/resources/refresh-16.png"))); // NOI18N
        jButton1.setText(org.openide.util.NbBundle.getMessage(JrxmlPreviewToolbar.class, "JrxmlPreviewToolbar.jButton1.text")); // NOI18N
        jButton1.setToolTipText(org.openide.util.NbBundle.getMessage(JrxmlPreviewToolbar.class, "JrxmlPreviewToolbar.jButton1.toolTipText")); // NOI18N
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton1);

        add(jToolBar1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        view.setNeedRefresh(true);
        view.componentShowing();
    }//GEN-LAST:event_jButton1ActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JToolBar jToolBar1;
    // End of variables declaration//GEN-END:variables
    
}
