@@ -0,0 +1,2144 @@
+/*%0A * Copyright 2009-2011 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage info.joseluismartin.gui.form;%0A%0Aimport info.joseluismartin.gui.AbstractView;%0A%0Aimport java.awt.Dimension;%0A%0Aimport javax.swing.JComboBox;%0Aimport javax.swing.JComponent;%0Aimport javax.swing.JFrame;%0Aimport javax.swing.JTextField;%0A%0A/**%0A * Database Connection Form%0A * %0A * @author Jose Luis Martin - (jlm@joseluismartin.info)%0A */%0Apublic class DbConnectionForm  extends AbstractView%3CDbConnection%3E %7B%0A%09%0A%09private JComboBox database = new JComboBox();%0A%09private JTextField port = new JTextField();%0A%09private JTextField host = new JTextField();%0A%09private JTextField dbName = new JTextField();%0A%09%0A%09/**%0A%09 * @param dbConnection%0A%09 */%0A%09public DbConnectionForm(DbConnection dbConnection) %7B%0A%09%09super(dbConnection);%0A%09%09autobind();%0A%09%7D%0A%0A%09/**%0A%09 * %7B@inheritDoc%7D%0A%09 */%0A%09@Override%0A%09protected JComponent buildPanel() %7B%0A%09%09BoxFormBuilder fb = new BoxFormBuilder();%0A%09%09fb.setDebug(true);%0A%09%09fb.add(getMessage(%22DbConnectionForm.database%22),database);%0A%09%09fb.row();%0A%09%09fb.add(getMessage(%22DbConnectionForm.host%22),host);%0A%09%09fb.row();%0A%09%09fb.add(getMessage(%22DbConnectionForm.port%22), port);%0A%09%09fb.row();%0A%09%09fb.add(getMessage(%22DbConnectionForm.dbName%22), dbName);%0A%09%09%0A%09%09JComponent c = fb.getForm();%0A%09%09c.setBorder(FormUtils.createTitledBorder(getMessage(%22DbConnectionForm.title%22)));%0A%09%09%0A%09%09return c;%0A%09%7D%0A%09%0A%09/**%0A%09 * Test Method%0A%09 * @param args none%0A%09 */%0A%09public static void main(String%5B%5D args) %7B%0A%09%09JFrame f = new JFrame();%0A%09%09DbConnectionForm dbf = new DbConnectionForm(new DbConnection());%0A%09%09f.add(dbf.getPanel());%0A%09%09f.setSize(new Dimension(600,400));%0A%09%09f.setVisible(true);%0A%09%7D%0A%0A%7D%0A

Add a Form for database connections