Browse Source

feat:插件内的方法替换为finekit中的

paid
zjz1993 5 years ago
parent
commit
8aaba80292
  1. BIN
      lib/finekit-10.0-20190828.jar
  2. 2
      src/main/java/com/fr/plugin/db/redis/RedisConnectionImpl.java
  3. 4
      src/main/java/com/fr/plugin/db/redis/RedisScriptTableDataDefine.java
  4. 7
      src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManager.java
  5. 12
      src/main/java/com/fr/plugin/db/redis/core/DataWrapper.java
  6. 36
      src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java
  7. 14
      src/main/java/com/fr/plugin/db/redis/core/RedisNode.java
  8. 14
      src/main/java/com/fr/plugin/db/redis/core/RedisPool.java
  9. 6
      src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java
  10. 12
      src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java
  11. 10
      src/main/java/com/fr/plugin/db/redis/core/RedisTableDataModel.java
  12. 4
      src/main/java/com/fr/plugin/db/redis/core/order/OrderValue.java
  13. 15
      src/main/java/com/fr/plugin/db/redis/core/order/impl/FormulaOrderValue.java
  14. 16
      src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java
  15. 4
      src/main/java/com/fr/plugin/db/redis/core/visit/AbstractVisitor.java
  16. 4
      src/main/java/com/fr/plugin/db/redis/core/visit/impl/MGetVisitor.java
  17. 7
      src/main/java/com/fr/plugin/db/redis/help/Console.java
  18. 7
      src/main/java/com/fr/plugin/db/redis/help/client/BaseRedisClient.java
  19. 18
      src/main/java/com/fr/plugin/db/redis/help/client/RedisNashornClient.java
  20. 16
      src/main/java/com/fr/plugin/db/redis/help/client/RedisV8Client.java
  21. 19
      src/main/java/com/fr/plugin/db/redis/ui/RedisBaseTableDataPane.java
  22. 21
      src/main/java/com/fr/plugin/db/redis/ui/RedisDBConnectionChosePane.java
  23. 18
      src/main/java/com/fr/plugin/db/redis/ui/RedisQueryPane.java
  24. 12
      src/main/java/com/fr/plugin/db/redis/ui/RedisScriptPane.java
  25. 4
      src/main/java/com/fr/plugin/db/redis/ui/RedisScriptTableDataPane.java
  26. 4
      src/main/java/com/fr/plugin/db/redis/ui/RedisTableDataPane.java
  27. 12
      src/main/java/com/fr/plugin/db/redis/ui/pool/RedisConnectionPoolConfigPane.java
  28. 17
      src/main/java/com/fr/plugin/db/redis/ui/proxy/RedisConnectionProxyConfigPane.java

BIN
lib/finekit-10.0-20190828.jar

Binary file not shown.

2
src/main/java/com/fr/plugin/db/redis/RedisConnectionImpl.java

