`
wuhaidong
  • 浏览: 365081 次
  • 性别: Icon_minigender_1
  • 来自: 青岛
社区版块
存档分类
最新评论

查询面板上加入"常用页签"面板

    博客分类:
  • NC
阅读更多

1.。定义一个常用条件模板,命名为NormalPane , 继承接口INormalQuery

 

package nc.ui.ldzl.rent;

import java.awt.Color;

import javax.swing.ButtonGroup;

import nc.ui.pub.beans.UIRadioButton;
import nc.ui.pub.beans.UITextArea;

public class NormalPanel extends nc.ui.pub.beans.UIPanel implements nc.ui.trade.query.INormalQuery{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	//常用条件
	private UIRadioButton m_rdoFree = null;
	private UIRadioButton m_rdoSubmit = null;
	private UIRadioButton m_rdoCheckGoing = null;
	private UIRadioButton m_rdoAudited = null;
	private UIRadioButton m_rdoNotPass = null;
	private UIRadioButton m_rdoAll = null;
	private String tableName = null;
	private String m_isNormal = "Y"; //是否有“常用条件”页签

	public NormalPanel(){
		super();
		init();
	}
	
	public NormalPanel(String m_isNormal){
		super();
		init();
		this.m_isNormal = m_isNormal;
	}
	
	public NormalPanel(java.awt.LayoutManager p0){
		super(p0);
		init();
	}
	
	public NormalPanel(java.awt.LayoutManager p0, boolean p1){
		super(p0,p1);
		init();
	}
	
	public NormalPanel(boolean p1){
		super(p1);
		init();
	}
	
	private void init() {
		this.setSize(500, 500);
		/*加入常用条件*/
		m_rdoFree = new UIRadioButton();
		m_rdoFree.setText("自由");
		m_rdoFree.setBackground(this.getBackground());
		m_rdoFree.setForeground(Color.black);
		m_rdoFree.setSize(80, m_rdoFree.getHeight());
		m_rdoFree.setSelected(true);
		
		m_rdoSubmit = new UIRadioButton();
		m_rdoSubmit.setText("提交");
		m_rdoSubmit.setBackground(this.getBackground());
		m_rdoSubmit.setForeground(Color.black);
		m_rdoSubmit.setSize(m_rdoFree.getSize());
		
		m_rdoCheckGoing = new UIRadioButton();
		m_rdoCheckGoing.setText("审批进行中");
		m_rdoCheckGoing.setBackground(this.getBackground());
		m_rdoCheckGoing.setForeground(Color.black);
		m_rdoCheckGoing.setSize(160, m_rdoFree.getHeight());
		
		m_rdoAudited = new UIRadioButton();
		m_rdoAudited.setText("审批通过");
		m_rdoAudited.setBackground(m_rdoFree.getBackground());
		m_rdoAudited.setForeground(m_rdoFree.getForeground());
		m_rdoAudited.setSize(m_rdoFree.getSize());

		m_rdoNotPass = new UIRadioButton();
		m_rdoNotPass.setText("审批未通过");
		m_rdoNotPass.setBackground(m_rdoFree.getBackground());
		m_rdoNotPass.setForeground(m_rdoFree.getForeground());
		m_rdoNotPass.setSize(160, m_rdoFree.getHeight());

		m_rdoAll = new UIRadioButton();
		m_rdoAll.setText("全部");
		m_rdoAll.setBackground(m_rdoFree.getBackground());
		m_rdoAll.setForeground(m_rdoFree.getForeground());
		m_rdoAll.setSize(m_rdoFree.getSize());

		m_rdoFree.setLocation(50, 30);
		m_rdoSubmit.setLocation(m_rdoFree.getX(), m_rdoFree.getY()+m_rdoFree.getHeight()+20);
		m_rdoCheckGoing.setLocation(m_rdoFree.getX(), m_rdoSubmit.getY()+m_rdoSubmit.getHeight()+20);
		m_rdoAudited.setLocation(m_rdoFree.getX(), m_rdoCheckGoing.getY()+m_rdoCheckGoing.getHeight()+20);
		m_rdoNotPass.setLocation(m_rdoFree.getX(), m_rdoAudited.getY()+m_rdoAudited.getHeight()+20);
		m_rdoAll.setLocation(m_rdoFree.getX(), m_rdoNotPass.getY()+m_rdoNotPass.getHeight()+20);
		
		ButtonGroup bg = new ButtonGroup();
		bg.add(m_rdoFree);
		bg.add(m_rdoSubmit);
		bg.add(m_rdoCheckGoing);
		bg.add(m_rdoAudited);
		bg.add(m_rdoNotPass);
		bg.add(m_rdoAll);
		bg.setSelected(m_rdoFree.getModel(), true);
		
		this.setLayout(null);
		//将自定义控件加入到查询条件模板中
		this.add(m_rdoFree);
		this.add(m_rdoSubmit);
		this.add(m_rdoCheckGoing);
		this.add(m_rdoAudited);
		this.add(m_rdoNotPass);
		this.add(m_rdoAll);
		
		
	}
	
	/* 返回对条件的校验,如果返回为空,表示校验通过,反之返回错误原因。
	 * (non-Javadoc)
	 * @see nc.ui.trade.query.INormalQuery#checkCondition()
	 */
	public String checkCondition() {
		return null;
	}
	
	/*	返回常用条件的SQL语句
	 * (non-Javadoc)
	 * @see nc.ui.trade.query.INormalQuery#getWhereSql()
	 */
	public String getWhereSql() {
		String whereSql = "1=1";
		if(m_isNormal != null && m_isNormal.equals("N")){
			return whereSql;
		}
		if(m_rdoFree.isSelected()){//自由
			if(tableName != null && tableName.length() > 0){
				whereSql = whereSql + "and isnull("+tableName+".vbillstatus,'8')='8'";
			}else{
				whereSql = whereSql + "and isnull(vbillstatus,'8')='8'";
			}
		}
		if(m_rdoSubmit.isSelected()){//提交
			if(tableName != null && tableName.length() > 0){
				whereSql = whereSql + "and isnull("+tableName+".vbillstatus,'8')='3'";
			}else{
				whereSql = whereSql + "and isnull(vbillstatus,'8')='3'";
			}
		}
		if(m_rdoCheckGoing.isSelected()){//审批进行中
			if(tableName != null && tableName.length() > 0){
				whereSql = whereSql + "and isnull("+tableName+".vbillstatus,'8')='2'";
			}else{
				whereSql = whereSql + "and isnull(vbillstatus,'8')='2'";
			}
		}
		if(m_rdoAudited.isSelected()){//审批通过
			if(tableName != null && tableName.length() > 0){
				whereSql = whereSql + "and isnull("+tableName+".vbillstatus,'8')='1'";
			}else{
				whereSql = whereSql + "and isnull(vbillstatus,'8')='1'";
			}
		}
		if(m_rdoNotPass.isSelected()){//审批未通过
			if(tableName != null && tableName.length() > 0){
				whereSql = whereSql + "and isnull("+tableName+".vbillstatus,'8')='0'";
			}else{
				whereSql = whereSql + "and isnull(vbillstatus,'8')='0'";
			}
		}
		if(m_rdoAll.isSelected()){
			return "("+whereSql+")";
		}
		return "("+whereSql+")";
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
}

 

2.。创建一个查询对话框RentQueryDlgSelf ,继承nc.ui.trade.query.HYQueryDLG

 

 

package nc.ui.ldzl.rent;

import java.awt.Container;

import nc.ui.pub.beans.UIPanel;
import nc.ui.trade.query.HYQueryDLG;

public class RentQueryDlgSelf extends HYQueryDLG{

	public RentQueryDlgSelf(Container parent, UIPanel normalPanel, String pk_corp, String moduleCode, String operator, String busiType) {
		super(parent, normalPanel, pk_corp, moduleCode, operator, busiType);
		hideUnitButton();
	}
	
	public RentQueryDlgSelf(Container parent, UIPanel normalPanel, String pk_corp, String moduleCode, String operator, String busiType,String nodeKey) {
		super(parent, normalPanel, pk_corp, moduleCode, operator, busiType, nodeKey);
		hideUnitButton();
	}
}

 

 

3.。在EventHander 类里写入如方法进行调用:

 

protected UIDialog createQueryUI() {
		NormalPanel normalPanel = new NormalPanel();
		Container parent = this.getBillUI();
		String pk_corp = this._getCorp().getPrimaryKey();
		String moduleCode = this.getBillUI()._getModuleCode();
		String operator = this._getOperator();
		String busiType = this.getBillUI().getBusinessType();
		String nodeKey = this.getBillUI().getNodeKey();
		RentQueryDlgSelf DLG = new RentQueryDlgSelf(parent, normalPanel, pk_corp, moduleCode, operator, busiType, nodeKey);
		return DLG;
	}
 

 

分享到:
评论

相关推荐

    [android]仿QQ表情面板

    QQ表情面板是社交应用中常用的一个功能,它允许用户方便地选择和发送各种表情,增强交流的趣味性和表达力。 首先,我们需要了解QQ表情面板的基本结构。通常,它包含一个顶部的搜索栏,一个表情分类标签栏,以及一个...

    面板数据分析方法.ppt

    最后,平衡面板数据是指所有个体在每个时间点都有完整观测,而非平衡面板数据则可能由于个体的加入、退出或数据缺失导致不同时间点的观测个体不一致。 在模型形式上,面板数据模型有多种类型,如固定效应模型、随机...

    一种百叶窗式面板调整组

    此外,将常用工具放在百叶窗式面板中比传统的菜单系统更便捷。菜单系统通常需要用户通过多级下拉菜单寻找所需功能,而面板则可以直接展示工具图标,用户只需单击即可执行操作。这对于频繁使用的功能来说,大大减少了...

    致力于打造最完美的Linux工具箱,包括宝塔控制面板脚本,kangle虚拟化架构的常用功能以及模板切_shell.zip

    宝塔面板是一个常用的服务器管理软件,通过提供可视化的操作界面,用户可以方便地进行网站管理、FTP管理、数据库管理以及安全设置等操作,极大地简化了服务器的管理工作。宝塔控制面板脚本的集成,意味着用户可以...

    Adobe_Photoshop_CS4学习教程.doc

    新加入的注释面板上可以些一些文件注释,在以前的版本中,加入注释的通过选择的注释工具,在文件上拖动,在拖出的文本框中输入注释内容,而现在在新版本中是直接将注释写于注释面板内。 PHOTOSHOP CS4 面板操作 在 ...

    面板数据相关资料.docx

    面板数据是一种统计分析中常用的二维数据集,它结合了时间序列数据和横截面数据的特点。在面板数据中,我们观察到多个个体(截面)在不同时间点(时间序列)上的观测值,这种结构提供了丰富的信息,可以用来研究个体...

    最常用的电脑快捷键大全.doc

    - `Ctrl + Q`: 打开“添加到过滤列表”面板,将当前页面地址加入过滤列表。 - `Ctrl + R`: 刷新当前页面。 - `Ctrl + S`: 打开“保存网页”面板,保存页面内容。 - `Ctrl + T`: 垂直平铺所有窗口。 - `Ctrl + V...

    面板数据,时间序列,维

    面板数据是一种特殊的统计数据集,它结合了时间序列和横截面数据的特性,用于研究多个个体在多个时间点上的观察。这种数据类型在经济学、社会科学以及商业分析等领域广泛应用,因为它能够提供更丰富的信息,帮助研究...

    中文版Adobe_Photoshop_CS4学习教程.doc

    * 注释面板:可以些一些文件注释,在以前的版本中,加入注释的通过选择的注释工具,在文件上拖动,在拖出的文本框中输入注释内容,而现在在新版本中是直接将注释写于注释面板内。 五、面板操作 面板操作包括移动...

    Matlab汉字语音识别【面板设计】.zip

    例如,在面板上可以加入实时语音波形显示、识别结果的文本框以及状态指示灯等元素,使得用户能够清晰地理解当前的操作状态。 此外,为了提高系统的可用性和稳定性,面板设计中还需要考虑到异常处理和用户帮助系统的...

    Quicker(桌面快捷启动面板)v0.11.9.032位64位免费安装版

    将常用的软件、文件、网址,或者Windows命令加入快捷面板。点击一下快速打开或执行。 发送组合按键 更快、更简单的执行快捷键操作或菜单命令。 减轻记忆负担,减少在键盘和鼠标之前的切换。 发送文本 将预先...

    电信设备-具备面板保护材料的移动通信终端.zip

    1. **玻璃保护层**:手机屏幕最常用的面板保护材料是强化玻璃,如康宁的大猩猩玻璃。这种玻璃经过高温处理,具有出色的抗冲击和防刮性能。此外,新一代的玻璃还加入了疏水和疏油的特性,能减少指纹和污渍的留存。 2...

    面板数据分析步骤总结 (2).docx

    面板数据分析是一种针对多时期、多个体数据的统计分析方法,常用于经济、社会科学等领域,以研究时间序列与横截面数据间的动态关系。面板数据集成了时间序列的稳定性与横截面的多样性,能捕捉到个体间的差异和时间...

    Photoshop_CS4-中文版学习教程.pdf

    * 注释面板:可以些一些文件注释,在以前的版本中,加入注释的通过选择的注释工具,在文件上拖动,在拖出的文本框中输入注释内容。 面板操作 在 Photoshop CS4 中,面板的操作变得更加灵活和方便。可以移动面板、...

    面板数据模型设定检验方法.pdf

    本部分主要介绍两种常用的面板数据模型检验方法:F检验和Hausman检验。 首先,F检验通常用于判断模型中是否存在固定效应。在面板数据模型中,固定效应可以用来捕捉个体间的不可观测差异,如企业特质或国家特定因素...

    MatlabA交通标志识别【面板设计】.zip

    此外,为了提高识别系统的准确性和鲁棒性,还应当在面板设计中加入一些高级功能,如多角度识别、不同光照条件下的适应能力、以及实时处理等。这些功能的实现需要算法工程师具备深厚的技术功底,同时对Matlab语言和...

    面板数据分析方法步骤全解 (2).docx

    常用的单位根检验包括LLC(Levin, Lin & Chu)检验、IPS(Im, Pesaran & Shin)检验、Breitung检验、ADF-Fisher和PP-Fisher检验。这些检验可以帮助确定数据是否存在趋势或截距,以及是否存在单位根。如果所有检验都...

Global site tag (gtag.js) - Google Analytics