/*
* 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.toolbar;
import java.awt.event.ActionListener;
import javax.swing.Box;
import javax.swing.JToolBar;
import org.geoforge.awt.image.GfrFactoryIconAbs;
import org.geoforge.guillc.button.BtnTransientAbs;
import org.geoforge.guillc.button.BtnTransientDelOptionIconPdf;
import org.geoforge.guillc.button.BtnTransientImpOptionIconPdf;
import org.geoforge.guillc.button.GfrBcnTipIconLogoUser;
/**
*
* @author bill
*/
public class GfrTbrHlpOptionIconPdf extends GfrTbrHlpAbs
{
private BtnTransientAbs _btnImp_ = null;
private BtnTransientAbs _btnDel_ = null;
public GfrTbrHlpOptionIconPdf(
ActionListener lstAction,
boolean blnHasIcon)
{
super(
"toolbar's dialog", // strSuffixTitleDetached
JToolBar.HORIZONTAL, GfrFactoryIconAbs.INT_SIZE_XXSMALL);
this._btnImp_ = new BtnTransientImpOptionIconPdf(lstAction);
this._btnDel_ = new BtnTransientDelOptionIconPdf(lstAction);
this._btnImp_.setEnabled(! blnHasIcon);
this._btnDel_.setEnabled(blnHasIcon);
super._btnHelpPartThisFrame = new GfrBcnTipIconLogoUser(GfrFactoryIconAbs.INT_SIZE_XXSMALL);
}
public void setEnabledImport()
{
this._btnImp_.setEnabled(true);
}
public void setEnabledDelete()
{
this._btnDel_.setEnabled(true);
}
@Override
public boolean init()
{
if (! super.init())
return false;
if (! this._btnImp_.init())
return false;
if (! this._btnDel_.init())
return false;
super.add(this._btnImp_);
super.add(this._btnDel_);
if (super._btnHelpPartThisFrame != null)
{
super.add(Box.createHorizontalGlue());
super.add(Box.createVerticalGlue());
super.add(super._btnHelpPartThisFrame);
}
return true;
}
@Override
public void destroy()
{
super.destroy();
if (this._btnImp_ != null)
{
this._btnImp_.destroy();
this._btnImp_ = null;
}
if (this._btnDel_ != null)
{
this._btnDel_.destroy();
this._btnDel_ = null;
}
}
}