/*
* Copyright (C) 2011-2014 GeoForge Project
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.geoforge.guillc.panel;
import java.awt.event.ActionListener;
import org.geoforge.guillc.button.BtnAbs;
import org.geoforge.guillc.button.GfrBtnTxtRndCmdUncheckAllXXSmall;
import org.geoforge.guillc.button.GfrBtnTxtRndCmdCheckAllXXSmall;
/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com
* ... please remove "_AT_" from the above string to get the right email address
*/
public class GfrPnlGrpBtnsCheckUncheckAll extends GfrPnlGrpBtnsAbs
{
private BtnAbs _btnCheckAll_ = null;
private BtnAbs _btnUncheckAll_ = null;
public GfrPnlGrpBtnsCheckUncheckAll(
ActionListener alr)
{
super("", 20);
this._btnCheckAll_ = new GfrBtnTxtRndCmdCheckAllXXSmall(alr);
this._btnUncheckAll_ = new GfrBtnTxtRndCmdUncheckAllXXSmall(alr);
}
public void setEnabledButtonCheckAll(boolean bln)
{
this._btnCheckAll_.setEnabled(bln);
}
public void setEnabledButtonUncheckAll(boolean bln)
{
this._btnUncheckAll_.setEnabled(bln);
}
@Override
public boolean init()
{
if (!super.init())
return false;
if (!this._btnCheckAll_.init())
return false;
if (!this._btnUncheckAll_.init())
return false;
super.setMandatoryIcon(false);
super.setValueIsOk(true);
this._btnCheckAll_.setEnabled(false);
this._btnUncheckAll_.setEnabled(false);
super._pnlContent.add(this._btnCheckAll_);
super._pnlContent.add(GfrPnlGrpBtnsAbs._CMP_SEPARATION);
super._pnlContent.add(this._btnUncheckAll_);
return true;
}
@Override
public void destroy()
{
super.destroy();
if (this._btnCheckAll_ != null)
{
this._btnCheckAll_.destroy();
this._btnCheckAll_ = null;
}
if (this._btnUncheckAll_ != null)
{
this._btnUncheckAll_.destroy();
this._btnUncheckAll_ = null;
}
}
}