|
|
|
@ -13,6 +13,8 @@ import com.fr.design.ExtraDesignClassManager;
|
|
|
|
|
import com.fr.design.data.MapCompareUtils; |
|
|
|
|
import com.fr.design.data.datapane.preview.ConnectionInfoBeanHelper; |
|
|
|
|
import com.fr.design.dialog.BasicDialog; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.editlock.EditLockUtils; |
|
|
|
|
import com.fr.design.fun.ConnectionProvider; |
|
|
|
|
import com.fr.design.gui.controlpane.JListControlPane; |
|
|
|
|
import com.fr.design.gui.controlpane.NameObjectCreator; |
|
|
|
@ -26,6 +28,7 @@ import com.fr.license.database.DBTypes;
|
|
|
|
|
import com.fr.license.database.DataBaseTypePointManager; |
|
|
|
|
import com.fr.license.exception.DataBaseNotSupportedException; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.report.LockItem; |
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
import com.fr.stable.Nameable; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
@ -36,6 +39,7 @@ import com.fr.workspace.server.entity.connection.ConnectionBean;
|
|
|
|
|
import com.fr.workspace.server.repository.connection.ConnectionRepository; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
|
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.SwingWorker; |
|
|
|
|
import java.awt.Window; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
@ -366,18 +370,24 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void showDialog(Window parent) { |
|
|
|
|
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); |
|
|
|
|
final ConnectionManagerPane connectionManagerPane = new ConnectionManagerPane() { |
|
|
|
|
@Override |
|
|
|
|
public void complete() { |
|
|
|
|
populate(connectionMap); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
final BasicDialog connectionListDialog = connectionManagerPane.showLargeWindow(parent, null); |
|
|
|
|
connectionListDialog.addDialogActionListener(new ConnectionListDialogActionAdapter(connectionManagerPane, connectionListDialog, connectionMap)); |
|
|
|
|
connectionListDialog.setVisible(true); |
|
|
|
|
try { |
|
|
|
|
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); |
|
|
|
|
final ConnectionManagerPane connectionManagerPane = new ConnectionManagerPane() { |
|
|
|
|
@Override |
|
|
|
|
public void complete() { |
|
|
|
|
populate(connectionMap); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
final BasicDialog connectionListDialog = connectionManagerPane.showLargeWindow(parent, null); |
|
|
|
|
connectionListDialog.addDialogActionListener(new ConnectionListDialogActionAdapter(connectionManagerPane, connectionListDialog, connectionMap)); |
|
|
|
|
connectionListDialog.setVisible(true); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Remote_Data_Error"), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE); |
|
|
|
|
EditLockUtils.unlock(LockItem.CONNECTION); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|