|
|
@ -4,6 +4,7 @@ import com.fanruan.api.conf.ConfigurationKit; |
|
|
|
import com.fanruan.api.design.DesignKit; |
|
|
|
import com.fanruan.api.design.DesignKit; |
|
|
|
import com.fanruan.api.design.ui.component.UIActionLabel; |
|
|
|
import com.fanruan.api.design.ui.component.UIActionLabel; |
|
|
|
import com.fanruan.api.design.ui.component.UIButton; |
|
|
|
import com.fanruan.api.design.ui.component.UIButton; |
|
|
|
|
|
|
|
import com.fanruan.api.design.ui.component.UICheckBox; |
|
|
|
import com.fanruan.api.design.ui.component.UILabel; |
|
|
|
import com.fanruan.api.design.ui.component.UILabel; |
|
|
|
import com.fanruan.api.design.ui.component.UIPasswordField; |
|
|
|
import com.fanruan.api.design.ui.component.UIPasswordField; |
|
|
|
import com.fanruan.api.design.ui.component.UITextField; |
|
|
|
import com.fanruan.api.design.ui.component.UITextField; |
|
|
@ -31,6 +32,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon |
|
|
|
private UITextField hostTextField; |
|
|
|
private UITextField hostTextField; |
|
|
|
private UITextField portNumberField; |
|
|
|
private UITextField portNumberField; |
|
|
|
private UIPasswordField passwordTextField; |
|
|
|
private UIPasswordField passwordTextField; |
|
|
|
|
|
|
|
private UICheckBox clusterModeCheckBox; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -40,7 +42,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon |
|
|
|
hostTextField = new UITextField(); |
|
|
|
hostTextField = new UITextField(); |
|
|
|
portNumberField = new UITextField(); |
|
|
|
portNumberField = new UITextField(); |
|
|
|
passwordTextField = new UIPasswordField(); |
|
|
|
passwordTextField = new UIPasswordField(); |
|
|
|
|
|
|
|
clusterModeCheckBox = new UICheckBox(DesignKit.i18nText("Plugin-Redis_Cluster_Mode"), false); |
|
|
|
|
|
|
|
|
|
|
|
JPanel globalConfigPane = new JPanel(); |
|
|
|
JPanel globalConfigPane = new JPanel(); |
|
|
|
GridLayout gridLayout = new GridLayout(1, 2); |
|
|
|
GridLayout gridLayout = new GridLayout(1, 2); |
|
|
@ -63,7 +65,11 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Redis_Host") + ":"), |
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Redis_Host") + ":"), |
|
|
|
GUICoreKit.createBorderLayoutPane(hostTextField, BorderLayout.CENTER, helpButton, BorderLayout.EAST)}, |
|
|
|
GUICoreKit.createBorderLayoutPane(hostTextField, BorderLayout.CENTER, |
|
|
|
|
|
|
|
GUICoreKit.createBorderLayoutPane( |
|
|
|
|
|
|
|
clusterModeCheckBox, BorderLayout.CENTER, |
|
|
|
|
|
|
|
helpButton, BorderLayout.EAST |
|
|
|
|
|
|
|
), BorderLayout.EAST)}, |
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Redis_Port") + ":"), portNumberField}, |
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Redis_Port") + ":"), portNumberField}, |
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Redis_Password") + ":"), passwordTextField}, |
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Redis_Password") + ":"), passwordTextField}, |
|
|
|
{null, globalConfigPane} |
|
|
|
{null, globalConfigPane} |
|
|
@ -135,6 +141,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon |
|
|
|
hostTextField.setText(ob.getHost()); |
|
|
|
hostTextField.setText(ob.getHost()); |
|
|
|
portNumberField.setText(ob.getPort()); |
|
|
|
portNumberField.setText(ob.getPort()); |
|
|
|
passwordTextField.setText(ob.getPassword()); |
|
|
|
passwordTextField.setText(ob.getPassword()); |
|
|
|
|
|
|
|
clusterModeCheckBox.setSelected(ob.isCluster()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -143,6 +150,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon |
|
|
|
connection.setHost(hostTextField.getText()); |
|
|
|
connection.setHost(hostTextField.getText()); |
|
|
|
connection.setPort(portNumberField.getText()); |
|
|
|
connection.setPort(portNumberField.getText()); |
|
|
|
connection.setPassword(passwordTextField.getText()); |
|
|
|
connection.setPassword(passwordTextField.getText()); |
|
|
|
|
|
|
|
connection.setCluster(clusterModeCheckBox.isSelected()); |
|
|
|
return connection; |
|
|
|
return connection; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|