@ -14,6 +14,7 @@ import com.fr.data.solution.entity.DriverPage;
import com.fr.data.solution.processor.ClassNotFoundExceptionSolutionProcessor ;
import com.fr.data.solution.processor.ClassNotFoundExceptionSolutionProcessor ;
import com.fr.data.solution.processor.SolutionProcessor ;
import com.fr.data.solution.processor.SolutionProcessor ;
import com.fr.design.beans.BasicBeanPane ;
import com.fr.design.beans.BasicBeanPane ;
import com.fr.design.dialog.FineJOptionPane ;
import com.fr.design.gui.ibutton.UIButton ;
import com.fr.design.gui.ibutton.UIButton ;
import com.fr.design.gui.icombobox.UIComboBox ;
import com.fr.design.gui.icombobox.UIComboBox ;
import com.fr.design.gui.icontainer.UIScrollPane ;
import com.fr.design.gui.icontainer.UIScrollPane ;
@ -25,6 +26,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory ;
import com.fr.log.FineLoggerFactory ;
import com.fr.rpc.ExceptionHandler ;
import com.fr.rpc.ExceptionHandler ;
import com.fr.rpc.RPCInvokerExceptionInfo ;
import com.fr.rpc.RPCInvokerExceptionInfo ;
import com.fr.security.SecurityConfig ;
import com.fr.stable.ArrayUtils ;
import com.fr.stable.ArrayUtils ;
import com.fr.stable.EncodeConstants ;
import com.fr.stable.EncodeConstants ;
import com.fr.stable.StringUtils ;
import com.fr.stable.StringUtils ;
@ -42,6 +44,7 @@ import javax.swing.SwingConstants;
import javax.swing.SwingUtilities ;
import javax.swing.SwingUtilities ;
import javax.swing.SwingWorker ;
import javax.swing.SwingWorker ;
import javax.swing.UIManager ;
import javax.swing.UIManager ;
import javax.swing.JOptionPane ;
import javax.swing.event.ChangeEvent ;
import javax.swing.event.ChangeEvent ;
import javax.swing.event.ChangeListener ;
import javax.swing.event.ChangeListener ;
import java.awt.BorderLayout ;
import java.awt.BorderLayout ;
@ -95,7 +98,11 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
@Override
@Override
public void actionPerformed ( ActionEvent evt ) {
public void actionPerformed ( ActionEvent evt ) {
if ( mainPanel instanceof JNDIDefPane & & SecurityConfig . getInstance ( ) . isDisableJNDI ( ) ) {
FineJOptionPane . showMessageDialog ( mainPanel , Toolkit . i18nText ( "Fine-Design_Basic_Database_Connection_JNDI_Disabled" ) ,
Toolkit . i18nText ( "Fine-Design_Basic_Error" ) , JOptionPane . ERROR_MESSAGE ) ;
return ;
}
// Try the java connection.
// Try the java connection.
final SwingWorker < Void , Void > connectionThread = new TestConnectionWorker ( ) ;
final SwingWorker < Void , Void > connectionThread = new TestConnectionWorker ( ) ;
midPane . setVisible ( false ) ;
midPane . setVisible ( false ) ;
@ -493,7 +500,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
driverTips . setText ( Toolkit . i18nText ( "Fine_Designer_Not_Found_Driver" ) ) ;
driverTips . setText ( Toolkit . i18nText ( "Fine_Designer_Not_Found_Driver" ) ) ;
gridJpanel . add ( driverTips ) ;
gridJpanel . add ( driverTips ) ;
UILabel deatail = new UILabel ( ) ;
UILabel deatail = new UILabel ( ) ;
String content = Toolkit . i18nText ( "Fine_Designer_Not_Found" ) + " " + detailMessage + " " + Toolkit . i18nText ( "Fine_Designer_Driver" ) ;
String content = Toolkit . i18nText ( "Fine_Designer_Not_Found" ) + " " + detailMessage + " " + Toolkit . i18nText ( "Fine_Designer_Driver" ) ;
deatail . setText ( content ) ;
deatail . setText ( content ) ;
deatail . setToolTipText ( content ) ;
deatail . setToolTipText ( content ) ;
gridJpanel . add ( deatail ) ;
gridJpanel . add ( deatail ) ;
@ -538,7 +545,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
jsp . setHorizontalScrollBarPolicy ( JScrollPane . HORIZONTAL_SCROLLBAR_AS_NEEDED ) ;
jsp . setHorizontalScrollBarPolicy ( JScrollPane . HORIZONTAL_SCROLLBAR_AS_NEEDED ) ;
Connection con = DatabaseConnectionPane . this . updateBean ( ) ;
Connection con = DatabaseConnectionPane . this . updateBean ( ) ;
if ( con instanceof JDBCDatabaseConnection & & WorkContext . getCurrent ( ) . isLocal ( ) ) {
if ( con instanceof JDBCDatabaseConnection & & WorkContext . getCurrent ( ) . isLocal ( ) ) {
String driverPath = JarFileParseUtil . getDriverClassPath ( ( JDBCDatabaseConnection ) con ) ;
String driverPath = JarFileParseUtil . getDriverClassPath ( ( JDBCDatabaseConnection ) con ) ;
jta . append ( Toolkit . i18nText ( "Fine_Designer_Current_Driver_Path" ) + ":" + driverPath + "\n" ) ;
jta . append ( Toolkit . i18nText ( "Fine_Designer_Current_Driver_Path" ) + ":" + driverPath + "\n" ) ;
JPanel testDriverPanel = generateTestDriverPanel ( ( JDBCDatabaseConnection ) con , driverPath ) ;
JPanel testDriverPanel = generateTestDriverPanel ( ( JDBCDatabaseConnection ) con , driverPath ) ;
@ -581,16 +588,17 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
public void mouseExited ( MouseEvent e ) {
public void mouseExited ( MouseEvent e ) {
driverTestTip . setCursor ( Cursor . getDefaultCursor ( ) ) ;
driverTestTip . setCursor ( Cursor . getDefaultCursor ( ) ) ;
}
}
@Override
@Override
public void mouseClicked ( MouseEvent e ) {
public void mouseClicked ( MouseEvent e ) {
try {
try {
String path ;
String path ;
if ( driverPath . endsWith ( JarFileParseUtil . JAR_MARKER ) ) {
if ( driverPath . endsWith ( JarFileParseUtil . JAR_MARKER ) ) {
path = new File ( driverPath ) . getParent ( ) ;
path = new File ( driverPath ) . getParent ( ) ;
} else {
} else {
path = driverPath ;
path = driverPath ;
}
}
if ( hasDuplicateDriver ( con . getDriver ( ) , path ) ) {
if ( hasDuplicateDriver ( con . getDriver ( ) , path ) ) {
testResult . setForeground ( Color . RED ) ;
testResult . setForeground ( Color . RED ) ;
testResult . setText ( Toolkit . i18nText ( "Fine_Designer_Driver_Conflict" ) ) ;
testResult . setText ( Toolkit . i18nText ( "Fine_Designer_Driver_Conflict" ) ) ;
} else {
} else {