From ca6ab47d7e63d025f773398ab7d35120d6d97755 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Fri, 30 Aug 2019 10:22:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=8F=92=E4=BB=B6=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=94=A8finekit=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/db/redis/RedisConnectionImpl.java | 2 +- .../db/redis/RedisScriptTableDataDefine.java | 4 +- .../db/redis/conf/ShellConfigManager.java | 99 ------------------- .../conf/ShellConfigManagerProvider.java | 12 --- .../fr/plugin/db/redis/core/DataWrapper.java | 8 +- .../redis/core/RedisDatabaseConnection.java | 21 ++-- .../fr/plugin/db/redis/core/RedisNode.java | 19 ++-- .../fr/plugin/db/redis/core/RedisPool.java | 6 +- .../db/redis/core/RedisScriptTableData.java | 35 ++++--- .../plugin/db/redis/core/RedisTableData.java | 40 ++++---- .../db/redis/core/RedisTableDataModel.java | 2 +- .../db/redis/core/order/OrderValue.java | 6 +- .../core/order/impl/FormulaOrderValue.java | 14 +-- .../core/order/impl/NumberOrderValue.java | 2 +- .../core/pool/RedisConnectionPoolConfig.java | 33 ++++--- .../core/pool/RedisConnectionProxyConfig.java | 31 +++--- .../db/redis/core/visit/AbstractVisitor.java | 2 +- .../plugin/db/redis/core/visit/Visitor.java | 2 +- .../db/redis/core/visit/VisitorFactory.java | 2 +- .../db/redis/core/visit/impl/GetVisitor.java | 2 +- .../redis/core/visit/impl/HashGetVisitor.java | 2 +- .../core/visit/impl/HashKeysVisitor.java | 2 +- .../core/visit/impl/HashMGetVisitor.java | 2 +- .../db/redis/core/visit/impl/HashVisitor.java | 2 +- .../db/redis/core/visit/impl/KeysVisitor.java | 2 +- .../db/redis/core/visit/impl/ListVisitor.java | 2 +- .../db/redis/core/visit/impl/MGetVisitor.java | 2 +- .../db/redis/core/visit/impl/SetVisitor.java | 2 +- .../redis/core/visit/impl/ZRangeVisitor.java | 2 +- .../com/fr/plugin/db/redis/help/Files.java | 9 +- .../db/redis/ui/RedisBaseTableDataPane.java | 24 ++--- .../db/redis/ui/RedisConnectionPane.java | 43 ++++---- .../redis/ui/RedisDBConnectionChosePane.java | 25 +++-- .../fr/plugin/db/redis/ui/RedisQueryPane.java | 36 +++---- .../plugin/db/redis/ui/RedisScriptPane.java | 26 ++--- .../db/redis/ui/RedisScriptTableDataPane.java | 2 +- .../db/redis/ui/RedisTableDataPane.java | 6 +- .../pool/RedisConnectionPoolConfigPane.java | 32 +++--- .../proxy/RedisConnectionProxyConfigPane.java | 40 ++++---- .../db/redis/ui/value/FormulaEditor.java | 10 +- .../redis/ui/value/IndexValuePaneFactory.java | 6 +- .../db/redis/ui/value/IntegerEditor.java | 10 +- .../db/redis/util/RedisDesignUtils.java | 8 +- .../fr/plugin/db/redis/util/RedisUtils.java | 6 +- 44 files changed, 261 insertions(+), 382 deletions(-) delete mode 100644 src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManager.java delete mode 100644 src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManagerProvider.java diff --git a/src/main/java/com/fr/plugin/db/redis/RedisConnectionImpl.java b/src/main/java/com/fr/plugin/db/redis/RedisConnectionImpl.java index 42e27f2..e5fe036 100755 --- a/src/main/java/com/fr/plugin/db/redis/RedisConnectionImpl.java +++ b/src/main/java/com/fr/plugin/db/redis/RedisConnectionImpl.java @@ -1,7 +1,7 @@ package com.fr.plugin.db.redis; import com.fr.data.impl.Connection; -import com.fr.design.beans.BasicBeanPane; +import com.fanruan.api.design.ui.container.BasicBeanPane; import com.fr.design.fun.impl.AbstractConnectionProvider; import com.fr.plugin.db.redis.core.RedisDatabaseConnection; import com.fr.plugin.db.redis.ui.RedisConnectionPane; diff --git a/src/main/java/com/fr/plugin/db/redis/RedisScriptTableDataDefine.java b/src/main/java/com/fr/plugin/db/redis/RedisScriptTableDataDefine.java index cc3f082..2048668 100644 --- a/src/main/java/com/fr/plugin/db/redis/RedisScriptTableDataDefine.java +++ b/src/main/java/com/fr/plugin/db/redis/RedisScriptTableDataDefine.java @@ -6,7 +6,7 @@ import com.fr.design.fun.ServerTableDataDefineProvider; import com.fr.design.fun.impl.AbstractTableDataDefineProvider; import com.fr.plugin.db.redis.core.RedisScriptTableData; import com.fr.plugin.db.redis.ui.RedisScriptTableDataPane; -import com.fanruan.api.i18n.I18nKit; +import com.fanruan.api.design.util.I18nDesignKit; /** * @author richie @@ -37,7 +37,7 @@ public class RedisScriptTableDataDefine extends AbstractTableDataDefineProvider @Override public String nameForTableData() { - return I18nKit.getLocText("Plugin-Redis_Script_Table_Data"); + return I18nDesignKit.i18nText("Plugin-Redis_Script_Table_Data"); } @Override diff --git a/src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManager.java b/src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManager.java deleted file mode 100644 index d438c65..0000000 --- a/src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManager.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.fr.plugin.db.redis.conf; - -import com.fanruan.api.xml.XmlKit; -import com.fanruan.api.xml.comopnent.XMLFileManager; -import com.fr.general.GeneralContext; -import com.fr.stable.EnvChangedListener; -import com.fanruan.api.util.StringKit; -import com.fr.stable.xml.XMLPrintWriter; -import com.fr.stable.xml.XMLTools; -import com.fr.stable.xml.XMLableReader; - -import java.io.InputStream; - -/** - * Created by richie on 2017/6/5. - */ -public class ShellConfigManager extends XMLFileManager implements ShellConfigManagerProvider { - - private static final String XML_TAG = "ShellConfigManager"; - - private static ShellConfigManagerProvider shellManager = null; - - - public synchronized static ShellConfigManager getInstance() { - return (ShellConfigManager) getProviderInstance(); - } - - public synchronized static ShellConfigManagerProvider getProviderInstance() { - if (shellManager == null) { - if (isClusterMember()) { - return shellManager; - } - shellManager.readXMLFile(); - } - return shellManager; - } - - private synchronized static boolean isClusterMember() { - - return false; - } - - static { - GeneralContext.addEnvChangedListener(new EnvChangedListener() { - public void envChanged() { - ShellConfigManager.envChanged(); - } - }); - } - - private synchronized static void envChanged() { - shellManager = null; - } - - private String shellText; - - @Override - public String getShellText() { - return shellText; - } - - public void setShellText(String shellText) { - this.shellText = shellText; - } - - @Override - public void readXML(XMLableReader reader) { - if (reader.isAttr()) { - shellText = reader.getAttrAsString("shell", StringKit.EMPTY); - } - } - - @Override - public void writeXML(XMLPrintWriter writer) { - writer.startTAG(XML_TAG); - writer.attr("shell", shellText); - writer.end(); - } - - @Override - public String fileName() { - return "redis.xml"; - } - - @Override - public void readFromInputStream(InputStream input) throws Exception { - // 服务器端新建一个对象 - ShellConfigManager manager = new ShellConfigManager(); - // 从客户端传过来的inputstream中读取对象属性 - XMLTools.readInputStreamXML(manager, input); - // 赋值给当前服务器端对象 - shellManager = manager; - } - - - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } -} diff --git a/src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManagerProvider.java b/src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManagerProvider.java deleted file mode 100644 index ac07e56..0000000 --- a/src/main/java/com/fr/plugin/db/redis/conf/ShellConfigManagerProvider.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.fr.plugin.db.redis.conf; - -import com.fr.stable.FCloneable; -import com.fr.stable.file.RemoteXMLFileManagerProvider; - -/** - * Created by richie on 2017/6/5. - */ -public interface ShellConfigManagerProvider extends RemoteXMLFileManagerProvider, java.io.Serializable, FCloneable { - - String getShellText(); -} diff --git a/src/main/java/com/fr/plugin/db/redis/core/DataWrapper.java b/src/main/java/com/fr/plugin/db/redis/core/DataWrapper.java index 773ae56..27a0e6a 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/DataWrapper.java +++ b/src/main/java/com/fr/plugin/db/redis/core/DataWrapper.java @@ -2,8 +2,8 @@ package com.fr.plugin.db.redis.core; import com.fanruan.api.util.GeneralKit; import com.fanruan.api.log.LogKit; -import com.fr.general.IOUtils; -import com.fr.script.ScriptFactory; +import com.fanruan.api.util.IOKit; +import com.fanruan.api.script.ScriptKit; import com.fanruan.api.util.StringKit; import com.fr.workspace.WorkContext; @@ -53,14 +53,14 @@ public class DataWrapper { if (script.startsWith("file:///")) { try { FileInputStream in = new FileInputStream(new File(readAndRenderScriptFile(script))); - scriptText = IOUtils.inputStream2String(in); + scriptText = IOKit.inputStream2String(in); } catch (Exception e) { LogKit.error(e.getMessage(), e); } } else { scriptText = String.format("(function(){%s})()", script); } - ScriptEngine scriptEngine = ScriptFactory.newScriptEngine(); + ScriptEngine scriptEngine = ScriptKit.newScriptEngine(); scriptEngine.put("$content", data); scriptEngine.put("$column", columnNames); Object r = scriptEngine.eval(scriptText); diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java b/src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java index 2404d32..7343ea0 100755 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java @@ -1,11 +1,10 @@ package com.fr.plugin.db.redis.core; -import com.fr.config.holder.Conf; -import com.fr.config.holder.factory.Holders; +import cpm.fanruan.api.conf.HolderKit; import com.fr.config.holder.impl.ColConf; import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.Connection; -import com.fanruan.api.i18n.I18nKit; +import com.fanruan.api.design.util.I18nDesignKit; import com.fr.plugin.db.redis.core.emb.Redis; import com.fanruan.api.security.SecurityKit; import com.fanruan.api.util.ArrayKit; @@ -24,9 +23,9 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection { private static final int DEFAULT_REDIS_PORT = 6379; - private Conf host = Holders.simple(StringKit.EMPTY); - private Conf port = Holders.simple(DEFAULT_REDIS_PORT); - private Conf password = Holders.simple(StringKit.EMPTY); + private HolderKit.Conf host = HolderKit.simple(StringKit.EMPTY); + private HolderKit.Conf port = HolderKit.simple(DEFAULT_REDIS_PORT); + private HolderKit.Conf password = HolderKit.simple(StringKit.EMPTY); public RedisDatabaseConnection() { @@ -96,9 +95,9 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection { @Override public String connectMessage(boolean status) { if (status) { - return I18nKit.getLocText("Plugin-Redis_Connection_Successfully") + "!"; + return I18nDesignKit.i18nText("Plugin-Redis_Connection_Successfully") + "!"; } else { - return I18nKit.getLocText("Plugin-Redis_Connection_Failed") + "!"; + return I18nDesignKit.i18nText("Plugin-Redis_Connection_Failed") + "!"; } } @@ -168,9 +167,9 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection { @Override public Object clone() throws CloneNotSupportedException { com.fr.plugin.db.redis.core.RedisDatabaseConnection cloned = (com.fr.plugin.db.redis.core.RedisDatabaseConnection) super.clone(); - cloned.host = (Conf) host.clone(); - cloned.port = (Conf) port.clone(); - cloned.password = (Conf) password.clone(); + cloned.host = (HolderKit.Conf) host.clone(); + cloned.port = (HolderKit.Conf) port.clone(); + cloned.password = (HolderKit.Conf) password.clone(); return cloned; } } \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisNode.java b/src/main/java/com/fr/plugin/db/redis/core/RedisNode.java index bea617c..3dd84e1 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisNode.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisNode.java @@ -1,8 +1,7 @@ package com.fr.plugin.db.redis.core; -import com.fr.config.holder.Conf; -import com.fr.config.holder.factory.Holders; -import com.fr.config.utils.UniqueKey; +import com.fanruan.api.conf.HolderKit; +import com.fanruan.api.conf.BaseUniqueKey; import com.fanruan.api.util.AssistKit; import com.fanruan.api.util.StringKit; @@ -11,13 +10,13 @@ import com.fanruan.api.util.StringKit; * @version 10.0 * Created by richie on 2019-03-22 */ -public class RedisNode extends UniqueKey { +public class RedisNode extends BaseUniqueKey { public static final int DEFAULT_REDIS_PORT = 6379; - private Conf host = Holders.simple(StringKit.EMPTY); - private Conf port = Holders.simple(DEFAULT_REDIS_PORT); - private Conf password = Holders.simple(StringKit.EMPTY); + private HolderKit.Conf host = HolderKit.simple(StringKit.EMPTY); + private HolderKit.Conf port = HolderKit.simple(DEFAULT_REDIS_PORT); + private HolderKit.Conf password = HolderKit.simple(StringKit.EMPTY); public RedisNode(String host, int port, String password) { this.setHost(host); @@ -65,9 +64,9 @@ public class RedisNode extends UniqueKey { @Override public Object clone() throws CloneNotSupportedException { RedisNode cloned = (RedisNode) super.clone(); - cloned.host = (Conf) host.clone(); - cloned.port = (Conf) port.clone(); - cloned.password = (Conf) password.clone(); + cloned.host = (HolderKit.Conf) host.clone(); + cloned.port = (HolderKit.Conf) port.clone(); + cloned.password = (HolderKit.Conf) password.clone(); return cloned; } } diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisPool.java b/src/main/java/com/fr/plugin/db/redis/core/RedisPool.java index a210846..5004b06 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisPool.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisPool.java @@ -13,10 +13,8 @@ import com.fr.ssh.jsch.JSchException; import com.fr.ssh.jsch.Session; import com.fanruan.api.util.StringKit; import com.fr.third.redis.clients.jedis.Jedis; -import com.fr.third.redis.clients.jedis.JedisCluster; -import com.fr.third.redis.clients.jedis.JedisPool; -import com.fr.third.redis.clients.jedis.JedisPoolConfig; -import com.fr.transaction.Configurations; +import com.fanruan.api.redis.pool.JedisPool; +import com.fanruan.api.redis.pool.JedisPoolConfig; import com.fr.transaction.ValidateProxy; import java.util.Map; diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java b/src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java index 5851774..243462f 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java @@ -1,17 +1,16 @@ package com.fr.plugin.db.redis.core; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.base.TableData; -import com.fr.config.holder.Conf; -import com.fr.config.holder.factory.Holders; +import com.fanruan.api.conf.HolderKit; import com.fr.config.holder.factory.XmlHolders; import com.fr.data.AbstractParameterTableData; -import com.fr.data.core.DataCoreXmlUtils; +import com.fanruan.api.database.DatabaseKit; import com.fr.data.impl.Connection; -import com.fr.data.impl.NameDatabaseConnection; -import com.fr.file.DatasourceManager; +import com.fanruan.api.database.nameDatabase.NameDatabaseConnection; +import com.fanruan.api.data.ConnectionKit; import com.fr.general.data.DataModel; -import com.fr.general.xml.GeneralXMLTools; +import com.fanruan.api.xml.XmlKit; import com.fr.intelli.record.Focus; import com.fanruan.api.log.LogKit; import com.fr.plugin.db.redis.core.order.OrderValue; @@ -34,9 +33,9 @@ public class RedisScriptTableData extends AbstractParameterTableData { private static final long serialVersionUID = 1525853354993816818L; - private Conf database = Holders.obj(null, Connection.class); - private Conf dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); - private Conf script = Holders.simple(StringKit.EMPTY); + private HolderKit.Conf database = HolderKit.obj(null, Connection.class); + private HolderKit.Conf dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); + private HolderKit.Conf script = HolderKit.simple(StringKit.EMPTY); public void setDatabase(Connection c) { this.database.set(c); @@ -79,7 +78,7 @@ public class RedisScriptTableData extends AbstractParameterTableData { Connection connection = database.get(); if (connection instanceof NameDatabaseConnection) { String name = ((NameDatabaseConnection) connection).getName(); - RedisDatabaseConnection rc = DatasourceManager.getProviderInstance().getConnection(name, RedisDatabaseConnection.class); + RedisDatabaseConnection rc = ConnectionKit.getConnection(name, RedisDatabaseConnection.class); if (rc != null) { OrderValue orderValue = dbIndex.get(); DataModel model = new RedisScriptTableDataModel(rc, @@ -101,13 +100,13 @@ public class RedisScriptTableData extends AbstractParameterTableData { String tmpVal; if (OrderValue.XML_TAG.equals(tmpName)) { - OrderValue orderValue = (OrderValue) GeneralXMLTools.readXMLable(reader); + OrderValue orderValue = (OrderValue) XmlKit.readXMLable(reader); if (orderValue != null) { setOrderValue(orderValue); } } else if (com.fr.data.impl.Connection.XML_TAG.equals(tmpName)) { if (reader.getAttrAsString("class", null) != null) { - com.fr.data.impl.Connection con = DataCoreXmlUtils.readXMLConnection(reader); + com.fr.data.impl.Connection con = DatabaseKit.readXMLConnection(reader); this.setDatabase(con); } } else if ("Script".equals(tmpName)) { @@ -122,9 +121,9 @@ public class RedisScriptTableData extends AbstractParameterTableData { @Override public void writeXML(XMLPrintWriter writer) { super.writeXML(writer); - GeneralXMLTools.writeXMLable(writer, dbIndex.get(), OrderValue.XML_TAG); + XmlKit.writeXMLable(writer, dbIndex.get(), OrderValue.XML_TAG); if (this.database.get() != null) { - DataCoreXmlUtils.writeXMLConnection(writer, this.database.get()); + DatabaseKit.writeXMLConnection(writer, this.database.get()); } writer.startTAG("Script").textNode(getScript()).end(); } @@ -136,9 +135,9 @@ public class RedisScriptTableData extends AbstractParameterTableData { @Override public Object clone() throws CloneNotSupportedException { RedisScriptTableData cloned = (RedisScriptTableData) super.clone(); - cloned.database = (Conf) database.clone(); - cloned.script = (Conf) script.clone(); - cloned.dbIndex = (Conf) dbIndex.clone(); + cloned.database = (HolderKit.Conf) database.clone(); + cloned.script = (HolderKit.Conf) script.clone(); + cloned.dbIndex = (HolderKit.Conf) dbIndex.clone(); return cloned; } } diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java b/src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java index 39db504..3942354 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java @@ -1,18 +1,16 @@ package com.fr.plugin.db.redis.core; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.base.TableData; -import com.fr.base.TemplateUtils; -import com.fr.config.holder.Conf; -import com.fr.config.holder.factory.Holders; +import com.fanruan.api.conf.HolderKit; import com.fr.config.holder.factory.XmlHolders; import com.fr.data.AbstractParameterTableData; -import com.fr.data.core.DataCoreXmlUtils; +import com.fanruan.api.database.DatabaseKit; import com.fr.data.impl.Connection; -import com.fr.data.impl.NameDatabaseConnection; -import com.fr.file.DatasourceManager; +import com.fanruan.api.database.nameDatabase.NameDatabaseConnection; +import com.fanruan.api.data.ConnectionKit; import com.fr.general.data.DataModel; -import com.fr.general.xml.GeneralXMLTools; +import com.fanruan.api.xml.XmlKit; import com.fr.intelli.record.Focus; import com.fr.intelli.record.Original; import com.fanruan.api.log.LogKit; @@ -35,10 +33,10 @@ import java.util.Map; public class RedisTableData extends AbstractParameterTableData { private static final long serialVersionUID = 7017455818551800001L; - private Conf database = Holders.obj(null, Connection.class); - private Conf dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); - private Conf query = Holders.simple(StringKit.EMPTY); - private Conf script = Holders.simple(StringKit.EMPTY); + private HolderKit.Conf database = HolderKit.obj(null, Connection.class); + private HolderKit.Conf dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); + private HolderKit.Conf query = HolderKit.simple(StringKit.EMPTY); + private HolderKit.Conf script = HolderKit.simple(StringKit.EMPTY); public void setDatabase(Connection c) { this.database.set(c); @@ -89,7 +87,7 @@ public class RedisTableData extends AbstractParameterTableData { Connection connection = database.get(); if (connection instanceof NameDatabaseConnection) { String name = ((NameDatabaseConnection) connection).getName(); - RedisDatabaseConnection rc = DatasourceManager.getProviderInstance().getConnection(name, RedisDatabaseConnection.class); + RedisDatabaseConnection rc = ConnectionKit.getConnection(name, RedisDatabaseConnection.class); if (rc != null) { OrderValue orderValue = dbIndex.get(); DataModel model = new RedisTableDataModel(calculator, ps, rc, @@ -114,13 +112,13 @@ public class RedisTableData extends AbstractParameterTableData { String tmpVal; if (OrderValue.XML_TAG.equals(tmpName)) { - OrderValue orderValue = (OrderValue) GeneralXMLTools.readXMLable(reader); + OrderValue orderValue = (OrderValue) XmlKit.readXMLable(reader); if (orderValue != null) { setOrderValue(orderValue); } } else if (com.fr.data.impl.Connection.XML_TAG.equals(tmpName)) { if (reader.getAttrAsString("class", null) != null) { - com.fr.data.impl.Connection con = DataCoreXmlUtils.readXMLConnection(reader); + com.fr.data.impl.Connection con = DatabaseKit.readXMLConnection(reader); this.setDatabase(con); } } else if ("Query".equals(tmpName)) { @@ -140,9 +138,9 @@ public class RedisTableData extends AbstractParameterTableData { @Override public void writeXML(XMLPrintWriter writer) { super.writeXML(writer); - GeneralXMLTools.writeXMLable(writer, dbIndex.get(), OrderValue.XML_TAG); + XmlKit.writeXMLable(writer, dbIndex.get(), OrderValue.XML_TAG); if (this.database.get() != null) { - DataCoreXmlUtils.writeXMLConnection(writer, this.database.get()); + DatabaseKit.writeXMLConnection(writer, this.database.get()); } writer.startTAG("Query").textNode(getQuery()).end(); writer.startTAG("Script").textNode(getScript()).end(); @@ -155,10 +153,10 @@ public class RedisTableData extends AbstractParameterTableData { @Override public Object clone() throws CloneNotSupportedException { RedisTableData cloned = (RedisTableData) super.clone(); - cloned.database = (Conf) database.clone(); - cloned.query = (Conf) query.clone(); - cloned.script = (Conf) script.clone(); - cloned.dbIndex = (Conf) dbIndex.clone(); + cloned.database = (HolderKit.Conf) database.clone(); + cloned.query = (HolderKit.Conf) query.clone(); + cloned.script = (HolderKit.Conf) script.clone(); + cloned.dbIndex = (HolderKit.Conf) dbIndex.clone(); return cloned; } } \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisTableDataModel.java b/src/main/java/com/fr/plugin/db/redis/core/RedisTableDataModel.java index 23cae45..a703cd3 100755 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisTableDataModel.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisTableDataModel.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.data.AbstractDataModel; import com.fanruan.api.log.LogKit; import com.fr.plugin.PluginLicense; diff --git a/src/main/java/com/fr/plugin/db/redis/core/order/OrderValue.java b/src/main/java/com/fr/plugin/db/redis/core/order/OrderValue.java index f405485..14064b7 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/order/OrderValue.java +++ b/src/main/java/com/fr/plugin/db/redis/core/order/OrderValue.java @@ -1,7 +1,7 @@ package com.fr.plugin.db.redis.core.order; -import com.fr.base.Parameter; -import com.fr.config.utils.UniqueKey; +import com.fr.stable.ParameterProvider; +import com.fanruan.api.conf.BaseUniqueKey; import com.fanruan.api.util.GeneralKit; import com.fr.script.Calculator; import com.fr.stable.ParameterProvider; @@ -9,7 +9,7 @@ import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLable; import com.fr.stable.xml.XMLableReader; -public abstract class OrderValue extends UniqueKey implements XMLable { +public abstract class OrderValue extends BaseUniqueKey implements XMLable { private static final long serialVersionUID = -5421898153556627638L; diff --git a/src/main/java/com/fr/plugin/db/redis/core/order/impl/FormulaOrderValue.java b/src/main/java/com/fr/plugin/db/redis/core/order/impl/FormulaOrderValue.java index 2fcd909..c6056ed 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/order/impl/FormulaOrderValue.java +++ b/src/main/java/com/fr/plugin/db/redis/core/order/impl/FormulaOrderValue.java @@ -1,9 +1,9 @@ package com.fr.plugin.db.redis.core.order.impl; import com.fr.base.BaseFormula; -import com.fr.base.Parameter; -import com.fr.base.ParameterHelper; -import com.fr.base.ParameterMapNameSpace; +import com.fanruan.api.cal.FormulaKit; +import com.fr.stable.ParameterProvider; +import com.fanruan.api.cal.ParameterKit; import com.fanruan.api.util.GeneralKit; import com.fanruan.api.log.LogKit; import com.fr.plugin.db.redis.core.order.OrderValue; @@ -11,7 +11,7 @@ import com.fr.script.Calculator; import com.fr.stable.ParameterProvider; import com.fanruan.api.util.StringKit; import com.fanruan.api.cal.ParameterKit; -import com.fr.stable.UtilEvalError; +import com.fanruan.api.util.err.UtilEvalError; import com.fr.stable.script.NameSpace; import com.fr.stable.xml.XMLableReader; @@ -38,7 +38,7 @@ public class FormulaOrderValue extends OrderValue { @Override public int toIndex(Calculator cal, Parameter[] ps) { - NameSpace nameSpace = ParameterMapNameSpace.create(ps); + NameSpace nameSpace = ParameterKit.createParameterProvider(ps); cal.pushNameSpace(nameSpace); try { return GeneralKit.objectToNumber(formula.eval(cal)).intValue(); @@ -55,12 +55,12 @@ public class FormulaOrderValue extends OrderValue { if (formula == null) { return new ParameterProvider[0]; } - return ParameterHelper.analyze4ParametersFromFormula(formula.getContent()); + return ParameterKit.analyze4ParametersFromFormula(formula.getContent()); } @Override public void readValue(XMLableReader reader) { - this.formula = BaseFormula.createFormulaBuilder().build(reader.getAttrAsString("value", StringKit.EMPTY)); + this.formula = FormulaKit.newFormula(reader.getAttrAsString("value", StringKit.EMPTY)); } @Override diff --git a/src/main/java/com/fr/plugin/db/redis/core/order/impl/NumberOrderValue.java b/src/main/java/com/fr/plugin/db/redis/core/order/impl/NumberOrderValue.java index 1d90912..0b655b0 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/order/impl/NumberOrderValue.java +++ b/src/main/java/com/fr/plugin/db/redis/core/order/impl/NumberOrderValue.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.order.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.script.Calculator; import com.fr.stable.xml.XMLableReader; diff --git a/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionPoolConfig.java b/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionPoolConfig.java index c671fcb..467a73a 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionPoolConfig.java +++ b/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionPoolConfig.java @@ -1,16 +1,17 @@ package com.fr.plugin.db.redis.core.pool; import com.fr.config.ConfigContext; -import com.fr.config.DefaultConfiguration; -import com.fr.config.holder.Conf; -import com.fr.config.holder.factory.Holders; +import com.fanruan.api.conf.BaseConfiguration; +import com.fanruan.api.conf.HolderKit; + +import javax.xml.ws.Holder; /** * @author richie * @version 10.0 * Created by richie on 2019-03-21 */ -public class RedisConnectionPoolConfig extends DefaultConfiguration { +public class RedisConnectionPoolConfig extends BaseConfiguration { private static volatile RedisConnectionPoolConfig instance = null; @@ -26,12 +27,12 @@ public class RedisConnectionPoolConfig extends DefaultConfiguration { private static final int MAX_WAIT = -1; private static final int TIME_OUT = 100 * 1000; - private Conf maxTotal = Holders.simple(MAX_TOTAL); - private Conf maxWait = Holders.simple(MAX_WAIT); - private Conf maxIdle = Holders.simple(MAX_IDLE); - private Conf blockWhenExhausted = Holders.simple(true); - private Conf lifo = Holders.simple(true); - private Conf timeout = Holders.simple(TIME_OUT); + private HolderKit.Conf maxTotal = HolderKit.simple(MAX_TOTAL); + private HolderKit.Conf maxWait = HolderKit.simple(MAX_WAIT); + private HolderKit.Conf maxIdle = HolderKit.simple(MAX_IDLE); + private HolderKit.Conf blockWhenExhausted = HolderKit.simple(true); + private HolderKit.Conf lifo = HolderKit.simple(true); + private HolderKit.Conf timeout = HolderKit.simple(TIME_OUT); public int getMaxTotal() { return maxTotal.get(); @@ -84,12 +85,12 @@ public class RedisConnectionPoolConfig extends DefaultConfiguration { @Override public Object clone() throws CloneNotSupportedException { RedisConnectionPoolConfig cloned = (RedisConnectionPoolConfig) super.clone(); - cloned.maxTotal = (Conf) maxTotal.clone(); - cloned.maxWait = (Conf) maxWait.clone(); - cloned.maxIdle = (Conf) maxIdle.clone(); - cloned.blockWhenExhausted = (Conf) blockWhenExhausted.clone(); - cloned.lifo = (Conf) lifo.clone(); - cloned.timeout = (Conf) timeout.clone(); + cloned.maxTotal = (HolderKit.Conf) maxTotal.clone(); + cloned.maxWait = (HolderKit.Conf) maxWait.clone(); + cloned.maxIdle = (HolderKit.Conf) maxIdle.clone(); + cloned.blockWhenExhausted = (HolderKit.Conf) blockWhenExhausted.clone(); + cloned.lifo = (HolderKit.Conf) lifo.clone(); + cloned.timeout = (HolderKit.Conf) timeout.clone(); return cloned; } } diff --git a/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java b/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java index 7aca745..cb8fbc7 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java +++ b/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java @@ -1,9 +1,8 @@ package com.fr.plugin.db.redis.core.pool; import com.fr.config.ConfigContext; -import com.fr.config.DefaultConfiguration; -import com.fr.config.holder.Conf; -import com.fr.config.holder.factory.Holders; +import com.fanruan.api.conf.BaseConfiguration; +import com.fanruan.api.conf.HolderKit; import com.fanruan.api.security.SecurityKit; import com.fanruan.api.util.StringKit; @@ -12,7 +11,7 @@ import com.fanruan.api.util.StringKit; * @version 10.0 * Created by richie on 2019-03-21 */ -public class RedisConnectionProxyConfig extends DefaultConfiguration { +public class RedisConnectionProxyConfig extends BaseConfiguration { private static volatile RedisConnectionProxyConfig instance = null; @@ -23,17 +22,17 @@ public class RedisConnectionProxyConfig extends DefaultConfiguration { return instance; } - private Conf open = Holders.simple(false); + private HolderKit.Conf open = HolderKit.simple(false); - private Conf host = Holders.simple(StringKit.EMPTY); + private HolderKit.Conf host = HolderKit.simple(StringKit.EMPTY); - private Conf port = Holders.simple(22); + private HolderKit.Conf port = HolderKit.simple(22); - private Conf username = Holders.simple(StringKit.EMPTY); + private HolderKit.Conf username = HolderKit.simple(StringKit.EMPTY); - private Conf password = Holders.simple(StringKit.EMPTY); + private HolderKit.Conf password = HolderKit.simple(StringKit.EMPTY); - private Conf privateKeyPath = Holders.simple(StringKit.EMPTY); + private HolderKit.Conf privateKeyPath = HolderKit.simple(StringKit.EMPTY); public boolean isOpen() { @@ -88,12 +87,12 @@ public class RedisConnectionProxyConfig extends DefaultConfiguration { @Override public Object clone() throws CloneNotSupportedException { RedisConnectionProxyConfig cloned = (RedisConnectionProxyConfig) super.clone(); - cloned.open = (Conf) open.clone(); - cloned.host = (Conf) host.clone(); - cloned.port = (Conf) port.clone(); - cloned.username = (Conf) username.clone(); - cloned.password = (Conf) password.clone(); - cloned.privateKeyPath = (Conf) privateKeyPath.clone(); + cloned.open = (HolderKit.Conf) open.clone(); + cloned.host = (HolderKit.Conf) host.clone(); + cloned.port = (HolderKit.Conf) port.clone(); + cloned.username = (HolderKit.Conf) username.clone(); + cloned.password = (HolderKit.Conf) password.clone(); + cloned.privateKeyPath = (HolderKit.Conf) privateKeyPath.clone(); return cloned; } } diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/AbstractVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/AbstractVisitor.java index e0a2fc7..a628046 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/AbstractVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/AbstractVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.DataWrapper; import com.fr.plugin.db.redis.core.RedisConstants; import com.fr.script.Calculator; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/Visitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/Visitor.java index 7a25dc2..9e471d8 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/Visitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/Visitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.DataWrapper; import com.fr.script.Calculator; import com.fr.third.redis.clients.jedis.Jedis; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/VisitorFactory.java b/src/main/java/com/fr/plugin/db/redis/core/visit/VisitorFactory.java index 6141296..3a8710e 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/VisitorFactory.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/VisitorFactory.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.DataWrapper; import com.fr.plugin.db.redis.core.visit.impl.*; import com.fr.script.Calculator; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/GetVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/GetVisitor.java index 947f69c..5d7b67a 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/GetVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/GetVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; import com.fr.third.redis.clients.jedis.Jedis; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashGetVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashGetVisitor.java index b66df87..367d961 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashGetVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashGetVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; import com.fr.third.redis.clients.jedis.Jedis; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashKeysVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashKeysVisitor.java index ee9cba6..8cc815d 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashKeysVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashKeysVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; import com.fr.third.redis.clients.jedis.Jedis; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashMGetVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashMGetVisitor.java index ccae5e5..83fc8dd 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashMGetVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashMGetVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; import com.fr.third.redis.clients.jedis.Jedis; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashVisitor.java index 96822f9..8fef35c 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; import com.fr.third.redis.clients.jedis.Jedis; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/KeysVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/KeysVisitor.java index 8177bb6..ac8c265 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/KeysVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/KeysVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; import com.fr.third.redis.clients.jedis.Jedis; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/ListVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/ListVisitor.java index a254833..7b13510 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/ListVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/ListVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.base.TableData; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/MGetVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/MGetVisitor.java index ba7e07b..ea16cd8 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/MGetVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/MGetVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; import com.fanruan.api.util.ArrayKit; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/SetVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/SetVisitor.java index e51ef06..6b31c68 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/SetVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/SetVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; import com.fr.third.redis.clients.jedis.Jedis; diff --git a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/ZRangeVisitor.java b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/ZRangeVisitor.java index 53c9976..4309f90 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/visit/impl/ZRangeVisitor.java +++ b/src/main/java/com/fr/plugin/db/redis/core/visit/impl/ZRangeVisitor.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.core.visit.impl; -import com.fr.base.Parameter; +import com.fr.stable.ParameterProvider; import com.fr.base.TableData; import com.fr.plugin.db.redis.core.visit.AbstractVisitor; import com.fr.script.Calculator; diff --git a/src/main/java/com/fr/plugin/db/redis/help/Files.java b/src/main/java/com/fr/plugin/db/redis/help/Files.java index 8420e00..d4d21e2 100644 --- a/src/main/java/com/fr/plugin/db/redis/help/Files.java +++ b/src/main/java/com/fr/plugin/db/redis/help/Files.java @@ -1,9 +1,8 @@ package com.fr.plugin.db.redis.help; import com.eclipsesource.v8.V8; -import com.fr.general.IOUtils; -import com.fr.io.utils.ResourceIOUtils; -import com.fr.stable.EncodeConstants; +import com.fanruan.api.util.IOKit; +import com.fanruan.api.consts.EncodeConstantsKit; import java.io.InputStream; import java.io.UnsupportedEncodingException; @@ -23,10 +22,10 @@ public class Files { @ScriptBridge public void require(String filePath) { - InputStream in = ResourceIOUtils.read(filePath); + InputStream in = IOKit.read(filePath); if (in != null) { try { - v8.executeVoidScript(IOUtils.inputStream2String(in, EncodeConstants.ENCODING_UTF_8)); + v8.executeVoidScript(IOKit.inputStream2String(in, EncodeConstantsKit.ENCODING_UTF_8)); } catch (UnsupportedEncodingException ignore) { } diff --git a/src/main/java/com/fr/plugin/db/redis/ui/RedisBaseTableDataPane.java b/src/main/java/com/fr/plugin/db/redis/ui/RedisBaseTableDataPane.java index 7f7cab0..a5382a8 100644 --- a/src/main/java/com/fr/plugin/db/redis/ui/RedisBaseTableDataPane.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/RedisBaseTableDataPane.java @@ -3,15 +3,15 @@ package com.fr.plugin.db.redis.ui; 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.fanruan.api.cal.ParameterKit; import com.fr.base.TableData; -import com.fr.design.data.datapane.preview.PreviewTablePane; +import com.fanruan.api.design.DesignKit; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; -import com.fr.design.gui.itableeditorpane.ParameterTableModel; -import com.fr.design.gui.itableeditorpane.UITableEditAction; -import com.fr.design.gui.itableeditorpane.UITableEditorPane; -import com.fr.design.gui.itoolbar.UIToolbar; -import com.fr.design.i18n.Toolkit; +import com.fanruan.api.design.ui.component.table.model.ParameterTableModel; +import com.fanruan.api.design.ui.component.table.action.UITableEditAction; +import com.fanruan.api.design.ui.component.table.UITableEditorPane; +import com.fanruan.api.design.ui.component.UIToolbar; +import com.fanruan.api.design.DesignKit; import com.fr.design.menu.ToolBarDef; import com.fr.plugin.db.redis.core.order.OrderValue; import com.fanruan.api.util.ArrayKit; @@ -29,8 +29,8 @@ import java.util.ArrayList; */ public abstract class RedisBaseTableDataPane extends AbstractTableDataPane { - private static final String PREVIEW_BUTTON = Toolkit.i18nText("Plugin-Redis_Preview"); - private static final String REFRESH_BUTTON = Toolkit.i18nText("Plugin-Redis_Refresh"); + private static final String PREVIEW_BUTTON = DesignKit.i18nText("Plugin-Redis_Preview"); + private static final String REFRESH_BUTTON = DesignKit.i18nText("Plugin-Redis_Refresh"); protected RedisDBConnectionChosePane chosePane; @@ -82,7 +82,7 @@ public abstract class RedisBaseTableDataPane extends Abstra @Override protected String title4PopupWindow() { - return Toolkit.i18nText("Plugin-Redis_Query"); + return DesignKit.i18nText("Plugin-Redis_Query"); } protected abstract JComponent createQueryPane(); @@ -106,7 +106,7 @@ public abstract class RedisBaseTableDataPane extends Abstra private void checkParameter() { String[] paramTexts = paramTexts(); - ParameterProvider[] parameters = ParameterHelper.analyze4Parameters(paramTexts, false); + ParameterProvider[] parameters = ParameterKit.analyze4Parameters(paramTexts, false); parameters = ArrayKit.addAll(parameters, getOrderValue().analyze4Parameters()); if (parameters.length < 1 && editorPane.update().size() < 1) { @@ -140,7 +140,7 @@ public abstract class RedisBaseTableDataPane extends Abstra public void actionPerformed(ActionEvent evt) { checkParameter(); - PreviewTablePane.previewTableData(RedisBaseTableDataPane.this.updateBean()); + DesignKit.previewTableData(RedisBaseTableDataPane.this.updateBean()); } } diff --git a/src/main/java/com/fr/plugin/db/redis/ui/RedisConnectionPane.java b/src/main/java/com/fr/plugin/db/redis/ui/RedisConnectionPane.java index 39ad667..eb3100b 100755 --- a/src/main/java/com/fr/plugin/db/redis/ui/RedisConnectionPane.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/RedisConnectionPane.java @@ -1,20 +1,19 @@ package com.fr.plugin.db.redis.ui; import com.fr.design.border.UITitledBorder; -import com.fr.design.data.datapane.connect.DatabaseConnectionPane; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.gui.ibutton.UIPasswordField; -import com.fr.design.gui.ilable.ActionLabel; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIIntNumberField; -import com.fr.design.gui.itextfield.UINumberField; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.i18n.Toolkit; +import com.fanruan.api.design.ui.container.DatabaseConnectionPane; +import com.fanruan.api.design.ui.container.BasicDialog; +import com.fanruan.api.design.ui.container.DialogActionAdapter; +import com.fanruan.api.design.ui.component.UIPasswordField; +import com.fanruan.api.design.component.UIActionLabel; +import com.fanruan.api.design.ui.component.UILabel; +import com.fanruan.api.design.ui.component.UIIntNumberField; +import com.fanruan.api.design.ui.component.UINumberField; +import com.fanruan.api.design.ui.component.UITextField; +import com.fanruan.api.design.DesignKit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.utils.gui.GUICoreUtils; +import com.fanruan.api.design.ui.layout.TableLayoutKit; +import com.fanruan.api.design.util.GUICoreKit; import com.fr.plugin.db.redis.core.RedisDatabaseConnection; import com.fr.plugin.db.redis.core.pool.RedisConnectionPoolConfig; import com.fr.plugin.db.redis.core.pool.RedisConnectionProxyConfig; @@ -51,14 +50,14 @@ public class RedisConnectionPane extends DatabaseConnectionPane listeners = new ArrayList(); - private PlaceholderTextField keysPatternTextField; + private UIPlaceholderTextField keysPatternTextField; public RedisDBConnectionChosePane() { setLayout(new BorderLayout(4, 4)); @@ -49,12 +48,12 @@ public class RedisDBConnectionChosePane extends BasicPane { }); JList list = new JList(listModel); - keysPatternTextField = new PlaceholderTextField(10); - keysPatternTextField.setPlaceholder(Toolkit.i18nText("Plugin-Redis_Keys_Pattern")); + keysPatternTextField = new UIPlaceholderTextField(10); + keysPatternTextField.setPlaceholder(DesignKit.i18nText("Plugin-Redis_Keys_Pattern")); JPanel centerPane = new JPanel(new BorderLayout()); - UIButton searchButton = new UIButton(Toolkit.i18nText("Plugin-Redis_Keys_Pattern_Search")); + UIButton searchButton = new UIButton(DesignKit.i18nText("Plugin-Redis_Keys_Pattern_Search")); searchButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -62,7 +61,7 @@ public class RedisDBConnectionChosePane extends BasicPane { } }); - centerPane.add(DesignKit.createBorderLayoutPane( + centerPane.add(GUICoreKit.createBorderLayoutPane( keysPatternTextField, BorderLayout.CENTER, searchButton, BorderLayout.EAST), BorderLayout.NORTH); @@ -78,7 +77,7 @@ public class RedisDBConnectionChosePane extends BasicPane { fireDataLoaded(ArrayKit.EMPTY_STRING_ARRAY); return; } - RedisDatabaseConnection connection = DatasourceManager.getProviderInstance().getConnection(name, RedisDatabaseConnection.class); + RedisDatabaseConnection connection = ConnectionKit.getConnection(name, RedisDatabaseConnection.class); if (connection != null) { listMatchedPatternKeys(connection); } diff --git a/src/main/java/com/fr/plugin/db/redis/ui/RedisQueryPane.java b/src/main/java/com/fr/plugin/db/redis/ui/RedisQueryPane.java index 7d37181..bc2cacd 100755 --- a/src/main/java/com/fr/plugin/db/redis/ui/RedisQueryPane.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/RedisQueryPane.java @@ -1,17 +1,17 @@ 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.layout.TableLayoutKit; +import com.fanruan.api.design.util.GUICoreKit; import com.fanruan.api.log.LogKit; -import com.fr.design.data.datapane.sqlpane.SQLEditPane; -import com.fr.design.editor.ValueEditorPane; -import com.fr.design.gui.ilable.ActionLabel; -import com.fr.design.gui.ilable.UILabel; +import com.fanruan.api.design.container.SQLEditPane; +import com.fanruan.api.design.ui.editor.ValueEditorPane; +import com.fanruan.api.design.component.UIActionLabel; +import com.fanruan.api.design.ui.component.UILabel; import com.fr.design.gui.itextarea.DescriptionTextArea; -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; -import com.fr.design.i18n.Toolkit; +import com.fanruan.api.design.ui.component.code.UISyntaxTextArea; +import com.fanruan.api.design.ui.component.code.SyntaxConstants; +import com.fanruan.api.design.DesignKit; import com.fr.general.SiteCenter; import com.fr.log.FineLoggerFactory; import com.fr.plugin.db.redis.core.order.OrderValue; @@ -29,18 +29,18 @@ public class RedisQueryPane extends BasicPane { private SQLEditPane sqlTextPane; private ValueEditorPane dbIndexEditor; - private RSyntaxTextArea scriptTextPane; + private UISyntaxTextArea scriptTextPane; public RedisQueryPane() { setLayout(new BorderLayout()); sqlTextPane = new SQLEditPane(); - scriptTextPane = new RSyntaxTextArea(); + scriptTextPane = new UISyntaxTextArea(); dbIndexEditor = IndexValuePaneFactory.createValueEditorPane(); - ActionLabel helpLabel = new ActionLabel(Toolkit.i18nText("Plugin-Redis_Help")); + UIActionLabel helpLabel = new UIActionLabel(DesignKit.i18nText("Plugin-Redis_Help")); helpLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -56,11 +56,11 @@ public class RedisQueryPane extends BasicPane { descriptionArea.setWrapStyleWord(true); descriptionArea.setLineWrap(true); - descriptionArea.setText(Toolkit.i18nText("Plugin-Redis_Script_Text_Description")); + descriptionArea.setText(DesignKit.i18nText("Plugin-Redis_Script_Text_Description")); Component[][] coms = new Component[][]{ - {new UILabel(Toolkit.i18nText("Plugin-Redis_DB_Index") + ":"), dbIndexEditor}, - {DesignKit.createBorderLayoutPane(new UILabel(Toolkit.i18nText("Plugin-Redis_Query_Condition") + ":"), BorderLayout.NORTH), + {new UILabel(DesignKit.i18nText("Plugin-Redis_DB_Index") + ":"), dbIndexEditor}, + {GUICoreKit.createBorderLayoutPane(new UILabel(DesignKit.i18nText("Plugin-Redis_Query_Condition") + ":"), BorderLayout.NORTH), 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) // } - double p = LayoutKit.PREFERRED; - double f = LayoutKit.FILL; + double p = TableLayoutKit.PREFERRED; + double f = TableLayoutKit.FILL; double[] rowSize = {p, p}; double[] columnSize = {p, f}; - add(DesignKit.createTableLayoutPane(coms, rowSize, columnSize)); + add(GUICoreKit.createTableLayoutPane(coms, rowSize, columnSize)); } diff --git a/src/main/java/com/fr/plugin/db/redis/ui/RedisScriptPane.java b/src/main/java/com/fr/plugin/db/redis/ui/RedisScriptPane.java index e486f69..7508cc9 100644 --- a/src/main/java/com/fr/plugin/db/redis/ui/RedisScriptPane.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/RedisScriptPane.java @@ -1,13 +1,13 @@ package com.fr.plugin.db.redis.ui; import com.fanruan.api.design.ui.container.BasicPane; +import com.fanruan.api.design.util.GUICoreKit; +import com.fanruan.api.layout.TableLayoutKit; +import com.fanruan.api.design.ui.editor.ValueEditorPane; +import com.fanruan.api.design.ui.component.UILabel; +import com.fanruan.api.design.ui.component.code.UISyntaxTextArea; +import com.fanruan.api.design.ui.component.code.SyntaxConstants; import com.fanruan.api.design.DesignKit; -import com.fanruan.api.layout.LayoutKit; -import com.fr.design.editor.ValueEditorPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; -import com.fr.design.i18n.Toolkit; import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.ui.value.IndexValuePaneFactory; import com.fr.plugin.db.redis.util.RedisDesignUtils; @@ -22,29 +22,29 @@ import java.awt.*; public class RedisScriptPane extends BasicPane { private ValueEditorPane dbIndexEditor; - private RSyntaxTextArea scriptTextPane; + private UISyntaxTextArea scriptTextPane; public RedisScriptPane() { setLayout(new BorderLayout()); - scriptTextPane = new RSyntaxTextArea(); + scriptTextPane = new UISyntaxTextArea(); dbIndexEditor = IndexValuePaneFactory.createValueEditorPane(); Component[][] coms = new Component[][]{ - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Plugin-Redis_DB_Index") + ":"), dbIndexEditor}, - {new UILabel(Toolkit.i18nText("Plugin-Redis_Script_Query_Text") + ":"), + {new UILabel(DesignKit.i18nText("Plugin-Redis_DB_Index") + ":"), dbIndexEditor}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Script_Query_Text") + ":"), RedisDesignUtils.createConditionTextPane(scriptTextPane, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, 350)}, }; - double p = LayoutKit.PREFERRED; - double f = LayoutKit.FILL; + double p = TableLayoutKit.PREFERRED; + double f = TableLayoutKit.FILL; double[] rowSize = {p, p, p}; double[] columnSize = {p, f}; - add(DesignKit.createTableLayoutPane(coms, rowSize, columnSize)); + add(GUICoreKit.createTableLayoutPane(coms, rowSize, columnSize)); } diff --git a/src/main/java/com/fr/plugin/db/redis/ui/RedisScriptTableDataPane.java b/src/main/java/com/fr/plugin/db/redis/ui/RedisScriptTableDataPane.java index 6b17c96..34b814e 100644 --- a/src/main/java/com/fr/plugin/db/redis/ui/RedisScriptTableDataPane.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/RedisScriptTableDataPane.java @@ -1,6 +1,6 @@ package com.fr.plugin.db.redis.ui; -import com.fr.data.impl.NameDatabaseConnection; +import com.fanruan.api.database.nameDatabase.NameDatabaseConnection; import com.fr.plugin.db.redis.core.RedisScriptTableData; import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.script.Calculator; diff --git a/src/main/java/com/fr/plugin/db/redis/ui/RedisTableDataPane.java b/src/main/java/com/fr/plugin/db/redis/ui/RedisTableDataPane.java index 462bff4..0a2c691 100755 --- a/src/main/java/com/fr/plugin/db/redis/ui/RedisTableDataPane.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/RedisTableDataPane.java @@ -1,7 +1,7 @@ package com.fr.plugin.db.redis.ui; -import com.fr.data.impl.NameDatabaseConnection; -import com.fr.design.i18n.Toolkit; +import com.fanruan.api.design.DesignKit; +import com.fanruan.api.database.nameDatabase.NameDatabaseConnection; import com.fr.plugin.db.redis.core.RedisTableData; import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.script.Calculator; @@ -24,7 +24,7 @@ public class RedisTableDataPane extends RedisBaseTableDataPane { @Override protected String title4PopupWindow() { - return Toolkit.i18nText("Plugin-Redis_Query"); + return DesignKit.i18nText("Plugin-Redis_Query"); } protected JComponent createQueryPane() { diff --git a/src/main/java/com/fr/plugin/db/redis/ui/pool/RedisConnectionPoolConfigPane.java b/src/main/java/com/fr/plugin/db/redis/ui/pool/RedisConnectionPoolConfigPane.java index c9b8da7..af2352c 100644 --- a/src/main/java/com/fr/plugin/db/redis/ui/pool/RedisConnectionPoolConfigPane.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/pool/RedisConnectionPoolConfigPane.java @@ -1,13 +1,13 @@ package com.fr.plugin.db.redis.ui.pool; import com.fanruan.api.design.ui.container.BasicPane; -import com.fanruan.api.layout.LayoutKit; +import com.fanruan.api.layout.TableLayoutKit; +import com.fanruan.api.design.util.GUICoreKit; +import com.fanruan.api.design.ui.component.UICheckBox; +import com.fanruan.api.design.ui.component.UILabel; +import com.fanruan.api.design.ui.component.UIIntNumberField; +import com.fanruan.api.design.ui.component.UINumberField; import com.fanruan.api.design.DesignKit; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIIntNumberField; -import com.fr.design.gui.itextfield.UINumberField; -import com.fr.design.i18n.Toolkit; import com.fr.plugin.db.redis.core.pool.RedisConnectionPoolConfig; import javax.swing.*; @@ -43,24 +43,24 @@ public class RedisConnectionPoolConfigPane extends BasicPane { timeoutNumberField = new UIIntNumberField(); JComponent[][] comps = new JComponent[][]{ - {new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Max_Total") + ":"), maxTotalNumberFiled}, - {new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Max_Wait") + ":"), maxWaitNumberField}, - {new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Max_Idle") + ":"), maxIdleNumberField}, - {new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Block_When_Exhausted") + ":"), blockWhenExhaustedCheckBox}, - {new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Lifo") + ":"), lifoCheckBox}, - {new UILabel(Toolkit.i18nText("Plugin-Redis_Pool_Timeout") + ":"), timeoutNumberField} + {new UILabel(DesignKit.i18nText("Plugin-Redis_Pool_Max_Total") + ":"), maxTotalNumberFiled}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Pool_Max_Wait") + ":"), maxWaitNumberField}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Pool_Max_Idle") + ":"), maxIdleNumberField}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Pool_Block_When_Exhausted") + ":"), blockWhenExhaustedCheckBox}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Pool_Lifo") + ":"), lifoCheckBox}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Pool_Timeout") + ":"), timeoutNumberField} }; - double p = LayoutKit.PREFERRED; - double f = LayoutKit.FILL; + double p = TableLayoutKit.PREFERRED; + double f = TableLayoutKit.FILL; double[] rowSize = new double[]{p, p, p, p, p, p}; double[] columnSize = new double[]{p, f}; - add(DesignKit.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER); + add(GUICoreKit.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER); } @Override protected String title4PopupWindow() { - return Toolkit.i18nText("Plugin-Redis_Pool_Config"); + return DesignKit.i18nText("Plugin-Redis_Pool_Config"); } public void populate(RedisConnectionPoolConfig config) { diff --git a/src/main/java/com/fr/plugin/db/redis/ui/proxy/RedisConnectionProxyConfigPane.java b/src/main/java/com/fr/plugin/db/redis/ui/proxy/RedisConnectionProxyConfigPane.java index ef34e8a..b1d9955 100644 --- a/src/main/java/com/fr/plugin/db/redis/ui/proxy/RedisConnectionProxyConfigPane.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/proxy/RedisConnectionProxyConfigPane.java @@ -1,15 +1,15 @@ package com.fr.plugin.db.redis.ui.proxy; import com.fanruan.api.design.ui.container.BasicPane; -import com.fanruan.api.layout.LayoutKit; +import com.fanruan.api.layout.TableLayoutKit; +import com.fanruan.api.design.util.GUICoreKit; +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.UIPassWordField; +import com.fanruan.api.design.ui.component.UIIntNumberField; +import com.fanruan.api.design.ui.component.UITextField; import com.fanruan.api.design.DesignKit; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ipasswordfield.UIPassWordField; -import com.fr.design.gui.itextfield.UIIntNumberField; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.i18n.Toolkit; import com.fr.plugin.db.redis.core.pool.RedisConnectionProxyConfig; import javax.swing.*; @@ -46,22 +46,22 @@ public class RedisConnectionProxyConfigPane extends BasicPane { passwordTextField = new UIPassWordField(); privateKeyPathTextField = new UITextField(); - privateKeyPathTextField.setPlaceholder(Toolkit.i18nText("Plugin-Redis_Proxy_Private_Key_Tip")); + privateKeyPathTextField.setPlaceholder(DesignKit.i18nText("Plugin-Redis_Proxy_Private_Key_Tip")); UIButton fileSelectButton = new UIButton("..."); - UILabel description = new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Description"), SwingConstants.CENTER); + UILabel description = new UILabel(DesignKit.i18nText("Plugin-Redis_Proxy_Description"), SwingConstants.CENTER); JComponent[][] comps = new JComponent[][]{ - {new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Open") + ":"), DesignKit.createBorderLayoutPane( + {new UILabel(DesignKit.i18nText("Plugin-Redis_Proxy_Open") + ":"), GUICoreKit.createBorderLayoutPane( openCheckBox, BorderLayout.WEST, description, BorderLayout.CENTER )}, - {new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Host") + ":"), hostTextField}, - {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_Password") + ":"), passwordTextField}, - {new UILabel(Toolkit.i18nText("Plugin-Redis_Proxy_Private_Key_Path") + ":"), DesignKit.createBorderLayoutPane( + {new UILabel(DesignKit.i18nText("Plugin-Redis_Proxy_Host") + ":"), hostTextField}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Proxy_Port") + ":"), portNumberField}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Proxy_Username") + ":"), usernameTextField}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Proxy_Password") + ":"), passwordTextField}, + {new UILabel(DesignKit.i18nText("Plugin-Redis_Proxy_Private_Key_Path") + ":"), GUICoreKit.createBorderLayoutPane( privateKeyPathTextField, BorderLayout.CENTER, fileSelectButton, BorderLayout.EAST )}, @@ -78,18 +78,18 @@ public class RedisConnectionProxyConfigPane extends BasicPane { } }); - double p = LayoutKit.PREFERRED; - double f = LayoutKit.FILL; + double p = TableLayoutKit.PREFERRED; + double f = TableLayoutKit.FILL; double[] rowSize = new double[]{p, p, p, p, p, p}; double[] columnSize = new double[]{p, f}; - add(DesignKit.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER); + add(GUICoreKit.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER); } @Override protected String title4PopupWindow() { - return Toolkit.i18nText("Plugin-Redis_Proxy_Config"); + return DesignKit.i18nText("Plugin-Redis_Proxy_Config"); } public void populate(RedisConnectionProxyConfig config) { diff --git a/src/main/java/com/fr/plugin/db/redis/ui/value/FormulaEditor.java b/src/main/java/com/fr/plugin/db/redis/ui/value/FormulaEditor.java index 4d1f6d7..ec23427 100644 --- a/src/main/java/com/fr/plugin/db/redis/ui/value/FormulaEditor.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/value/FormulaEditor.java @@ -1,12 +1,12 @@ package com.fr.plugin.db.redis.ui.value; import com.fr.base.BaseFormula; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.editor.editor.Editor; +import com.fanruan.api.design.ui.container.DialogActionAdapter; +import com.fanruan.api.design.ui.editor.Editor; import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.i18n.Toolkit; +import com.fanruan.api.design.ui.component.UITextField; +import com.fanruan.api.design.DesignKit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.plugin.db.redis.core.order.impl.FormulaOrderValue; @@ -27,7 +27,7 @@ public class FormulaEditor extends Editor { * Constructor. */ public FormulaEditor() { - this(Toolkit.i18nText("Plugin-Redis_Formula")); + this(DesignKit.i18nText("Plugin-Redis_Formula")); } public FormulaEditor(String name) { diff --git a/src/main/java/com/fr/plugin/db/redis/ui/value/IndexValuePaneFactory.java b/src/main/java/com/fr/plugin/db/redis/ui/value/IndexValuePaneFactory.java index abe3739..249622c 100644 --- a/src/main/java/com/fr/plugin/db/redis/ui/value/IndexValuePaneFactory.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/value/IndexValuePaneFactory.java @@ -1,8 +1,8 @@ package com.fr.plugin.db.redis.ui.value; -import com.fr.design.editor.ValueEditorPane; -import com.fr.design.editor.ValueEditorPaneFactory; -import com.fr.design.editor.editor.Editor; +import com.fanruan.api.design.ui.editor.ValueEditorPane; +import com.fanruan.api.design.ui.editor.ValueEditorPane; +import com.fanruan.api.design.ui.editor.Editor; public class IndexValuePaneFactory { diff --git a/src/main/java/com/fr/plugin/db/redis/ui/value/IntegerEditor.java b/src/main/java/com/fr/plugin/db/redis/ui/value/IntegerEditor.java index 71a6fc0..076431c 100644 --- a/src/main/java/com/fr/plugin/db/redis/ui/value/IntegerEditor.java +++ b/src/main/java/com/fr/plugin/db/redis/ui/value/IntegerEditor.java @@ -1,9 +1,9 @@ package com.fr.plugin.db.redis.ui.value; -import com.fr.base.Utils; -import com.fr.design.editor.editor.Editor; -import com.fr.design.gui.itextfield.UIIntNumberField; -import com.fr.design.gui.itextfield.UITextField; +import com.fanruan.api.util.GeneralKit; +import com.fanruan.api.design.ui.editor.Editor; +import com.fanruan.api.design.ui.component.UIIntNumberField; +import com.fanruan.api.design.ui.component.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue; import com.fr.stable.StringUtils; @@ -101,7 +101,7 @@ public class IntegerEditor extends Editor { value = new NumberOrderValue(0); } this.numberField.setValue(value.getValue()); - oldValue = Utils.objectToString(value); + oldValue = GeneralKit.objectToString(value); } diff --git a/src/main/java/com/fr/plugin/db/redis/util/RedisDesignUtils.java b/src/main/java/com/fr/plugin/db/redis/util/RedisDesignUtils.java index d6822d2..936a265 100644 --- a/src/main/java/com/fr/plugin/db/redis/util/RedisDesignUtils.java +++ b/src/main/java/com/fr/plugin/db/redis/util/RedisDesignUtils.java @@ -2,8 +2,8 @@ package com.fr.plugin.db.redis.util; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.UIConstants; -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; -import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane; +import com.fanruan.api.design.ui.component.code.UISyntaxTextArea; +import com.fanruan.api.design.ui.component.code.UISyntaxTextScrollPane; import java.awt.*; @@ -13,9 +13,9 @@ import java.awt.*; * Created by richie on 2019-03-18 */ public class RedisDesignUtils { - public static RTextScrollPane createConditionTextPane(RSyntaxTextArea editorPane, String type, int height) { + public static UISyntaxTextScrollPane createConditionTextPane(UISyntaxTextArea editorPane, String type, int height) { editorPane.setSyntaxEditingStyle(type); - RTextScrollPane sqlTextScrollPane = new RTextScrollPane(editorPane); + UISyntaxTextScrollPane sqlTextScrollPane = new UISyntaxTextScrollPane(editorPane); sqlTextScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); sqlTextScrollPane.setPreferredSize(new Dimension(680, height)); sqlTextScrollPane.setLineNumbersEnabled(false); diff --git a/src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java b/src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java index 3ce98bb..48f1e24 100644 --- a/src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java +++ b/src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java @@ -1,8 +1,8 @@ package com.fr.plugin.db.redis.util; import com.eclipsesource.v8.V8Object; -import com.fr.base.Parameter; -import com.fr.base.TemplateUtils; +import com.fr.stable.ParameterProvider; +import com.fanruan.api.util.RenderKit; import com.fr.plugin.db.redis.help.ScriptBridge; import com.fr.stable.ArrayUtils; import com.fr.third.redis.clients.jedis.Jedis; @@ -35,7 +35,7 @@ public class RedisUtils { map.put(p.getName(), p.getValue()); } try { - return TemplateUtils.renderParameter4Tpl(query, map); + return RenderKit.renderParameter4Tpl(query, map); } catch (Exception e) { return query; }