@ -6,7 +6,7 @@ import com.fr.design.fun.impl.AbstractConnectionProvider;
import com.fr.plugin.db.redis.core.RedisDatabaseConnection; import com.fr.plugin.db.redis.core.RedisDatabaseConnection;
import com.fr.plugin.db.redis.ui.RedisConnectionPane; import com.fr.plugin.db.redis.ui.RedisConnectionPane;
public class RedisConnectionImpl extends AbstractConnectionProvider { public class RedisConnectionImpl extends AbstractConnectionProvider {
@Override @Override
public int currentAPILevel() { public int currentAPILevel() {

4
src/main/java/com/fr/plugin/db/redis/RedisScriptTableDataDefine.java

@ -4,9 +4,9 @@ import com.fr.base.TableData;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.fun.ServerTableDataDefineProvider; import com.fr.design.fun.ServerTableDataDefineProvider;
import com.fr.design.fun.impl.AbstractTableDataDefineProvider; import com.fr.design.fun.impl.AbstractTableDataDefineProvider;
import com.fr.locale.InterProviderFactory;
import com.fr.plugin.db.redis.core.RedisScriptTableData; import com.fr.plugin.db.redis.core.RedisScriptTableData;
import com.fr.plugin.db.redis.ui.RedisScriptTableDataPane; import com.fr.plugin.db.redis.ui.RedisScriptTableDataPane;
import com.fanruan.api.i18n.I18nKit;
/** /**
* @author richie * @author richie
@ -37,7 +37,7 @@ public class RedisScriptTableDataDefine extends AbstractTableDataDefineProvider
@Override @Override
public String nameForTableData() { public String nameForTableData() {
return InterProviderFactory.getProvider().getLocText("Plugin-Redis_Script_Table_Data"); return I18nKit.getLocText("Plugin-Redis_Script_Table_Data");
} }
@Override @Override

7
src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManager.java

@ -1,9 +1,10 @@
package com.fr.plugin.db.redis.conf; package com.fr.plugin.db.redis.conf;
import com.fr.file.XMLFileManager; import com.fanruan.api.xml.XmlKit;
import com.fanruan.api.xml.comopnent.XMLFileManager;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.stable.EnvChangedListener; import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
@ -65,7 +66,7 @@ public class ShellConfigManager extends XMLFileManager implements ShellConfigMan
@Override @Override
public void readXML(XMLableReader reader) { public void readXML(XMLableReader reader) {
if (reader.isAttr()) { if (reader.isAttr()) {
shellText = reader.getAttrAsString("shell", StringUtils.EMPTY); shellText = reader.getAttrAsString("shell", StringKit.EMPTY);
} }
} }

12
src/main/java/com/fr/plugin/db/redis/core/DataWrapper.java

@ -1,10 +1,10 @@
package com.fr.plugin.db.redis.core; package com.fr.plugin.db.redis.core;
import com.fr.general.GeneralUtils; import com.fanruan.api.util.GeneralKit;
import com.fanruan.api.log.LogKit;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.script.ScriptFactory; import com.fr.script.ScriptFactory;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import javax.script.ScriptEngine; import javax.script.ScriptEngine;
@ -46,7 +46,7 @@ public class DataWrapper<T> {
} }
public void transform(String script) throws ScriptException { public void transform(String script) throws ScriptException {
if (StringUtils.isBlank(script)) { if (StringKit.isBlank(script)) {
return; return;
} }
String scriptText = null; String scriptText = null;
@ -55,7 +55,7 @@ public class DataWrapper<T> {
FileInputStream in = new FileInputStream(new File(readAndRenderScriptFile(script))); FileInputStream in = new FileInputStream(new File(readAndRenderScriptFile(script)));
scriptText = IOUtils.inputStream2String(in); scriptText = IOUtils.inputStream2String(in);
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); LogKit.error(e.getMessage(), e);
} }
} else { } else {
scriptText = String.format("(function(){%s})()", script); scriptText = String.format("(function(){%s})()", script);
@ -70,7 +70,7 @@ public class DataWrapper<T> {
Object vector = map.get("column"); Object vector = map.get("column");
List<String> names = new ArrayList<String>(); List<String> names = new ArrayList<String>();
for (Object name : ((Map)vector).values()) { for (Object name : ((Map)vector).values()) {
names.add(GeneralUtils.objectToString(name)); names.add(GeneralKit.objectToString(name));
} }
columnNames = names.toArray(new String[0]); columnNames = names.toArray(new String[0]);
Object content = map.get("content"); Object content = map.get("content");

36
src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java

@ -5,12 +5,12 @@ import com.fr.config.holder.factory.Holders;
import com.fr.config.holder.impl.ColConf; import com.fr.config.holder.impl.ColConf;
import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.locale.InterProviderFactory; import com.fanruan.api.i18n.I18nKit;
import com.fr.plugin.db.redis.core.emb.Redis; import com.fr.plugin.db.redis.core.emb.Redis;
import com.fr.security.SecurityToolbox; import com.fanruan.api.security.SecurityKit;
import com.fr.stable.ArrayUtils; import com.fanruan.api.util.ArrayKit;
import com.fr.stable.StableUtils; import com.fanruan.api.util.ReflectKit;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import com.fr.third.redis.clients.jedis.Jedis; import com.fr.third.redis.clients.jedis.Jedis;
@ -24,9 +24,9 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection {
private static final int DEFAULT_REDIS_PORT = 6379; private static final int DEFAULT_REDIS_PORT = 6379;
private Conf<String> host = Holders.simple(StringUtils.EMPTY); private Conf<String> host = Holders.simple(StringKit.EMPTY);
private Conf<Integer> port = Holders.simple(DEFAULT_REDIS_PORT); private Conf<Integer> port = Holders.simple(DEFAULT_REDIS_PORT);
private Conf<String> password = Holders.simple(StringUtils.EMPTY); private Conf<String> password = Holders.simple(StringKit.EMPTY);
public RedisDatabaseConnection() { public RedisDatabaseConnection() {
@ -82,8 +82,8 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection {
@Override @Override
public String[] summary(String... args) { public String[] summary(String... args) {
if (ArrayUtils.isEmpty(args)) { if (ArrayKit.isEmpty(args)) {
return ArrayUtils.EMPTY_STRING_ARRAY; return ArrayKit.EMPTY_STRING_ARRAY;
} else { } else {
Redis redis = createRedisClient(); Redis redis = createRedisClient();
Set<String> keys = redis.getClient().keys(args[0]); Set<String> keys = redis.getClient().keys(args[0]);
@ -96,16 +96,16 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection {
@Override @Override
public String connectMessage(boolean status) { public String connectMessage(boolean status) {
if (status) { if (status) {
return InterProviderFactory.getProvider().getLocText("Plugin-Redis_Connection_Successfully") + "!"; return I18nKit.getLocText("Plugin-Redis_Connection_Successfully") + "!";
} else { } else {
return InterProviderFactory.getProvider().getLocText("Plugin-Redis_Connection_Failed") + "!"; return I18nKit.getLocText("Plugin-Redis_Connection_Failed") + "!";
} }
} }
@Override @Override
public void addConnection(List<String> list, String connectionName, Class<? extends Connection>[] acceptTypes) { public void addConnection(List<String> list, String connectionName, Class<? extends Connection>[] acceptTypes) {
for (Class<? extends com.fr.data.impl.Connection> accept : acceptTypes) { for (Class<? extends com.fr.data.impl.Connection> accept : acceptTypes) {
if (StableUtils.classInstanceOf(getClass(), accept)) { if (ReflectKit.classInstanceOf(getClass(), accept)) {
list.add(connectionName); list.add(connectionName);
break; break;
} }
@ -143,11 +143,11 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection {
if (reader.isChildNode()) { if (reader.isChildNode()) {
String tagName = reader.getTagName(); String tagName = reader.getTagName();
if ("Attr".equals(tagName)) { if ("Attr".equals(tagName)) {
setHost(reader.getAttrAsString("host", StringUtils.EMPTY)); setHost(reader.getAttrAsString("host", StringKit.EMPTY));
setPort(reader.getAttrAsInt("port", DEFAULT_REDIS_PORT)); setPort(reader.getAttrAsInt("port", DEFAULT_REDIS_PORT));
String pwd = reader.getAttrAsString("password", StringUtils.EMPTY); String pwd = reader.getAttrAsString("password", StringKit.EMPTY);
if (StringUtils.isNotEmpty(pwd)) { if (StringKit.isNotEmpty(pwd)) {
setPassword(SecurityToolbox.encrypt(pwd)); setPassword(SecurityKit.encrypt(pwd));
} }
} }
} }
@ -159,8 +159,8 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection {
writer.startTAG("Attr"); writer.startTAG("Attr");
writer.attr("host", getHost()); writer.attr("host", getHost());
writer.attr("port", getPort()); writer.attr("port", getPort());
if (StringUtils.isNotEmpty(getPassword())) { if (StringKit.isNotEmpty(getPassword())) {
writer.attr("password", SecurityToolbox.decrypt(getPassword())); writer.attr("password", SecurityKit.decrypt(getPassword()));
} }
writer.end(); writer.end();
} }

14
src/main/java/com/fr/plugin/db/redis/core/RedisNode.java

@ -3,8 +3,8 @@ package com.fr.plugin.db.redis.core;
import com.fr.config.holder.Conf; import com.fr.config.holder.Conf;
import com.fr.config.holder.factory.Holders; import com.fr.config.holder.factory.Holders;
import com.fr.config.utils.UniqueKey; import com.fr.config.utils.UniqueKey;
import com.fr.stable.AssistUtils; import com.fanruan.api.util.AssistKit;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
/** /**
* @author richie * @author richie
@ -15,9 +15,9 @@ public class RedisNode extends UniqueKey {
public static final int DEFAULT_REDIS_PORT = 6379; public static final int DEFAULT_REDIS_PORT = 6379;
private Conf<String> host = Holders.simple(StringUtils.EMPTY); private Conf<String> host = Holders.simple(StringKit.EMPTY);
private Conf<Integer> port = Holders.simple(DEFAULT_REDIS_PORT); private Conf<Integer> port = Holders.simple(DEFAULT_REDIS_PORT);
private Conf<String> password = Holders.simple(StringUtils.EMPTY); private Conf<String> password = Holders.simple(StringKit.EMPTY);
public RedisNode(String host, int port, String password) { public RedisNode(String host, int port, String password) {
this.setHost(host); this.setHost(host);
@ -52,14 +52,14 @@ public class RedisNode extends UniqueKey {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return obj instanceof RedisNode return obj instanceof RedisNode
&& AssistUtils.equals(((RedisNode) obj).getHost(), getHost()) && AssistKit.equals(((RedisNode) obj).getHost(), getHost())
&& ((RedisNode) obj).getPort() == getPort() && ((RedisNode) obj).getPort() == getPort()
&& AssistUtils.equals(((RedisNode) obj).getPassword(), getPassword()); && AssistKit.equals(((RedisNode) obj).getPassword(), getPassword());
} }
@Override @Override
public int hashCode() { public int hashCode() {
return AssistUtils.hashCode(getHost(), getPort(), getPassword()); return AssistKit.hashCode(getHost(), getPort(), getPassword());
} }
@Override @Override

14
src/main/java/com/fr/plugin/db/redis/core/RedisPool.java

@ -2,7 +2,7 @@ package com.fr.plugin.db.redis.core;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.config.holder.ConfigChangeListener; import com.fr.config.holder.ConfigChangeListener;
import com.fr.log.FineLoggerFactory; import com.fanruan.api.log.LogKit;
import com.fr.plugin.db.redis.core.emb.Redis; import com.fr.plugin.db.redis.core.emb.Redis;
import com.fr.plugin.db.redis.core.emb.impl.ProxyRedis; import com.fr.plugin.db.redis.core.emb.impl.ProxyRedis;
import com.fr.plugin.db.redis.core.emb.impl.SimpleRedis; import com.fr.plugin.db.redis.core.emb.impl.SimpleRedis;
@ -11,7 +11,7 @@ import com.fr.plugin.db.redis.core.pool.RedisConnectionProxyConfig;
import com.fr.ssh.jsch.JSch; import com.fr.ssh.jsch.JSch;
import com.fr.ssh.jsch.JSchException; import com.fr.ssh.jsch.JSchException;
import com.fr.ssh.jsch.Session; import com.fr.ssh.jsch.Session;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import com.fr.third.redis.clients.jedis.Jedis; import com.fr.third.redis.clients.jedis.Jedis;
import com.fr.third.redis.clients.jedis.JedisCluster; import com.fr.third.redis.clients.jedis.JedisCluster;
import com.fr.third.redis.clients.jedis.JedisPool; import com.fr.third.redis.clients.jedis.JedisPool;
@ -60,7 +60,7 @@ public class RedisPool {
try { try {
return createJedisBySSH(host, port, password); return createJedisBySSH(host, port, password);
} catch (JSchException e) { } catch (JSchException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); LogKit.error(e.getMessage(), e);
} }
} else { } else {
String feature = host + ":" + port + "@" + password; String feature = host + ":" + port + "@" + password;
@ -109,7 +109,7 @@ public class RedisPool {
config.setTestWhileIdle(false); config.setTestWhileIdle(false);
//逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1 //逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
config.setTimeBetweenEvictionRunsMillis(-1); config.setTimeBetweenEvictionRunsMillis(-1);
if (StringUtils.isNotBlank(password)) { if (StringKit.isNotBlank(password)) {
return new JedisPool(config, host, port, poolConfig.getTimeout(), password); return new JedisPool(config, host, port, poolConfig.getTimeout(), password);
} else { } else {
return new JedisPool(config, host, port, poolConfig.getTimeout()); return new JedisPool(config, host, port, poolConfig.getTimeout());
@ -119,11 +119,11 @@ public class RedisPool {
private Redis createJedisBySSH(String host, int port, String password) throws JSchException { private Redis createJedisBySSH(String host, int port, String password) throws JSchException {
RedisConnectionProxyConfig proxyConfig = RedisConnectionProxyConfig.getInstance(); RedisConnectionProxyConfig proxyConfig = RedisConnectionProxyConfig.getInstance();
JSch jsch = new JSch(); JSch jsch = new JSch();
if (StringUtils.isNotBlank(proxyConfig.getPrivateKeyPath())) { if (StringKit.isNotBlank(proxyConfig.getPrivateKeyPath())) {
jsch.addIdentity(proxyConfig.getPrivateKeyPath()); jsch.addIdentity(proxyConfig.getPrivateKeyPath());
} }
Session session = jsch.getSession(proxyConfig.getUsername(), proxyConfig.getHost(), proxyConfig.getPort()); Session session = jsch.getSession(proxyConfig.getUsername(), proxyConfig.getHost(), proxyConfig.getPort());
if (StringUtils.isNotBlank(proxyConfig.getPassword())) { if (StringKit.isNotBlank(proxyConfig.getPassword())) {
session.setPassword(proxyConfig.getPassword()); session.setPassword(proxyConfig.getPassword());
} }
session.setConfig("StrictHostKeyChecking", "no"); session.setConfig("StrictHostKeyChecking", "no");
@ -133,7 +133,7 @@ public class RedisPool {
Jedis jedis = new Jedis(host, newPort); Jedis jedis = new Jedis(host, newPort);
if (StringUtils.isNotBlank(password)) { if (StringKit.isNotBlank(password)) {
jedis.auth(password); jedis.auth(password);
} }
return new ProxyRedis(session, jedis); return new ProxyRedis(session, jedis);

6
src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java

@ -13,14 +13,14 @@ import com.fr.file.DatasourceManager;
import com.fr.general.data.DataModel; import com.fr.general.data.DataModel;
import com.fr.general.xml.GeneralXMLTools; import com.fr.general.xml.GeneralXMLTools;
import com.fr.intelli.record.Focus; import com.fr.intelli.record.Focus;
import com.fr.log.FineLoggerFactory; import com.fanruan.api.log.LogKit;
import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue; import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue;
import com.fr.plugin.db.redis.util.RedisUtils; import com.fr.plugin.db.redis.util.RedisUtils;
import com.fr.record.analyzer.EnableMetrics; import com.fr.record.analyzer.EnableMetrics;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
@ -36,7 +36,7 @@ public class RedisScriptTableData extends AbstractParameterTableData {
private Conf<Connection> database = Holders.obj(null, Connection.class); private Conf<Connection> database = Holders.obj(null, Connection.class);
private Conf<OrderValue> dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); private Conf<OrderValue> dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG);
private Conf<String> script = Holders.simple(StringUtils.EMPTY); private Conf<String> script = Holders.simple(StringKit.EMPTY);
public void setDatabase(Connection c) { public void setDatabase(Connection c) {
this.database.set(c); this.database.set(c);

12
src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java

@ -15,15 +15,15 @@ import com.fr.general.data.DataModel;
import com.fr.general.xml.GeneralXMLTools; import com.fr.general.xml.GeneralXMLTools;
import com.fr.intelli.record.Focus; import com.fr.intelli.record.Focus;
import com.fr.intelli.record.Original; import com.fr.intelli.record.Original;
import com.fr.log.FineLoggerFactory; import com.fanruan.api.log.LogKit;
import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue; import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue;
import com.fr.plugin.db.redis.util.RedisUtils; import com.fr.plugin.db.redis.util.RedisUtils;
import com.fr.record.analyzer.EnableMetrics; import com.fr.record.analyzer.EnableMetrics;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fanruan.api.util.ArrayKit;
import com.fanruan.api.util.StringKit;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
@ -37,8 +37,8 @@ public class RedisTableData extends AbstractParameterTableData {
private static final long serialVersionUID = 7017455818551800001L; private static final long serialVersionUID = 7017455818551800001L;
private Conf<Connection> database = Holders.obj(null, Connection.class); private Conf<Connection> database = Holders.obj(null, Connection.class);
private Conf<OrderValue> dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); private Conf<OrderValue> dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG);
private Conf<String> query = Holders.simple(StringUtils.EMPTY); private Conf<String> query = Holders.simple(StringKit.EMPTY);
private Conf<String> script = Holders.simple(StringUtils.EMPTY); private Conf<String> script = Holders.simple(StringKit.EMPTY);
public void setDatabase(Connection c) { public void setDatabase(Connection c) {
this.database.set(c); this.database.set(c);
@ -97,7 +97,7 @@ public class RedisTableData extends AbstractParameterTableData {
RedisUtils.calculateQuery(query.get(), ps), RedisUtils.calculateQuery(query.get(), ps),
RedisUtils.calculateQuery(script.get(), ps), RedisUtils.calculateQuery(script.get(), ps),
rowCount); rowCount);
FineLoggerFactory.getLogger().info("Build data model spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Build data model spend time {} ms.", System.currentTimeMillis() - start);
return model; return model;
} }
} }

10
src/main/java/com/fr/plugin/db/redis/core/RedisTableDataModel.java

@ -2,14 +2,14 @@ package com.fr.plugin.db.redis.core;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.data.AbstractDataModel; import com.fr.data.AbstractDataModel;
import com.fr.log.FineLoggerFactory; import com.fanruan.api.log.LogKit;
import com.fr.plugin.PluginLicense; import com.fr.plugin.PluginLicense;
import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.db.redis.core.emb.Redis; import com.fr.plugin.db.redis.core.emb.Redis;
import com.fr.plugin.db.redis.core.visit.VisitorFactory; import com.fr.plugin.db.redis.core.visit.VisitorFactory;
import com.fr.plugin.db.redis.util.RedisUtils; import com.fr.plugin.db.redis.util.RedisUtils;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import com.fr.third.redis.clients.jedis.Jedis; import com.fr.third.redis.clients.jedis.Jedis;
import java.util.List; import java.util.List;
@ -28,16 +28,16 @@ public class RedisTableDataModel extends AbstractDataModel {
} }
private synchronized void initRedisData(Calculator calculator, Parameter[] ps, RedisDatabaseConnection mc, int dbIndex, String query, String script, int rowCount) { private synchronized void initRedisData(Calculator calculator, Parameter[] ps, RedisDatabaseConnection mc, int dbIndex, String query, String script, int rowCount) {
if (StringUtils.isEmpty(query)) { if (StringKit.isEmpty(query)) {
return; return;
} }
Redis redis = mc.createRedisClient(); Redis redis = mc.createRedisClient();
redis.getClient().select(dbIndex); redis.getClient().select(dbIndex);
FineLoggerFactory.getLogger().info("Connect to redis and select database:" + dbIndex); LogKit.info("Connect to redis and select database:" + dbIndex);
try { try {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
DataWrapper<Object> wrapper = VisitorFactory.getKeyValueResult(calculator, ps, redis.getClient(), query, rowCount); DataWrapper<Object> wrapper = VisitorFactory.getKeyValueResult(calculator, ps, redis.getClient(), query, rowCount);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
wrapper.transform(script); wrapper.transform(script);
data = wrapper.getData(); data = wrapper.getData();
columnNames = wrapper.getColumnNames(); columnNames = wrapper.getColumnNames();

4
src/main/java/com/fr/plugin/db/redis/core/order/OrderValue.java

@ -2,7 +2,7 @@ package com.fr.plugin.db.redis.core.order;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.config.utils.UniqueKey; import com.fr.config.utils.UniqueKey;
import com.fr.general.GeneralUtils; import com.fanruan.api.util.GeneralKit;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
@ -36,7 +36,7 @@ public abstract class OrderValue extends UniqueKey implements XMLable {
@Override @Override
public void writeXML(XMLPrintWriter writer) { public void writeXML(XMLPrintWriter writer) {
writer.startTAG("Attr"); writer.startTAG("Attr");
writer.attr("value", GeneralUtils.objectToString(getValue())); writer.attr("value", GeneralKit.objectToString(getValue()));
writer.end(); writer.end();
} }

15
src/main/java/com/fr/plugin/db/redis/core/order/impl/FormulaOrderValue.java

@ -4,12 +4,13 @@ import com.fr.base.BaseFormula;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ParameterHelper; import com.fr.base.ParameterHelper;
import com.fr.base.ParameterMapNameSpace; import com.fr.base.ParameterMapNameSpace;
import com.fr.general.GeneralUtils; import com.fanruan.api.util.GeneralKit;
import com.fr.log.FineLoggerFactory; import com.fanruan.api.log.LogKit;
import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import com.fanruan.api.cal.ParameterKit;
import com.fr.stable.UtilEvalError; import com.fr.stable.UtilEvalError;
import com.fr.stable.script.NameSpace; import com.fr.stable.script.NameSpace;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
@ -40,9 +41,9 @@ public class FormulaOrderValue extends OrderValue {
NameSpace nameSpace = ParameterMapNameSpace.create(ps); NameSpace nameSpace = ParameterMapNameSpace.create(ps);
cal.pushNameSpace(nameSpace); cal.pushNameSpace(nameSpace);
try { try {
return GeneralUtils.objectToNumber(formula.eval(cal)).intValue(); return GeneralKit.objectToNumber(formula.eval(cal)).intValue();
} catch (UtilEvalError u) { } catch (UtilEvalError u) {
FineLoggerFactory.getLogger().error(u.getMessage(), u); LogKit.error(u.getMessage(), u);
} finally { } finally {
cal.removeNameSpace(nameSpace); cal.removeNameSpace(nameSpace);
} }
@ -59,11 +60,11 @@ public class FormulaOrderValue extends OrderValue {
@Override @Override
public void readValue(XMLableReader reader) { public void readValue(XMLableReader reader) {
this.formula = BaseFormula.createFormulaBuilder().build(reader.getAttrAsString("value", StringUtils.EMPTY)); this.formula = BaseFormula.createFormulaBuilder().build(reader.getAttrAsString("value", StringKit.EMPTY));
} }
@Override @Override
public String toString() { public String toString() {
return formula == null ? StringUtils.EMPTY : formula.getPureContent(); return formula == null ? StringKit.EMPTY : formula.getPureContent();
} }
} }

16
src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java

@ -4,8 +4,8 @@ import com.fr.config.ConfigContext;
import com.fr.config.DefaultConfiguration; import com.fr.config.DefaultConfiguration;
import com.fr.config.holder.Conf; import com.fr.config.holder.Conf;
import com.fr.config.holder.factory.Holders; import com.fr.config.holder.factory.Holders;
import com.fr.security.SecurityToolbox; import com.fanruan.api.security.SecurityKit;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
/** /**
* @author richie * @author richie
@ -25,15 +25,15 @@ public class RedisConnectionProxyConfig extends DefaultConfiguration {
private Conf<Boolean> open = Holders.simple(false); private Conf<Boolean> open = Holders.simple(false);
private Conf<String> host = Holders.simple(StringUtils.EMPTY); private Conf<String> host = Holders.simple(StringKit.EMPTY);
private Conf<Integer> port = Holders.simple(22); private Conf<Integer> port = Holders.simple(22);
private Conf<String> username = Holders.simple(StringUtils.EMPTY); private Conf<String> username = Holders.simple(StringKit.EMPTY);
private Conf<String> password = Holders.simple(StringUtils.EMPTY); private Conf<String> password = Holders.simple(StringKit.EMPTY);
private Conf<String> privateKeyPath = Holders.simple(StringUtils.EMPTY); private Conf<String> privateKeyPath = Holders.simple(StringKit.EMPTY);
public boolean isOpen() { public boolean isOpen() {
@ -70,11 +70,11 @@ public class RedisConnectionProxyConfig extends DefaultConfiguration {
public String getPassword() { public String getPassword() {
String text = password.get(); String text = password.get();
return SecurityToolbox.decrypt(text); return SecurityKit.decrypt(text);
} }
public void setPassword(String password) { public void setPassword(String password) {
this.password.set(SecurityToolbox.encrypt(password)); this.password.set(SecurityKit.encrypt(password));
} }
public String getPrivateKeyPath() { public String getPrivateKeyPath() {

4
src/main/java/com/fr/plugin/db/redis/core/visit/AbstractVisitor.java

@ -4,7 +4,7 @@ import com.fr.base.Parameter;
import com.fr.plugin.db.redis.core.DataWrapper; import com.fr.plugin.db.redis.core.DataWrapper;
import com.fr.plugin.db.redis.core.RedisConstants; import com.fr.plugin.db.redis.core.RedisConstants;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import com.fr.third.redis.clients.jedis.Jedis; import com.fr.third.redis.clients.jedis.Jedis;
/** /**
@ -23,6 +23,6 @@ public abstract class AbstractVisitor<T> implements Visitor<T> {
} }
protected String trimCommand(String cmd) { protected String trimCommand(String cmd) {
return StringUtils.trim(cmd); return StringKit.trim(cmd);
} }
} }

4
src/main/java/com/fr/plugin/db/redis/core/visit/impl/MGetVisitor.java

@ -3,7 +3,7 @@ package com.fr.plugin.db.redis.core.visit.impl;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.plugin.db.redis.core.visit.AbstractVisitor;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fanruan.api.util.ArrayKit;
import com.fr.third.redis.clients.jedis.Jedis; import com.fr.third.redis.clients.jedis.Jedis;
import java.util.ArrayList; import java.util.ArrayList;
@ -19,7 +19,7 @@ public class MGetVisitor extends AbstractVisitor<String> {
if (arr.length < 2) { if (arr.length < 2) {
throw new IllegalArgumentException("Illegal query:" + query); throw new IllegalArgumentException("Illegal query:" + query);
} }
String[] args = (String[]) ArrayUtils.remove(arr, 0); String[] args = (String[]) ArrayKit.remove(arr, 0);
List<String> data = client.mget(args); List<String> data = client.mget(args);
List<List<String>> result = new ArrayList<List<String>>(); List<List<String>> result = new ArrayList<List<String>>();
result.add(data); result.add(data);

7
src/main/java/com/fr/plugin/db/redis/help/Console.java

@ -1,6 +1,7 @@
package com.fr.plugin.db.redis.help; package com.fr.plugin.db.redis.help;
import com.fr.log.FineLoggerFactory; import com.fanruan.api.log.LogKit;
/** /**
* @author richie * @author richie
@ -15,12 +16,12 @@ public class Console {
@ScriptBridge @ScriptBridge
public void log(Object message) { public void log(Object message) {
FineLoggerFactory.getLogger().info(message == null ? null : message.toString()); LogKit.info(message == null ? null : message.toString());
} }
@ScriptBridge @ScriptBridge
public void error(Object message) { public void error(Object message) {
FineLoggerFactory.getLogger().error(message == null ? null : message.toString()); LogKit.error(message == null ? null : message.toString());
} }
@ScriptBridge @ScriptBridge

7
src/main/java/com/fr/plugin/db/redis/help/client/BaseRedisClient.java

@ -1,6 +1,7 @@
package com.fr.plugin.db.redis.help.client; package com.fr.plugin.db.redis.help.client;
import com.fr.log.FineLoggerFactory; import com.fanruan.api.log.LogKit;
import com.fr.plugin.db.redis.help.ScriptBridge; import com.fr.plugin.db.redis.help.ScriptBridge;
import com.fr.plugin.db.redis.help.RedisClient; import com.fr.plugin.db.redis.help.RedisClient;
import com.fr.third.redis.clients.jedis.Jedis; import com.fr.third.redis.clients.jedis.Jedis;
@ -24,7 +25,7 @@ public abstract class BaseRedisClient<A, O> implements RedisClient<A, O> {
try { try {
return jedis.get(key); return jedis.get(key);
} finally { } finally {
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
} }
} }
@ -34,7 +35,7 @@ public abstract class BaseRedisClient<A, O> implements RedisClient<A, O> {
try { try {
return jedis.hget(key, field); return jedis.hget(key, field);
} finally { } finally {
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
} }
} }

18
src/main/java/com/fr/plugin/db/redis/help/client/RedisNashornClient.java

@ -1,7 +1,7 @@
package com.fr.plugin.db.redis.help.client; package com.fr.plugin.db.redis.help.client;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.log.FineLoggerFactory; import com.fanruan.api.log.LogKit;
import com.fr.plugin.db.redis.core.emb.Redis; import com.fr.plugin.db.redis.core.emb.Redis;
import com.fr.plugin.db.redis.help.Console; import com.fr.plugin.db.redis.help.Console;
import com.fr.plugin.db.redis.help.ScriptBridge; import com.fr.plugin.db.redis.help.ScriptBridge;
@ -42,7 +42,7 @@ public class RedisNashornClient extends BaseRedisClient<Object[], Map<Object, Ob
public Object[] hkeys(String key) { public Object[] hkeys(String key) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Set<String> set = jedis.keys(key); Set<String> set = jedis.keys(key);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return set.toArray(new String[0]); return set.toArray(new String[0]);
} }
@ -51,7 +51,7 @@ public class RedisNashornClient extends BaseRedisClient<Object[], Map<Object, Ob
public Object[] hmget(String key, String... fields) { public Object[] hmget(String key, String... fields) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
List<String> list = jedis.hmget(key, fields); List<String> list = jedis.hmget(key, fields);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return list.toArray(new String[0]); return list.toArray(new String[0]);
} }
@ -60,7 +60,7 @@ public class RedisNashornClient extends BaseRedisClient<Object[], Map<Object, Ob
public Map<Object, Object> hgetAll(String key) { public Map<Object, Object> hgetAll(String key) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Map<String, String> map = jedis.hgetAll(key); Map<String, String> map = jedis.hgetAll(key);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return new TreeMap<Object, Object>(map); return new TreeMap<Object, Object>(map);
} }
@ -69,7 +69,7 @@ public class RedisNashornClient extends BaseRedisClient<Object[], Map<Object, Ob
public Object[] keys(String pattern) { public Object[] keys(String pattern) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Set<String> set = jedis.keys(pattern); Set<String> set = jedis.keys(pattern);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return set.toArray(new String[0]); return set.toArray(new String[0]);
} }
@ -78,7 +78,7 @@ public class RedisNashornClient extends BaseRedisClient<Object[], Map<Object, Ob
public Object[] lrange(String key, long start, long end) { public Object[] lrange(String key, long start, long end) {
long start0 = System.currentTimeMillis(); long start0 = System.currentTimeMillis();
List<String> list = jedis.lrange(key, start, end); List<String> list = jedis.lrange(key, start, end);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start0); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start0);
return list.toArray(new String[0]); return list.toArray(new String[0]);
} }
@ -92,7 +92,7 @@ public class RedisNashornClient extends BaseRedisClient<Object[], Map<Object, Ob
parameters[i] = String.valueOf(keys[i]); parameters[i] = String.valueOf(keys[i]);
} }
List<String> list = jedis.mget(parameters); List<String> list = jedis.mget(parameters);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return list.toArray(new String[0]); return list.toArray(new String[0]);
} }
@ -101,7 +101,7 @@ public class RedisNashornClient extends BaseRedisClient<Object[], Map<Object, Ob
public Object[] smembers(String key) { public Object[] smembers(String key) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Set<String> set = jedis.smembers(key); Set<String> set = jedis.smembers(key);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return set.toArray(new String[0]); return set.toArray(new String[0]);
} }
@ -150,7 +150,7 @@ public class RedisNashornClient extends BaseRedisClient<Object[], Map<Object, Ob
} }
return new SimpleDataModel(columnNames, data, realCount); return new SimpleDataModel(columnNames, data, realCount);
} catch (ScriptException e) { } catch (ScriptException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); LogKit.error(e.getMessage(), e);
} }
return null; return null;
} }

16
src/main/java/com/fr/plugin/db/redis/help/client/RedisV8Client.java

@ -5,7 +5,7 @@ import com.eclipsesource.v8.V8Array;
import com.eclipsesource.v8.V8Object; import com.eclipsesource.v8.V8Object;
import com.eclipsesource.v8.utils.V8ObjectUtils; import com.eclipsesource.v8.utils.V8ObjectUtils;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.log.FineLoggerFactory; import com.fanruan.api.log.LogKit;
import com.fr.plugin.db.redis.core.emb.Redis; import com.fr.plugin.db.redis.core.emb.Redis;
import com.fr.plugin.db.redis.help.Console; import com.fr.plugin.db.redis.help.Console;
import com.fr.plugin.db.redis.help.Files; import com.fr.plugin.db.redis.help.Files;
@ -37,7 +37,7 @@ public class RedisV8Client extends BaseRedisClient<V8Array, V8Object> {
public V8Array hkeys(String key) { public V8Array hkeys(String key) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Set<String> set = jedis.keys(key); Set<String> set = jedis.keys(key);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return V8ObjectUtils.toV8Array(v8, new ArrayList<String>(set)); return V8ObjectUtils.toV8Array(v8, new ArrayList<String>(set));
} }
@ -46,7 +46,7 @@ public class RedisV8Client extends BaseRedisClient<V8Array, V8Object> {
public V8Array hmget(String key, String... fields) { public V8Array hmget(String key, String... fields) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
List<String> list = jedis.hmget(key, fields); List<String> list = jedis.hmget(key, fields);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return V8ObjectUtils.toV8Array(v8, list); return V8ObjectUtils.toV8Array(v8, list);
} }
@ -55,7 +55,7 @@ public class RedisV8Client extends BaseRedisClient<V8Array, V8Object> {
public V8Object hgetAll(String key) { public V8Object hgetAll(String key) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Map<String, String> map = jedis.hgetAll(key); Map<String, String> map = jedis.hgetAll(key);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return V8ObjectUtils.toV8Object(v8, map); return V8ObjectUtils.toV8Object(v8, map);
} }
@ -64,7 +64,7 @@ public class RedisV8Client extends BaseRedisClient<V8Array, V8Object> {
public V8Array keys(String pattern) { public V8Array keys(String pattern) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Set<String> set = jedis.keys(pattern); Set<String> set = jedis.keys(pattern);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return V8ObjectUtils.toV8Array(v8, new ArrayList<String>(set)); return V8ObjectUtils.toV8Array(v8, new ArrayList<String>(set));
} }
@ -73,7 +73,7 @@ public class RedisV8Client extends BaseRedisClient<V8Array, V8Object> {
public V8Array lrange(String key, long start, long end) { public V8Array lrange(String key, long start, long end) {
long start0 = System.currentTimeMillis(); long start0 = System.currentTimeMillis();
List<String> list = jedis.lrange(key, start, end); List<String> list = jedis.lrange(key, start, end);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start0); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start0);
return V8ObjectUtils.toV8Array(v8, list); return V8ObjectUtils.toV8Array(v8, list);
} }
@ -87,7 +87,7 @@ public class RedisV8Client extends BaseRedisClient<V8Array, V8Object> {
parameters[i] = keys.getString(i); parameters[i] = keys.getString(i);
} }
List<String> list = jedis.mget(parameters); List<String> list = jedis.mget(parameters);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
keys.release(); keys.release();
return V8ObjectUtils.toV8Array(v8, list); return V8ObjectUtils.toV8Array(v8, list);
} }
@ -97,7 +97,7 @@ public class RedisV8Client extends BaseRedisClient<V8Array, V8Object> {
public V8Array smembers(String key) { public V8Array smembers(String key) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Set<String> set = jedis.smembers(key); Set<String> set = jedis.smembers(key);
FineLoggerFactory.getLogger().info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return V8ObjectUtils.toV8Array(v8, new ArrayList<String>(set)); return V8ObjectUtils.toV8Array(v8, new ArrayList<String>(set));
} }

19
src/main/java/com/fr/plugin/db/redis/ui/RedisBaseTableDataPane.java

@ -1,9 +1,10 @@
package com.fr.plugin.db.redis.ui; package com.fr.plugin.db.redis.ui;
import com.fr.base.BaseUtils; import com.fanruan.api.util.IOKit;
import com.fanruan.api.cal.ParameterKit;
import com.fanruan.api.design.ui.action.UpdateAction;
import com.fr.base.ParameterHelper; import com.fr.base.ParameterHelper;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
@ -13,7 +14,7 @@ import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.stable.ArrayUtils; import com.fanruan.api.util.ArrayKit;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import javax.swing.*; import javax.swing.*;
@ -50,7 +51,7 @@ public abstract class RedisBaseTableDataPane<T extends TableData> extends Abstra
ParameterTableModel model = new ParameterTableModel() { ParameterTableModel model = new ParameterTableModel() {
@Override @Override
public UITableEditAction[] createAction() { public UITableEditAction[] createAction() {
return ArrayUtils.add(super.createDBTableAction(), new RedisBaseTableDataPane.RefreshAction()); return ArrayKit.add(super.createDBTableAction(), new RedisBaseTableDataPane.RefreshAction());
} }
}; };
editorPane = new UITableEditorPane<ParameterProvider>(model); editorPane = new UITableEditorPane<ParameterProvider>(model);
@ -94,11 +95,11 @@ public abstract class RedisBaseTableDataPane<T extends TableData> extends Abstra
private void refresh() { private void refresh() {
String[] paramTexts = paramTexts(); String[] paramTexts = paramTexts();
ParameterProvider[] parameters = ParameterHelper.analyze4Parameters(paramTexts, false); ParameterProvider[] parameters = ParameterKit.analyze4Parameters(paramTexts, false);
ParameterProvider[] providers = getOrderValue().analyze4Parameters(); ParameterProvider[] providers = getOrderValue().analyze4Parameters();
editorPane.populate(ArrayUtils.addAll(parameters, providers)); editorPane.populate(ArrayKit.addAll(parameters, providers));
} }
@ -106,7 +107,7 @@ public abstract class RedisBaseTableDataPane<T extends TableData> extends Abstra
String[] paramTexts = paramTexts(); String[] paramTexts = paramTexts();
ParameterProvider[] parameters = ParameterHelper.analyze4Parameters(paramTexts, false); ParameterProvider[] parameters = ParameterHelper.analyze4Parameters(paramTexts, false);
parameters = ArrayUtils.addAll(parameters, getOrderValue().analyze4Parameters()); parameters = ArrayKit.addAll(parameters, getOrderValue().analyze4Parameters());
if (parameters.length < 1 && editorPane.update().size() < 1) { if (parameters.length < 1 && editorPane.update().size() < 1) {
return; return;
@ -134,7 +135,7 @@ public abstract class RedisBaseTableDataPane<T extends TableData> extends Abstra
public PreviewAction() { public PreviewAction() {
this.setName(PREVIEW_BUTTON); this.setName(PREVIEW_BUTTON);
this.setMnemonic('P'); this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/preview.png")); this.setSmallIcon(IOKit.readIcon("/com/fr/design/images/m_file/preview.png"));
} }
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -147,7 +148,7 @@ public abstract class RedisBaseTableDataPane<T extends TableData> extends Abstra
protected class RefreshAction extends UITableEditAction { protected class RefreshAction extends UITableEditAction {
public RefreshAction() { public RefreshAction() {
this.setName(REFRESH_BUTTON); this.setName(REFRESH_BUTTON);
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); this.setSmallIcon(IOKit.readIcon("/com/fr/design/images/control/refresh.png"));
} }
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

21
src/main/java/com/fr/plugin/db/redis/ui/RedisDBConnectionChosePane.java

@ -3,17 +3,18 @@ package com.fr.plugin.db.redis.ui;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.design.data.datapane.connect.ConnectionComboBoxPanel; import com.fr.design.data.datapane.connect.ConnectionComboBoxPanel;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextfield.PlaceholderTextField; import com.fr.design.gui.itextfield.PlaceholderTextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.DatasourceManager; import com.fr.file.DatasourceManager;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.db.redis.core.RedisDatabaseConnection; import com.fr.plugin.db.redis.core.RedisDatabaseConnection;
import com.fr.plugin.db.redis.ui.event.DataLoadedListener; import com.fr.plugin.db.redis.ui.event.DataLoadedListener;
import com.fr.stable.ArrayUtils; import com.fanruan.api.util.ArrayKit;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import com.fanruan.api.log.LogKit;
import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.design.DesignKit;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -61,7 +62,7 @@ public class RedisDBConnectionChosePane extends BasicPane {
} }
}); });
centerPane.add(GUICoreUtils.createBorderLayoutPane( centerPane.add(DesignKit.createBorderLayoutPane(
keysPatternTextField, BorderLayout.CENTER, keysPatternTextField, BorderLayout.CENTER,
searchButton, BorderLayout.EAST), BorderLayout.NORTH); searchButton, BorderLayout.EAST), BorderLayout.NORTH);
@ -72,9 +73,9 @@ public class RedisDBConnectionChosePane extends BasicPane {
private void loadKeys() { private void loadKeys() {
String name = getSelectRedisConnectionName(); String name = getSelectRedisConnectionName();
if (StringUtils.isEmpty(name)) { if (StringKit.isEmpty(name)) {
clearList(); clearList();
fireDataLoaded(ArrayUtils.EMPTY_STRING_ARRAY); fireDataLoaded(ArrayKit.EMPTY_STRING_ARRAY);
return; return;
} }
RedisDatabaseConnection connection = DatasourceManager.getProviderInstance().getConnection(name, RedisDatabaseConnection.class); RedisDatabaseConnection connection = DatasourceManager.getProviderInstance().getConnection(name, RedisDatabaseConnection.class);
@ -94,8 +95,8 @@ public class RedisDBConnectionChosePane extends BasicPane {
@Override @Override
protected String[] doInBackground() throws Exception { protected String[] doInBackground() throws Exception {
String keysPattern = keysPatternTextField.getText(); String keysPattern = keysPatternTextField.getText();
if (StringUtils.isEmpty(keysPattern)) { if (StringKit.isEmpty(keysPattern)) {
return ArrayUtils.EMPTY_STRING_ARRAY; return ArrayKit.EMPTY_STRING_ARRAY;
} else { } else {
return DataOperator.getInstance().getTableSummary(connection, keysPattern); return DataOperator.getInstance().getTableSummary(connection, keysPattern);
} }
@ -110,7 +111,7 @@ public class RedisDBConnectionChosePane extends BasicPane {
} }
fireDataLoaded(keys); fireDataLoaded(keys);
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); LogKit.error(e.getMessage(), e);
} }
} }
}.execute(); }.execute();

18
src/main/java/com/fr/plugin/db/redis/ui/RedisQueryPane.java

@ -1,7 +1,10 @@
package com.fr.plugin.db.redis.ui; package com.fr.plugin.db.redis.ui;
import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.layout.LayoutKit;
import com.fanruan.api.design.DesignKit;
import com.fanruan.api.log.LogKit;
import com.fr.design.data.datapane.sqlpane.SQLEditPane; import com.fr.design.data.datapane.sqlpane.SQLEditPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -9,9 +12,6 @@ import com.fr.design.gui.itextarea.DescriptionTextArea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.core.order.OrderValue;
@ -47,7 +47,7 @@ public class RedisQueryPane extends BasicPane {
try { try {
Desktop.getDesktop().browse(URI.create(SiteCenter.getInstance().acquireUrlByKind("help.redis"))); Desktop.getDesktop().browse(URI.create(SiteCenter.getInstance().acquireUrlByKind("help.redis")));
} catch (IOException e1) { } catch (IOException e1) {
FineLoggerFactory.getLogger().error(e1.getMessage(), e1); LogKit.error(e1.getMessage(), e1);
} }
} }
}); });
@ -60,7 +60,7 @@ public class RedisQueryPane extends BasicPane {
Component[][] coms = new Component[][]{ Component[][] coms = new Component[][]{
{new UILabel(Toolkit.i18nText("Plugin-Redis_DB_Index") + ":"), dbIndexEditor}, {new UILabel(Toolkit.i18nText("Plugin-Redis_DB_Index") + ":"), dbIndexEditor},
{GUICoreUtils.createBorderLayoutPane(new UILabel(Toolkit.i18nText("Plugin-Redis_Query_Condition") + ":"), BorderLayout.NORTH), {DesignKit.createBorderLayoutPane(new UILabel(Toolkit.i18nText("Plugin-Redis_Query_Condition") + ":"), BorderLayout.NORTH),
RedisDesignUtils.createConditionTextPane(sqlTextPane, SyntaxConstants.SYNTAX_STYLE_SQL, 300)} RedisDesignUtils.createConditionTextPane(sqlTextPane, SyntaxConstants.SYNTAX_STYLE_SQL, 300)}
}; };
@ -68,13 +68,13 @@ public class RedisQueryPane extends BasicPane {
// RedisDesignUtils.createConditionTextPane(scriptTextPane, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, 200) // RedisDesignUtils.createConditionTextPane(scriptTextPane, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, 200)
// } // }
double p = TableLayout.PREFERRED; double p = LayoutKit.PREFERRED;
double f = TableLayout.FILL; double f = LayoutKit.FILL;
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
add(TableLayoutHelper.createTableLayoutPane(coms, rowSize, columnSize)); add(DesignKit.createTableLayoutPane(coms, rowSize, columnSize));
} }

12
src/main/java/com/fr/plugin/db/redis/ui/RedisScriptPane.java

@ -1,13 +1,13 @@
package com.fr.plugin.db.redis.ui; package com.fr.plugin.db.redis.ui;
import com.fr.design.dialog.BasicPane; import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.design.DesignKit;
import com.fanruan.api.layout.LayoutKit;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.plugin.db.redis.ui.value.IndexValuePaneFactory; import com.fr.plugin.db.redis.ui.value.IndexValuePaneFactory;
import com.fr.plugin.db.redis.util.RedisDesignUtils; import com.fr.plugin.db.redis.util.RedisDesignUtils;
@ -38,13 +38,13 @@ public class RedisScriptPane extends BasicPane {
RedisDesignUtils.createConditionTextPane(scriptTextPane, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, 350)}, RedisDesignUtils.createConditionTextPane(scriptTextPane, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, 350)},
}; };
double p = TableLayout.PREFERRED; double p = LayoutKit.PREFERRED;
double f = TableLayout.FILL; double f = LayoutKit.FILL;
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
add(TableLayoutHelper.createTableLayoutPane(coms, rowSize, columnSize)); add(DesignKit.createTableLayoutPane(coms, rowSize, columnSize));
} }

4
src/main/java/com/fr/plugin/db/redis/ui/RedisScriptTableDataPane.java

@ -5,7 +5,7 @@ import com.fr.plugin.db.redis.core.RedisScriptTableData;
import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import javax.swing.*; import javax.swing.*;
import java.util.List; import java.util.List;
@ -61,7 +61,7 @@ public class RedisScriptTableDataPane extends RedisBaseTableDataPane<RedisScript
public RedisScriptTableData updateBean() { public RedisScriptTableData updateBean() {
RedisScriptTableData tableData = new RedisScriptTableData(); RedisScriptTableData tableData = new RedisScriptTableData();
String connectionName = chosePane.getSelectRedisConnectionName(); String connectionName = chosePane.getSelectRedisConnectionName();
if (StringUtils.isNotEmpty(connectionName)) { if (StringKit.isNotEmpty(connectionName)) {
tableData.setDatabase(new NameDatabaseConnection(connectionName)); tableData.setDatabase(new NameDatabaseConnection(connectionName));
} }
List<ParameterProvider> parameterList = editorPane.update(); List<ParameterProvider> parameterList = editorPane.update();

4
src/main/java/com/fr/plugin/db/redis/ui/RedisTableDataPane.java

@ -6,7 +6,7 @@ import com.fr.plugin.db.redis.core.RedisTableData;
import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
import javax.swing.*; import javax.swing.*;
import java.util.List; import java.util.List;
@ -68,7 +68,7 @@ public class RedisTableDataPane extends RedisBaseTableDataPane<RedisTableData> {
RedisTableData tableData = new RedisTableData(); RedisTableData tableData = new RedisTableData();
String connectionName = chosePane.getSelectRedisConnectionName(); String connectionName = chosePane.getSelectRedisConnectionName();
if (StringUtils.isNotEmpty(connectionName)) { if (StringKit.isNotEmpty(connectionName)) {
tableData.setDatabase(new NameDatabaseConnection(connectionName)); tableData.setDatabase(new NameDatabaseConnection(connectionName));
} }

12
src/main/java/com/fr/plugin/db/redis/ui/pool/RedisConnectionPoolConfigPane.java

@ -1,13 +1,13 @@
package com.fr.plugin.db.redis.ui.pool; package com.fr.plugin.db.redis.ui.pool;
import com.fr.design.dialog.BasicPane; import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.layout.LayoutKit;
import com.fanruan.api.design.DesignKit;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIIntNumberField; import com.fr.design.gui.itextfield.UIIntNumberField;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.db.redis.core.pool.RedisConnectionPoolConfig; import com.fr.plugin.db.redis.core.pool.RedisConnectionPoolConfig;
import javax.swing.*; import javax.swing.*;
@ -50,12 +50,12 @@ public class RedisConnectionPoolConfigPane extends BasicPane {
{new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Lifo") + ":"), lifoCheckBox}, {new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Lifo") + ":"), lifoCheckBox},
{new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Timeout") + ":"), timeoutNumberField} {new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Timeout") + ":"), timeoutNumberField}
}; };
double p = TableLayout.PREFERRED; double p = LayoutKit.PREFERRED;
double f = TableLayout.FILL; double f = LayoutKit.FILL;
double[] rowSize = new double[]{p, p, p, p, p, p}; double[] rowSize = new double[]{p, p, p, p, p, p};
double[] columnSize = new double[]{p, f}; double[] columnSize = new double[]{p, f};
add(TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER); add(DesignKit.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER);
} }
@Override @Override

17
src/main/java/com/fr/plugin/db/redis/ui/proxy/RedisConnectionProxyConfigPane.java

@ -1,6 +1,8 @@
package com.fr.plugin.db.redis.ui.proxy; package com.fr.plugin.db.redis.ui.proxy;
import com.fr.design.dialog.BasicPane; import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.layout.LayoutKit;
import com.fanruan.api.design.DesignKit;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -8,9 +10,6 @@ import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.itextfield.UIIntNumberField; import com.fr.design.gui.itextfield.UIIntNumberField;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.plugin.db.redis.core.pool.RedisConnectionProxyConfig; import com.fr.plugin.db.redis.core.pool.RedisConnectionProxyConfig;
import javax.swing.*; import javax.swing.*;
@ -54,7 +53,7 @@ public class RedisConnectionProxyConfigPane extends BasicPane {
UILabel description = new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Description"), SwingConstants.CENTER); UILabel description = new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Description"), SwingConstants.CENTER);
JComponent[][] comps = new JComponent[][]{ JComponent[][] comps = new JComponent[][]{
{new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Open") + ":"), GUICoreUtils.createBorderLayoutPane( {new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Open") + ":"), DesignKit.createBorderLayoutPane(
openCheckBox, BorderLayout.WEST, openCheckBox, BorderLayout.WEST,
description, BorderLayout.CENTER description, BorderLayout.CENTER
)}, )},
@ -62,7 +61,7 @@ public class RedisConnectionProxyConfigPane extends BasicPane {
{new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Port") + ":"), portNumberField}, {new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Port") + ":"), portNumberField},
{new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Username") + ":"), usernameTextField}, {new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Username") + ":"), usernameTextField},
{new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Password") + ":"), passwordTextField}, {new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Password") + ":"), passwordTextField},
{new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Private_Key_Path") + ":"), GUICoreUtils.createBorderLayoutPane( {new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Private_Key_Path") + ":"), DesignKit.createBorderLayoutPane(
privateKeyPathTextField, BorderLayout.CENTER, privateKeyPathTextField, BorderLayout.CENTER,
fileSelectButton, BorderLayout.EAST fileSelectButton, BorderLayout.EAST
)}, )},
@ -79,12 +78,12 @@ public class RedisConnectionProxyConfigPane extends BasicPane {
} }
}); });
double p = TableLayout.PREFERRED; double p = LayoutKit.PREFERRED;
double f = TableLayout.FILL; double f = LayoutKit.FILL;
double[] rowSize = new double[]{p, p, p, p, p, p}; double[] rowSize = new double[]{p, p, p, p, p, p};
double[] columnSize = new double[]{p, f}; double[] columnSize = new double[]{p, f};
add(TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER); add(DesignKit.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER);
} }

Loading…
Cancel
Save