chkboxs_btn3_panel.java

来自「导出ORACLE数据库对象DDL语句的程序」· Java 代码 · 共 456 行 · 第 1/2 页

JAVA
456
字号
package com.icbcsdc.ddlexp.ui.rightPanel;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;

import com.icbcsdc.ddlexp.pub.staticLog.Logger;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLArrayTypes;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLFunctions;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLNode;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLObjectTypes;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLPackageBodies;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLPackages;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLProcedures;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLRoles;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLSchema;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLSecurity;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLSequences;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLSources;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLStorage;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLSynonyms;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLTableTypes;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLTables;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLTablespaces;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLTypes;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLUndoSegs;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLUsers;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLViews;
import com.icbcsdc.ddlexp.ui.GlobalParameters;
import com.icbcsdc.ddlexp.ui.TreeFrame;


/**
 *右边的显示界面
 *
 *适用情况:
 *界面只有一个表,表只有两列,其中一列为可选列;
 *界面有三个按钮:一个为“确定”按钮,一个为“全部选择”按钮,一个为“清除选择”按钮。
 *
 *适用对象:
 *适用于存储Storage、安全性Security、方案Schema、资源Sources等页面
 */
public class ChkBoxs_Btn3_Panel extends RightPanel {
  private BorderLayout borderLayout = new BorderLayout();

  private JLabel labelTitle = new JLabel();
  private JLabel labelDesc = new JLabel();
  
  private String showTitle = "";
  private String showDesc = "";
  private String showCheck1 = "";
  private String showCheck2 = "";
  private String showCheck3 = "";
  private String showCheck4 = "";
  private String showCheck5 = "";
  private String showCheck6 = "";
  private JCheckBox jCheckBox1 = new JCheckBox();
  private JCheckBox jCheckBox2 = new JCheckBox();
  private JCheckBox jCheckBox3 = new JCheckBox();
  private JCheckBox jCheckBox4 = new JCheckBox();
  private JCheckBox jCheckBox5 = new JCheckBox();
  private JCheckBox jCheckBox6 = new JCheckBox();

  private JButton button_Export = new JButton();
  private JButton button_AllSelect = new JButton();
  private JButton button_ClearSelect = new JButton();
  
  private Border border;
  private JPanel contentPane = new JPanel();
  
  private int selctNodeType;			//用户选择的Node的类型
  private Hashtable children = null;	//需要显示的内容
  private boolean[] showArr = new boolean[6];
  private Enumeration enumeration = null;

