📄 configurationpanel.java
字号:
/******************************************************************************
* The contents of this file are subject to the Compiere License Version 1.1
* ("License"); You may not use this file except in compliance with the License
* You may obtain a copy of the License at http://www.compiere.org/license.html
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
* Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
* are Copyright (C) 1999-2005 Jorg Janke.
* All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved.
* Contributor(s): ______________________________________.
*****************************************************************************/
package org.compiere.install;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.util.logging.*;
import javax.swing.*;
import org.apache.tools.ant.*;
import org.compiere.*;
import org.compiere.apps.*;
import org.compiere.swing.*;
import org.compiere.util.*;
/**
* Configuration Panel
*
* @author Jorg Janke
* @version $Id: ConfigurationPanel.java,v 1.22 2005/11/14 02:29:10 jjanke Exp $
*/
public class ConfigurationPanel extends CPanel implements ActionListener
{
/**
* Constructor
* @param statusBar for info
*/
public ConfigurationPanel (JLabel statusBar)
{
m_statusBar = statusBar;
try
{
jbInit();
}
catch (Exception e)
{
e.printStackTrace();
System.exit(1);
}
} // ConfigurationPanel
/** Error Info */
private String m_errorString;
/** Test Success */
private volatile boolean m_success = false;
/** Sync */
private volatile boolean m_testing = false;
/** Translation */
static ResourceBundle res = ResourceBundle.getBundle("org.compiere.install.SetupRes");
/** Setup Frame */
private Setup m_setup = null;
/** Status Bar */
private JLabel m_statusBar;
/** Configuration Data */
private ConfigurationData m_data = new ConfigurationData(this);
private static ImageIcon iOpen = new ImageIcon(ConfigurationPanel.class.getResource("openFile.gif"));
private static ImageIcon iSave = new ImageIcon(Compiere.class.getResource("images/Save16.gif"));
private static ImageIcon iHelp = new ImageIcon(Compiere.class.getResource("images/Help16.gif"));
// ------------- Static UI
private GridBagLayout gridBagLayout = new GridBagLayout();
private static final int FIELDLENGTH = 15;
// Java
private CLabel lJavaHome = new CLabel();
CTextField fJavaHome = new CTextField(FIELDLENGTH);
CCheckBox okJavaHome = new CCheckBox();
private CButton bJavaHome = new CButton(iOpen);
private CLabel lJavaType = new CLabel();
CComboBox fJavaType = new CComboBox(ConfigurationData.JAVATYPE);
// Compiere - KeyStore
private CLabel lCompiereHome = new CLabel();
CTextField fCompiereHome = new CTextField(FIELDLENGTH);
CCheckBox okCompiereHome = new CCheckBox();
private CButton bCompiereHome = new CButton(iOpen);
private CLabel lKeyStore = new CLabel();
CPassword fKeyStore = new CPassword();
CCheckBox okKeyStore = new CCheckBox();
// Apps Server - Type
CLabel lAppsServer = new CLabel();
CTextField fAppsServer = new CTextField(FIELDLENGTH);
CCheckBox okAppsServer = new CCheckBox();
private CLabel lAppsType = new CLabel();
CComboBox fAppsType = new CComboBox(ConfigurationData.APPSTYPE);
// Deployment Directory - JNP
private CLabel lDeployDir = new CLabel();
CTextField fDeployDir = new CTextField(FIELDLENGTH);
CCheckBox okDeployDir = new CCheckBox();
CButton bDeployDir = new CButton(iOpen);
private CLabel lJNPPort = new CLabel();
CTextField fJNPPort = new CTextField(FIELDLENGTH);
CCheckBox okJNPPort = new CCheckBox();
// Web Ports
private CLabel lWebPort = new CLabel();
CTextField fWebPort = new CTextField(FIELDLENGTH);
CCheckBox okWebPort = new CCheckBox();
private CLabel lSSLPort = new CLabel();
CTextField fSSLPort = new CTextField(FIELDLENGTH);
CCheckBox okSSLPort = new CCheckBox();
// Database
private CLabel lDatabaseType = new CLabel();
CComboBox fDatabaseType = new CComboBox(ConfigurationData.DBTYPE);
//
CLabel lDatabaseServer = new CLabel();
CTextField fDatabaseServer = new CTextField(FIELDLENGTH);
private CLabel lDatabaseName = new CLabel();
CTextField fDatabaseName = new CTextField(FIELDLENGTH);
private CLabel lDatabaseDiscovered = new CLabel();
CComboBox fDatabaseDiscovered = new CComboBox();
private CLabel lDatabasePort = new CLabel();
CTextField fDatabasePort = new CTextField(FIELDLENGTH);
private CLabel lSystemPassword = new CLabel();
CPassword fSystemPassword = new CPassword();
private CLabel lDatabaseUser = new CLabel();
CTextField fDatabaseUser = new CTextField(FIELDLENGTH);
private CLabel lDatabasePassword = new CLabel();
CPassword fDatabasePassword = new CPassword();
CCheckBox okDatabaseServer = new CCheckBox();
CCheckBox okDatabaseUser = new CCheckBox();
CCheckBox okDatabaseSystem = new CCheckBox();
CCheckBox okDatabaseSQL = new CCheckBox();
//
CLabel lMailServer = new CLabel();
CTextField fMailServer = new CTextField(FIELDLENGTH);
private CLabel lAdminEMail = new CLabel();
CTextField fAdminEMail = new CTextField(FIELDLENGTH);
private CLabel lMailUser = new CLabel();
CTextField fMailUser = new CTextField(FIELDLENGTH);
private CLabel lMailPassword = new CLabel();
CPassword fMailPassword = new CPassword();
CCheckBox okMailServer = new CCheckBox();
CCheckBox okMailUser = new CCheckBox();
//
private CButton bHelp = new CButton(iHelp);
private CButton bTest = new CButton();
private CButton bSave = new CButton(iSave);
/**
* Static Layout Init
* @throws Exception
*/
private void jbInit() throws Exception
{
this.setLayout(gridBagLayout);
Insets bInsets = new Insets(0, 5, 0, 5);
// Java
lJavaHome.setToolTipText(res.getString("JavaHomeInfo"));
lJavaHome.setText(res.getString("JavaHome"));
fJavaHome.setText(".");
okJavaHome.setEnabled(false);
bJavaHome.setMargin(bInsets);
bJavaHome.setToolTipText(res.getString("JavaHomeInfo"));
lJavaType.setToolTipText(res.getString("JavaTypeInfo"));
lJavaType.setText(res.getString("JavaType"));
fJavaType.setPreferredSize(fJavaHome.getPreferredSize());
this.add(lJavaHome, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.add(fJavaHome, new GridBagConstraints(1, 0, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
this.add(okJavaHome, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.add(bJavaHome, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
this.add(lJavaType, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.add(fJavaType, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
// CompiereHome - KeyStore
lCompiereHome.setToolTipText(res.getString("CompiereHomeInfo"));
lCompiereHome.setText(res.getString("CompiereHome"));
fCompiereHome.setText(".");
okCompiereHome.setEnabled(false);
bCompiereHome.setMargin(bInsets);
bCompiereHome.setToolTipText(res.getString("CompiereHomeInfo"));
lKeyStore.setText(res.getString("KeyStorePassword"));
lKeyStore.setToolTipText(res.getString("KeyStorePasswordInfo"));
fKeyStore.setText("");
okKeyStore.setEnabled(false);
this.add(lCompiereHome, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.add(fCompiereHome, new GridBagConstraints(1, 1, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
this.add(okCompiereHome, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.add(bCompiereHome, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
this.add(lKeyStore, new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
this.add(fKeyStore, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
this.add(okKeyStore, new GridBagConstraints(6, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
// Apps Server - Type
lAppsServer.setToolTipText(res.getString("AppsServerInfo"));
lAppsServer.setText(res.getString("AppsServer"));
lAppsServer.setFont(lAppsServer.getFont().deriveFont(Font.BOLD));
fAppsServer.setText(".");
okAppsServer.setEnabled(false);
lAppsType.setToolTipText(res.getString("AppsTypeInfo"));
lAppsType.setText(res.getString("AppsType"));
fAppsType.setPreferredSize(fAppsServer.getPreferredSize());
this.add(lAppsServer, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 5, 5, 5), 0, 0));
this.add(fAppsServer, new GridBagConstraints(1, 2, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 5, 5, 0), 0, 0));
this.add(okAppsServer, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 0, 5, 5), 0, 0));
this.add(lAppsType, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 5, 5, 5), 0, 0));
this.add(fAppsType, new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 5, 5, 0), 0, 0));
// Deployment - JNP
lDeployDir.setToolTipText(res.getString("DeployDirInfo"));
lDeployDir.setText(res.getString("DeployDir"));
fDeployDir.setText(".");
okDeployDir.setEnabled(false);
bDeployDir.setMargin(bInsets);
bDeployDir.setToolTipText(res.getString("DeployDirInfo"));
lJNPPort.setToolTipText(res.getString("JNPPortInfo"));
lJNPPort.setText(res.getString("JNPPort"));
fJNPPort.setText(".");
okJNPPort.setEnabled(false);
this.add(lDeployDir, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.add(fDeployDir, new GridBagConstraints(1, 3, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
this.add(okDeployDir, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.add(bDeployDir, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
this.add(lJNPPort, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.add(fJNPPort, new GridBagConstraints(5, 3, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
this.add(okJNPPort, new GridBagConstraints(6, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// Web Ports
lWebPort.setToolTipText(res.getString("WebPortInfo"));
lWebPort.setText(res.getString("WebPort"));
fWebPort.setText(".");
okWebPort.setEnabled(false);
lSSLPort.setText("SSL");
fSSLPort.setText(".");
okSSLPort.setEnabled(false);
this.add(lWebPort, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.add(fWebPort, new GridBagConstraints(1, 4, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
this.add(okWebPort, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.add(lSSLPort, new GridBagConstraints(4, 4, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.add(fSSLPort, new GridBagConstraints(5, 4, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
this.add(okSSLPort, new GridBagConstraints(6, 4, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// Database Server - Type
lDatabaseServer.setToolTipText(res.getString("DatabaseServerInfo"));
lDatabaseServer.setText(res.getString("DatabaseServer"));
lDatabaseServer.setFont(lDatabaseServer.getFont().deriveFont(Font.BOLD));
okDatabaseServer.setEnabled(false);
lDatabaseType.setToolTipText(res.getString("DatabaseTypeInfo"));
lDatabaseType.setText(res.getString("DatabaseType"));
fDatabaseType.setPreferredSize(fDatabaseServer.getPreferredSize());
this.add(lDatabaseServer, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 5, 5, 5), 0, 0));
this.add(fDatabaseServer, new GridBagConstraints(1, 5, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 5, 5, 0), 0, 0));
this.add(okDatabaseServer, new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 0, 5, 5), 0, 0));
this.add(lDatabaseType, new GridBagConstraints(4, 5, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 5, 5, 5), 0, 0));
this.add(fDatabaseType, new GridBagConstraints(5, 5, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 5, 5, 0), 0, 0));
// DB Name - TNS
lDatabaseName.setToolTipText(res.getString("DatabaseNameInfo"));
lDatabaseName.setText(res.getString("DatabaseName"));
fDatabaseName.setText(".");
lDatabaseDiscovered.setToolTipText(res.getString("TNSNameInfo"));
lDatabaseDiscovered.setText(res.getString("TNSName"));
fDatabaseDiscovered.setEditable(true);
fDatabaseDiscovered.setPreferredSize(fDatabaseName.getPreferredSize());
okDatabaseSQL.setEnabled(false);
this.add(lDatabaseName, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
this.add(fDatabaseName, new GridBagConstraints(1, 6, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
this.add(okDatabaseSQL, new GridBagConstraints(2, 6, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.add(lDatabaseDiscovered, new GridBagConstraints(4, 6, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
this.add(fDatabaseDiscovered, new GridBagConstraints(5, 6, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 0), 0, 0));
// Port - System
lDatabasePort.setToolTipText(res.getString("DatabasePortInfo"));
lDatabasePort.setText(res.getString("DatabasePort"));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -