Browse Source

update: 一些方法的更新。

pull/12/head
zjz1993 5 years ago
parent
commit
9f8ff199fc
  1. 24
      pom.xml
  2. 4
      src/main/java/com/fr/plugin/db/redis/RedisScriptTableDataDefine.java
  3. 8
      src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java
  4. 6
      src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java
  5. 6
      src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java
  6. 4
      src/main/java/com/fr/plugin/db/redis/ui/RedisConnectionPane.java
  7. 1
      src/main/java/com/fr/plugin/db/redis/ui/RedisQueryPane.java
  8. 8
      src/main/java/com/fr/plugin/db/redis/ui/value/FormulaEditor.java
  9. 4
      src/main/java/com/fr/plugin/db/redis/ui/value/IntegerEditor.java
  10. 4
      src/main/java/com/fr/plugin/db/redis/util/RedisDesignUtils.java
  11. 4
      src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java

24
pom.xml

@ -42,4 +42,28 @@
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>fanruan</id>
<name>fanruan</name>
<url>http://mvn.finedevelop.com/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>fanruan</id>
<name>fanruan</name>
<url>http://mvn.finedevelop.com/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

4
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.design.util.I18nDesignKit;
import com.fanruan.api.i18n.I18nKit;
/**
* @author richie
@ -37,7 +37,7 @@ public class RedisScriptTableDataDefine extends AbstractTableDataDefineProvider
@Override
public String nameForTableData() {
return I18nDesignKit.i18nText("Plugin-Redis_Script_Table_Data");
return I18nKit.getLocText("Plugin-Redis_Script_Table_Data");
}
@Override

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

@ -1,10 +1,10 @@
package com.fr.plugin.db.redis.core;
import cpm.fanruan.api.conf.HolderKit;
import com.fr.config.holder.impl.ColConf;
import com.fanruan.api.conf.impl.ColConf;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fanruan.api.design.util.I18nDesignKit;
import com.fanruan.api.i18n.I18nKit;
import com.fr.plugin.db.redis.core.emb.Redis;
import com.fanruan.api.security.SecurityKit;
import com.fanruan.api.util.ArrayKit;
@ -95,9 +95,9 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection {
@Override
public String connectMessage(boolean status) {
if (status) {
return I18nDesignKit.i18nText("Plugin-Redis_Connection_Successfully") + "!";
return I18nKit.getLocText("Plugin-Redis_Connection_Successfully") + "!";
} else {
return I18nDesignKit.i18nText("Plugin-Redis_Connection_Failed") + "!";
return I18nKit.getLocText("Plugin-Redis_Connection_Failed") + "!";
}
}

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

@ -5,7 +5,7 @@ import com.fr.base.TableData;
import com.fanruan.api.conf.HolderKit;
import com.fr.config.holder.factory.XmlHolders;
import com.fr.data.AbstractParameterTableData;
import com.fanruan.api.database.DatabaseKit;
import com.fanruan.api.xml.XmlKit;
import com.fr.data.impl.Connection;
import com.fanruan.api.database.nameDatabase.NameDatabaseConnection;
import com.fanruan.api.data.ConnectionKit;
@ -106,7 +106,7 @@ public class RedisScriptTableData extends AbstractParameterTableData {
}
} else if (com.fr.data.impl.Connection.XML_TAG.equals(tmpName)) {
if (reader.getAttrAsString("class", null) != null) {
com.fr.data.impl.Connection con = DatabaseKit.readXMLConnection(reader);
com.fr.data.impl.Connection con = XmlKit.readXMLConnection(reader);
this.setDatabase(con);
}
} else if ("Script".equals(tmpName)) {
@ -123,7 +123,7 @@ public class RedisScriptTableData extends AbstractParameterTableData {
super.writeXML(writer);
XmlKit.writeXMLable(writer, dbIndex.get(), OrderValue.XML_TAG);
if (this.database.get() != null) {
DatabaseKit.writeXMLConnection(writer, this.database.get());
XmlKit.writeXMLConnection(writer, this.database.get());
}
writer.startTAG("Script").textNode(getScript()).end();
}

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

@ -5,7 +5,7 @@ import com.fr.base.TableData;
import com.fanruan.api.conf.HolderKit;
import com.fr.config.holder.factory.XmlHolders;
import com.fr.data.AbstractParameterTableData;
import com.fanruan.api.database.DatabaseKit;
import com.fanruan.api.xml.XmlKit;
import com.fr.data.impl.Connection;
import com.fanruan.api.database.nameDatabase.NameDatabaseConnection;
import com.fanruan.api.data.ConnectionKit;
@ -118,7 +118,7 @@ public class RedisTableData extends AbstractParameterTableData {
}
} else if (com.fr.data.impl.Connection.XML_TAG.equals(tmpName)) {
if (reader.getAttrAsString("class", null) != null) {
com.fr.data.impl.Connection con = DatabaseKit.readXMLConnection(reader);
com.fr.data.impl.Connection con = XmlKit.readXMLConnection(reader);
this.setDatabase(con);
}
} else if ("Query".equals(tmpName)) {
@ -140,7 +140,7 @@ public class RedisTableData extends AbstractParameterTableData {
super.writeXML(writer);
XmlKit.writeXMLable(writer, dbIndex.get(), OrderValue.XML_TAG);
if (this.database.get() != null) {
DatabaseKit.writeXMLConnection(writer, this.database.get());
XmlKit.writeXMLConnection(writer, this.database.get());
}
writer.startTAG("Query").textNode(getQuery()).end();
writer.startTAG("Script").textNode(getScript()).end();

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

@ -11,7 +11,7 @@ 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.fanruan.api.design.util.GUICoreKit;
import com.fanruan.api.design.ui.layout.TableLayoutKit;
import com.fanruan.api.design.util.GUICoreKit;
import com.fr.plugin.db.redis.core.RedisDatabaseConnection;
@ -108,7 +108,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<com.fr.plugin.db
JPanel settingsUI = TableLayoutKit.createTableLayoutPane(components, rowSize, columnSize);
settingsUI.setBorder(UITitledBorder.createBorderWithTitle("Redis"));
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
JPanel centerPane = GUICoreKit.createNormalFlowInnerContainerPane();
centerPane.add(settingsUI);

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

@ -13,7 +13,6 @@ 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;
import com.fr.plugin.db.redis.ui.value.IndexValuePaneFactory;
import com.fr.plugin.db.redis.util.RedisDesignUtils;

8
src/main/java/com/fr/plugin/db/redis/ui/value/FormulaEditor.java

@ -3,11 +3,11 @@ package com.fr.plugin.db.redis.ui.value;
import com.fr.base.BaseFormula;
import com.fanruan.api.design.ui.container.DialogActionAdapter;
import com.fanruan.api.design.ui.editor.Editor;
import com.fr.design.formula.FormulaFactory;
import com.fanruan.api.design.ui.factory.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fanruan.api.design.ui.component.UITextField;
import com.fanruan.api.design.DesignKit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fanruan.api.design.util.GUICoreKit;
import com.fr.plugin.db.redis.core.order.impl.FormulaOrderValue;
import javax.swing.*;
@ -38,9 +38,9 @@ public class FormulaEditor extends Editor<FormulaOrderValue> {
if (formula != null) {
this.orderValue = formula;
}
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setLayout(GUICoreKit.createBorderLayout());
JPanel editPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel editPane = GUICoreKit.createBorderLayoutPane();
currentTextField = new UITextField(28);
currentTextField.setText(this.orderValue.getValue().getContent());

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

@ -4,7 +4,7 @@ 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.fanruan.api.design.util.GUICoreKit;
import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue;
import com.fr.stable.StringUtils;
@ -32,7 +32,7 @@ public class IntegerEditor extends Editor<NumberOrderValue> {
* Constructor.
*/
public IntegerEditor(NumberOrderValue value, String name) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setLayout(GUICoreKit.createBorderLayout());
numberField = new UIIntNumberField();
this.add(numberField, BorderLayout.CENTER);
this.numberField.addKeyListener(textKeyListener);

4
src/main/java/com/fr/plugin/db/redis/util/RedisDesignUtils.java

@ -1,7 +1,7 @@
package com.fr.plugin.db.redis.util;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fanruan.api.design.ui.component.UIRoundedBorder;
import com.fanruan.api.design.macro.UIConstants;
import com.fanruan.api.design.ui.component.code.UISyntaxTextArea;
import com.fanruan.api.design.ui.component.code.UISyntaxTextScrollPane;

4
src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java

@ -4,7 +4,7 @@ import com.eclipsesource.v8.V8Object;
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.fanruan.api.util.ArrayKit;
import com.fr.third.redis.clients.jedis.Jedis;
import java.lang.reflect.Method;
@ -27,7 +27,7 @@ public class RedisUtils {
}
public static String calculateQuery(String query, Parameter[] ps) {
if (ArrayUtils.isEmpty(ps)) {
if (ArrayKit.isEmpty(ps)) {
return query;
}
Map<String, Object> map = new HashMap<String, Object>();

Loading…
Cancel
Save