  public ChkBoxs_Btn3_Panel(TreeFrame parent,XMLNode in_node) {
      super(parent,in_node);
      //this.node = in_node;

  	  this.jCheckBox1.setVisible(false);
  	  this.jCheckBox2.setVisible(false);
  	  this.jCheckBox3.setVisible(false);
  	  this.jCheckBox4.setVisible(false);
  	  this.jCheckBox5.setVisible(false);
  	  this.jCheckBox6.setVisible(false);

      this.selctNodeType = in_node.getType();
      
      //根据用户选择Node的不同,设置不同的界面显示内容
      switch(this.selctNodeType){
      case(XMLNode.XML_STORAGE):
      	/*存储*/
      	this.showTitle = "Storage";
      	this.showDesc = "Pelese select from the under checkbox:";

      	if(in_node.getDirectChildren(XMLNode.XML_TABLESPACES)!=null){
	      	this.showCheck1 = "Tablespaces";
		    this.showArr[0] = ((XMLTablespaces)((((XMLStorage)in_node).getDirectChildren(XMLNode.XML_TABLESPACES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox1.setVisible(true);      	
      	}
      	
      	if(in_node.getDirectChildren(XMLNode.XML_UNDO_SEGS)!=null){
	      	this.showCheck2 = "UndoSegs";
		    this.showArr[1] = ((XMLUndoSegs)(((XMLStorage)in_node).getDirectChildren(XMLNode.XML_UNDO_SEGS).elements()).nextElement()).isSelected();      	
	  	  	this.jCheckBox2.setVisible(true);      	
      	}

	    break;

      case(XMLNode.XML_SECURITY):
      	/*安全*/
      	this.showTitle = "Security";
      	this.showDesc = "Pelese select from the under checkbox:";

      	if(in_node.getDirectChildren(XMLNode.XML_ROLES)!=null){
	      	this.showCheck1 = "Roles";
		    this.showArr[0] = ((XMLRoles)((((XMLSecurity)in_node).getDirectChildren(XMLNode.XML_ROLES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox1.setVisible(true);      	
      	}

      	if(in_node.getDirectChildren(XMLNode.XML_USERS)!=null){
	      	this.showCheck2 = "Users";
		    this.showArr[1] = ((XMLUsers)((((XMLSecurity)in_node).getDirectChildren(XMLNode.XML_USERS).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox2.setVisible(true);      	
      	}

      	break;

      case(XMLNode.XML_SCHEMA):
      	/*方案*/
      	this.showTitle = "Schema:"+this.node.getName();
      	this.showDesc = "Pelese select from the under checkbox:";
      	if(in_node.getDirectChildren(XMLNode.XML_SEQUENCES)!=null){
	      	this.showCheck1 = "Sequences";  	
	    	this.showArr[0] = ((XMLSequences)((((XMLSchema)in_node).getDirectChildren(XMLNode.XML_SEQUENCES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox1.setVisible(true);      	
      	}
      	if(in_node.getDirectChildren(XMLNode.XML_SOURCES)!=null){
	      	this.showCheck2 = "Sources";      	
		    this.showArr[1] = ((XMLSources)((((XMLSchema)in_node).getDirectChildren(XMLNode.XML_SOURCES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox2.setVisible(true);      	
      	}
      	if(in_node.getDirectChildren(XMLNode.XML_SYNONYMS)!=null){
	      	this.showCheck3 = "Synonyms";      	
		    this.showArr[2] = ((XMLSynonyms)((((XMLSchema)in_node).getDirectChildren(XMLNode.XML_SYNONYMS).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox3.setVisible(true);      	
      	}
      	if(in_node.getDirectChildren(XMLNode.XML_VIEWS)!=null){
	      	this.showCheck4 = "Views";      	
		    this.showArr[3] = ((XMLViews)((((XMLSchema)in_node).getDirectChildren(XMLNode.XML_VIEWS).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox4.setVisible(true);      	
      	}
      	if(in_node.getDirectChildren(XMLNode.XML_TABLES)!=null){
	      	this.showCheck5 = "Tables";
		    this.showArr[4] = ((XMLTables)((((XMLSchema)in_node).getDirectChildren(XMLNode.XML_TABLES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox5.setVisible(true);      	
      	}
      	if(in_node.getDirectChildren(XMLNode.XML_TYPES)!=null){
	      	this.showCheck6 = "Types";
		    this.showArr[5] = ((XMLTypes)((((XMLSchema)in_node).getDirectChildren(XMLNode.XML_TYPES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox6.setVisible(true);      	
      	}

      	break;

      case(XMLNode.XML_SOURCES):
      	/*资源*/
      	this.showTitle = "Sources";
      	this.showDesc = "Pelese select from the under checkbox:";

      	if(in_node.getDirectChildren(XMLNode.XML_PROCEDURES)!=null){
	      	this.showCheck1 = "Procedures";
		    this.showArr[0] = ((XMLProcedures)((((XMLSources)in_node).getDirectChildren(XMLNode.XML_PROCEDURES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox1.setVisible(true);      	
      	}
      	
      	if(in_node.getDirectChildren(XMLNode.XML_PACKAGEBODIES)!=null){
	      	this.showCheck2 = "Package Bodies";
		    this.showArr[1] = ((XMLPackageBodies)((((XMLSources)in_node).getDirectChildren(XMLNode.XML_PACKAGEBODIES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox2.setVisible(true);      	
      	}
      	
      	if(in_node.getDirectChildren(XMLNode.XML_PACKAGES)!=null){
	      	this.showCheck3 = "Packages";
		    this.showArr[2] = ((XMLPackages)((((XMLSources)in_node).getDirectChildren(XMLNode.XML_PACKAGES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox3.setVisible(true);      	
      	}
      	
      	if(in_node.getDirectChildren(XMLNode.XML_FUNCTIONS)!=null){
	      	this.showCheck4 = "Functions";
		    this.showArr[3] = ((XMLFunctions)((((XMLSources)in_node).getDirectChildren(XMLNode.XML_FUNCTIONS).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox4.setVisible(true);      	
      	}      	

      	break;

      case(XMLNode.XML_TYPES):
      	/*用户类型*/
      	this.showTitle = "Types";
      	this.showDesc = "Pelese select from the under checkbox:";
      	this.jCheckBox4.setVisible(false);
      	this.jCheckBox5.setVisible(false);
      	this.jCheckBox6.setVisible(false);

      	if(in_node.getDirectChildren(XMLNode.XML_TABLETYPES)!=null){
	      	this.showCheck1 = "Table Types";
		    this.showArr[0] = ((XMLTableTypes)((((XMLTypes)in_node).getDirectChildren(XMLNode.XML_TABLETYPES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox1.setVisible(true);      	
      	}
      	if(in_node.getDirectChildren(XMLNode.XML_OBJECTTYPES)!=null){
	      	this.showCheck2 = "Object Types";
		    this.showArr[1] = ((XMLObjectTypes)((((XMLTypes)in_node).getDirectChildren(XMLNode.XML_OBJECTTYPES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox2.setVisible(true);      	
      	}
      	if(in_node.getDirectChildren(XMLNode.XML_ARRAYTYPES)!=null){
	      	this.showCheck3 = "Array Types";
		    this.showArr[2] = ((XMLArrayTypes)((((XMLTypes)in_node).getDirectChildren(XMLNode.XML_ARRAYTYPES).elements())).nextElement()).isSelected();
	  	  	this.jCheckBox3.setVisible(true);      	

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?