// Path: pim-client/src/pro/qinka/pim/collection/PIMBaseCollection.java
// public interface PIMBaseCollection extends Collection<PIMEntity>, List<PIMEntity>
// {
//     /**
//      * The method to get all the notes
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getNotes();
//     /**
//      * The method to get all the notes whose owner is someone
//      * @param owner the owner of the items you want 
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getNotes(String owner);
// 
//     /**
//      * The method to get all the todos
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getTodos();
//     /**
//      * The method to get all the todos whose owner is someone
//      * @param owner the owner of the items you want 
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getTodos(String owner);
// 
//     /**
//      * The method to get all the appointments
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getAppointments();
//     /**
//      * The method to get all the appointments whose owner is someone
//      * @param owner the owner of the items you want 
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getAppointments(String owner);
// 
//     /**
//      * The method to get all the contacts
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getContacts();
//     /**
//      * The method to get all the contacts whose owner is someone
//      * @param owner the owner of the items you want 
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getContacts(String owner);
// 
//     /**
//      * The method to get all the items whose date is same with what was given
//      * @param d is the date
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getItemsForDate(Date d);
//     /**
//      * The method to get all the items whose date and owner is same with what was given
//      * @param d is the date
//      * @param owner is the owner of the item
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getItemsForDate(Date d, String owner);
// 
//     /**
//      * The method to get all the items
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getAll();
//     /**
//      * The method to get all the items whose owner is same with what was given
//      * @param owner is the owner of the item
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getAll(String owner);
// 
//     /**
//      * The method to add an new item to colllection
//      * @param item the item which will be added to collection
//      * @return the return is about whether the action is success.
//      */
//     public boolean           add(PIMEntity item);
// }


import java.lang.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import net.miginfocom.swing.*;
import pro.qinka.pim.collection.PIMBaseCollection;

	PIMBaseCollection pimc = cr.getCollection();
	JFrame jf = new MainWindows(pimc,textField1.getText());
	jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	this.setVisible(false);
	jf.setVisible(true);
	this.dispose();
    }

    /**
     * The method about the combobox's context changed.
     */
    private void comboBox1ItemStateChanged(ItemEvent e) {
	boolean isVis = comboBox1.getSelectedItem().equals("database");
	usernameT.setVisible(isVis);
	usernameI.setVisible(isVis);
	passwordT.setVisible(isVis);
	passwordI.setVisible(isVis);
	this.pack();
    }

    /**
     * The method about to check the fileds' context.
     */
    private void fieldUpdateCheck(CaretEvent e) {
	boolean btEnable = textField1.getText().isEmpty() || connectionparam.getText().isEmpty();
	boolean dbOpt;
	if (comboBox1.getSelectedIndex() == 2)
	    dbOpt = usernameI.getText().isEmpty() || String.valueOf(passwordI.getPassword()).isEmpty();
	else dbOpt = false;
	boolean fn = !(dbOpt || btEnable);

// Path: pim-client/src/pro/qinka/pim/collection/PIMBaseCollection.java
// public interface PIMBaseCollection extends Collection<PIMEntity>, List<PIMEntity>
// {
//     /**
//      * The method to get all the notes
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getNotes();
//     /**
//      * The method to get all the notes whose owner is someone
//      * @param owner the owner of the items you want 
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getNotes(String owner);
// 
//     /**
//      * The method to get all the todos
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getTodos();
//     /**
//      * The method to get all the todos whose owner is someone
//      * @param owner the owner of the items you want 
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getTodos(String owner);
// 
//     /**
//      * The method to get all the appointments
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getAppointments();
//     /**
//      * The method to get all the appointments whose owner is someone
//      * @param owner the owner of the items you want 
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getAppointments(String owner);
// 
//     /**
//      * The method to get all the contacts
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getContacts();
//     /**
//      * The method to get all the contacts whose owner is someone
//      * @param owner the owner of the items you want 
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getContacts(String owner);
// 
//     /**
//      * The method to get all the items whose date is same with what was given
//      * @param d is the date
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getItemsForDate(Date d);
//     /**
//      * The method to get all the items whose date and owner is same with what was given
//      * @param d is the date
//      * @param owner is the owner of the item
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getItemsForDate(Date d, String owner);
// 
//     /**
//      * The method to get all the items
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getAll();
//     /**
//      * The method to get all the items whose owner is same with what was given
//      * @param owner is the owner of the item
//      * @return the collection of what were gotten
//      */
//     public PIMBaseCollection getAll(String owner);
// 
//     /**
//      * The method to add an new item to colllection
//      * @param item the item which will be added to collection
//      * @return the return is about whether the action is success.
//      */
//     public boolean           add(PIMEntity item);
// }


// Path: pim-client/src/pro/qinka/pim/gui/ConnectionWindows.java
import java.lang.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import net.miginfocom.swing.*;
import pro.qinka.pim.collection.PIMBaseCollection;

	PIMBaseCollection pimc = cr.getCollection();
	JFrame jf = new MainWindows(pimc,textField1.getText());
	jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	this.setVisible(false);
	jf.setVisible(true);
	this.dispose();
    }

    /**
     * The method about the combobox's context changed.
     */
    private void comboBox1ItemStateChanged(ItemEvent e) {
	boolean isVis = comboBox1.getSelectedItem().equals("database");
	usernameT.setVisible(isVis);
	usernameI.setVisible(isVis);
	passwordT.setVisible(isVis);
	passwordI.setVisible(isVis);
	this.pack();
    }

    /**
     * The method about to check the fileds' context.
     */
    private void fieldUpdateCheck(CaretEvent e) {
	boolean btEnable = textField1.getText().isEmpty() || connectionparam.getText().isEmpty();
	boolean dbOpt;
	if (comboBox1.getSelectedIndex() == 2)
	    dbOpt = usernameI.getText().isEmpty() || String.valueOf(passwordI.getPassword()).isEmpty();
	else dbOpt = false;
	boolean fn = !(dbOpt || btEnable);

	if (fn != button1.isEnabled()) {
