|
/******************************************************************************
Copyright (C) 2005 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 : 14th December 2005
Authors : MakeLogic
Design : Ujjwal
Developer : Dharma
********************************************************************************/
package com.makeLogic.utils;
import com.makeLogic.TailMDI;
import com.makeLogic.TailInternalFrame;
import java.awt.Container;
import java.awt.Checkbox;
import java.awt.CheckboxGroup;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.border.TitledBorder;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
/**
* Summary description for FindDialogCenterComp.
*/
public class FindDialogCenterComp extends JPanel{
JTextField findField;
JCheckBox matchCase;
CheckboxGroup checkBoxGroup;
public FindDialogCenterComp(String selectedText){
//
// TODO: Add Constructor Logic here
//
//..Debug
//this.setBackground(java.awt.Color.pink);
//..Set GridBagLayout
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
setLayout(gridbag);
//..FindLabel
JLabel findLabel = new JLabel("Find what ");
//..Add FindLabel
gbc.fill = GridBagConstraints.HORIZONTAL;
//gbc.weightx = 0.5;
gbc.gridx = 0;
gbc.gridy = 0;
gbc.gridwidth = 1;
gbc.ipady = 5;
//gbc.insets = new Insets(0,5,0,5);
gridbag.setConstraints(findLabel,gbc);
add(findLabel);
//..FindText TextField
findField = new JTextField(selectedText);
//add(findField);
//..Add FindField(SearchString)
//gbc.weightx = 2.0;
gbc.gridx = 1;
gbc.gridy = 0;
gbc.gridwidth = 4;
gbc.ipady = 5;
//gbc.insets = new Insets(0,0,0,5);
gridbag.setConstraints(findField,gbc);
add(findField);
//..MatchCase CheckBox
matchCase = new JCheckBox("Match Case:");
//add(matchCase);
//..Add matchCase CheckBox
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 2;
gbc.ipady = 5;
gridbag.setConstraints(matchCase,gbc);
add(matchCase);
JPanel checkBoxPanel = new JPanel();
GridBagLayout gridBagLayout2 = new GridBagLayout();
checkBoxPanel.setLayout(gridBagLayout2);
GridBagConstraints gbc2 = new GridBagConstraints();
checkBoxPanel.setBorder(new TitledBorder("Documents"));
//checkBoxPanel.setBackground(java.awt.Color.red);
checkBoxGroup = new CheckboxGroup();
//..Add RadioButtons
Checkbox currentDoc = new Checkbox("Current",checkBoxGroup,true);
//..Add currentDoc Checkbox
gbc2.gridx = 0;
gbc2.gridy = 0;
gbc2.gridwidth = 1;
gridBagLayout2.setConstraints(currentDoc,gbc2);
//add(currentDoc);
checkBoxPanel.add(currentDoc);
Checkbox allDoc = new Checkbox("All Opened",checkBoxGroup,false);
//..Add allDoc Checkbox
gbc2.gridx = 1;
gbc2.gridy = 0;
gbc2.gridwidth = 1;
//gbc2.ipady = 5;
gridBagLayout2.setConstraints(allDoc,gbc2);
//add(allDoc);
checkBoxPanel.add(allDoc);
//..add the panel
gbc.gridx = 2;
gbc.gridy = 1;
gbc.ipady = 5;
//gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.gridwidth = 3;
gridbag.setConstraints(checkBoxPanel,gbc);
add(checkBoxPanel);
}
//..get searchText
public String getSearchText(){
return findField.getText();
}
//..set searchText
public void setSearchText(String text){
findField.setText(text);
}
//..get matchCase
public boolean isMatchCaseSelected()
{
return matchCase.isSelected();
}
//..get whether to search All Doc or current Doc
public boolean isCurrentSelected(){
if(checkBoxGroup.getSelectedCheckbox().getLabel() == "Current")
{
return true;
}
else
{
return false;
}
}
}
|
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