|
/******************************************************************************
Copyright (C) 2006 MakeLogic
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Date : 6th January 2006
Authors : MakeLogic
Design : Ujjwal
Developer : Dharma
********************************************************************************/
package com.makeLogic;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import com.makeLogic.utils.Trace;
/**
* Summary description for HideAction.
*/
public class HideAction extends AbstractAction{
TailMDI tailMDI;
ClassLoader cl;
public HideAction(TailMDI tailMDI){
super("Hide");
Trace.enter("HideAction.HideAction");
this.tailMDI = tailMDI;
//..Get current classloader
cl = this.getClass().getClassLoader();
Trace.exit("HideAction.HideAction");
}
public void actionPerformed(ActionEvent ae){
Trace.enter("HideAction.actionPerformed");
if(getMDI().projPanel.isVisible())
{
//..Set tool tip and icon
getMDI().hideButton.setToolTipText("Show Project Panel");
getMDI().showHideProjectItem.setText("Show Project Panel");
try
{
getMDI().hideButton.setIcon(new ImageIcon(cl.getResource("showButton.png")));
getMDI().showHideProjectItem.setIcon(new ImageIcon(cl.getResource("showButton.png")));
}
catch(Exception excpt)
{
getMDI().hideButton.setText("Show");
Trace.exception(excpt);
}
//..Hide the panel
getMDI().projPanel.setVisible(false);
}
else
{
//..Set tool tip and icon
getMDI().hideButton.setToolTipText("Hide Project Panel");
getMDI().showHideProjectItem.setText("Hide Project Panel");
try
{
getMDI().hideButton.setIcon(new ImageIcon(cl.getResource("hideButton.png")));
getMDI().showHideProjectItem.setIcon(new ImageIcon(cl.getResource("hideButton.png")));
}
catch(Exception excpt)
{
getMDI().hideButton.setText("Hide");
Trace.exception(excpt);
}
//..Show the panel
getMDI().projPanel.setVisible(true);
getMDI().splitPane.setDividerLocation(0.2);
}
Trace.exit("HideAction.actionPerformed");
}
//..return the tailMDI object
public TailMDI getMDI(){
Trace.enter("HideAction.getMDI");
Trace.exit("HideAction.getMDI");
return tailMDI;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Founder of MakeLogic - A Mobile Solutions and XML Web Services Company. B-Tech engineer from India's reputed IITs.
Designed and Authored products like MicroGraphs, MakeLogic VersionManager and MakeLogic Device Broker. Pls see http://www.makelogic.com
MakeLogic is a strategic business partner of Microsoft, Sun, IBM, HP and Citrix.
Contact : madanuuk@makelogic.com OR +91 - 40 - 55322433