/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * WindowablePanel.java
 *
 * Created on 07.02.2010, 22:51:04
 */

package csa.gui.panels;

import csa.gui.Windowable;
import csa.gui.components.CSAView;

/**
 *
 * @author Malban
 */
public class WindowablePanel extends javax.swing.JPanel implements Windowable{

    private CSAView mParent = null;
    private javax.swing.JMenuItem mParentMenuItem = null;

    String mTitel="";

    @Override
    public void closing(){}
    @Override
    public void setParentWindow(CSAView jpv)
    {
        mParent = jpv;
    }
    @Override
    public void setMenuItem(javax.swing.JMenuItem item)
    {
        mParentMenuItem = item;
        mParentMenuItem.setText(mTitel);
    }
    @Override
    public javax.swing.JMenuItem getMenuItem()
    {
        return mParentMenuItem;
    }
    @Override
    public javax.swing.JPanel getPanel()
    {
        return this;
    }

    /** Creates new form WindowablePanel */
    public WindowablePanel()
    {
        initComponents();
    }

    public void setContent(javax.swing.JComponent c, String titel)
    {
        mTitel = titel;
        add(c, java.awt.BorderLayout.CENTER);
        if (mParentMenuItem != null)
            mParentMenuItem.setText("titel");
    }
    /** 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.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setLayout(new java.awt.BorderLayout());
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
