Browse Source

FineKit验证

pull/12/head
richie 5 years ago
parent
commit
f8671768f1
  1. BIN
      lib/finekit-10.0-20190830.jar
  2. 3
      src/main/java/com/fr/plugin/db/redis/core/RedisPool.java
  3. 4
      src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java
  4. 4
      src/main/java/com/fr/plugin/db/redis/core/order/OrderValue.java
  5. 4
      src/main/java/com/fr/plugin/db/redis/core/order/impl/FormulaOrderValue.java
  6. 4
      src/main/java/com/fr/plugin/db/redis/core/order/impl/NumberOrderValue.java
  7. 1
      src/main/java/com/fr/plugin/db/redis/core/visit/impl/GetVisitor.java
  8. 3
      src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashGetVisitor.java
  9. 3
      src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashMGetVisitor.java
  10. 4
      src/main/java/com/fr/plugin/db/redis/help/Files.java
  11. 22
      src/main/java/com/fr/plugin/db/redis/ui/RedisBaseTableDataPane.java
  12. 8
      src/main/java/com/fr/plugin/db/redis/ui/RedisConnectionPane.java
  13. 2
      src/main/java/com/fr/plugin/db/redis/ui/RedisDBConnectionChosePane.java
  14. 29
      src/main/java/com/fr/plugin/db/redis/ui/RedisQueryPane.java
  15. 13
      src/main/java/com/fr/plugin/db/redis/ui/RedisScriptPane.java
  16. 6
      src/main/java/com/fr/plugin/db/redis/ui/RedisScriptTableDataPane.java
  17. 6
      src/main/java/com/fr/plugin/db/redis/ui/RedisTableDataPane.java
  18. 18
      src/main/java/com/fr/plugin/db/redis/ui/proxy/RedisConnectionProxyConfigPane.java
  19. 16
      src/main/java/com/fr/plugin/db/redis/ui/value/FormulaEditor.java
  20. 6
      src/main/java/com/fr/plugin/db/redis/ui/value/IndexValuePaneFactory.java
  21. 9
      src/main/java/com/fr/plugin/db/redis/ui/value/IntegerEditor.java

BIN
lib/finekit-10.0-20190830.jar

Binary file not shown.

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

@ -2,7 +2,6 @@ package com.fr.plugin.db.redis.core;
import com.fanruan.api.log.LogKit;
import com.fanruan.api.util.StringKit;
import com.fr.config.Configuration;
import com.fr.config.holder.ConfigChangeListener;
import com.fr.plugin.db.redis.core.emb.Redis;
import com.fr.plugin.db.redis.core.emb.impl.ProxyRedis;
@ -37,7 +36,7 @@ public class RedisPool {
}
@Override
public boolean accept(Class<? extends Configuration> clazz) {
public boolean accept(Class clazz) {
return RedisConnectionPoolConfig.class == clazz;
}
});

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

@ -1,13 +1,13 @@
package com.fr.plugin.db.redis.core;
import com.fanruan.api.conf.HolderKit;
import com.fanruan.api.conf.xml.XmlHolderKit;
import com.fanruan.api.data.ConnectionKit;
import com.fanruan.api.log.LogKit;
import com.fanruan.api.util.StringKit;
import com.fanruan.api.xml.XmlKit;
import com.fr.base.TableData;
import com.fr.config.holder.Conf;
import com.fr.config.holder.factory.XmlHolders;
import com.fr.data.AbstractParameterTableData;
import com.fr.data.impl.Connection;
import com.fr.general.data.DataModel;
@ -29,7 +29,7 @@ public class RedisTableData extends AbstractParameterTableData {
private static final long serialVersionUID = 7017455818551800001L;
private Conf<Connection> database = HolderKit.obj(null, Connection.class);
private Conf<OrderValue> dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG);
private Conf<OrderValue> dbIndex = XmlHolderKit.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG);
private Conf<String> query = HolderKit.simple(StringKit.EMPTY);
private Conf<String> script = HolderKit.simple(StringKit.EMPTY);

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

@ -2,8 +2,8 @@ package com.fr.plugin.db.redis.core.order;
import com.fanruan.api.conf.BaseUniqueKey;
import com.fanruan.api.util.GeneralKit;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fr.stable.script.CalculatorProvider;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader;
@ -16,7 +16,7 @@ public abstract class OrderValue extends BaseUniqueKey implements XMLable {
public abstract Object getValue();
public abstract int toIndex(Calculator cal, ParameterProvider[] ps);
public abstract int toIndex(CalculatorProvider cal, ParameterProvider[] ps);
public ParameterProvider[] analyze4Parameters() {
return new ParameterProvider[0];

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

@ -7,8 +7,8 @@ import com.fanruan.api.util.GeneralKit;
import com.fanruan.api.util.StringKit;
import com.fr.base.BaseFormula;
import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fr.stable.script.CalculatorProvider;
import com.fr.stable.script.NameSpace;
import com.fr.stable.xml.XMLableReader;
@ -34,7 +34,7 @@ public class FormulaOrderValue extends OrderValue {
}
@Override
public int toIndex(Calculator cal, ParameterProvider[] ps) {
public int toIndex(CalculatorProvider cal, ParameterProvider[] ps) {
NameSpace nameSpace = ParameterKit.createParameterMapNameSpace(ps);
cal.pushNameSpace(nameSpace);
try {

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

@ -1,8 +1,8 @@
package com.fr.plugin.db.redis.core.order.impl;
import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fr.stable.script.CalculatorProvider;
import com.fr.stable.xml.XMLableReader;
public class NumberOrderValue extends OrderValue {
@ -24,7 +24,7 @@ public class NumberOrderValue extends OrderValue {
}
@Override
public int toIndex(Calculator cal, ParameterProvider[] ps) {
public int toIndex(CalculatorProvider cal, ParameterProvider[] ps) {
return getValue();
}

1
src/main/java/com/fr/plugin/db/redis/core/visit/impl/GetVisitor.java

@ -1,7 +1,6 @@
package com.fr.plugin.db.redis.core.visit.impl;
import com.fr.plugin.db.redis.core.visit.AbstractVisitor;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fr.stable.script.CalculatorProvider;
import com.fr.third.redis.clients.jedis.Jedis;

3
src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashGetVisitor.java

@ -1,8 +1,7 @@
package com.fr.plugin.db.redis.core.visit.impl;
import com.fr.stable.ParameterProvider;
import com.fr.plugin.db.redis.core.visit.AbstractVisitor;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fr.stable.script.CalculatorProvider;
import com.fr.third.redis.clients.jedis.Jedis;

3
src/main/java/com/fr/plugin/db/redis/core/visit/impl/HashMGetVisitor.java

@ -1,8 +1,7 @@
package com.fr.plugin.db.redis.core.visit.impl;
import com.fr.stable.ParameterProvider;
import com.fr.plugin.db.redis.core.visit.AbstractVisitor;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fr.stable.script.CalculatorProvider;
import com.fr.third.redis.clients.jedis.Jedis;

4
src/main/java/com/fr/plugin/db/redis/help/Files.java

@ -2,10 +2,10 @@ package com.fr.plugin.db.redis.help;
import com.eclipsesource.v8.V8;
import com.fanruan.api.util.IOKit;
import com.fanruan.api.macro.EncodeConstants;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
/**
* @author richie
@ -25,7 +25,7 @@ public class Files {
InputStream in = IOKit.read(filePath);
if (in != null) {
try {
v8.executeVoidScript(IOKit.inputStream2String(in, EncodeConstants.ENCODING_UTF_8));
v8.executeVoidScript(IOKit.inputStream2String(in, StandardCharsets.UTF_8));
} catch (UnsupportedEncodingException ignore) {
}

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

@ -1,21 +1,18 @@
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.fanruan.api.cal.ParameterKit;
import com.fr.base.TableData;
import com.fanruan.api.design.DesignKit;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
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.action.UpdateAction;
import com.fanruan.api.design.ui.component.UIToolbar;
import com.fanruan.api.design.DesignKit;
import com.fr.design.menu.ToolBarDef;
import com.fanruan.api.design.ui.component.table.UITableEditorPane;
import com.fanruan.api.design.ui.component.table.action.UITableEditAction;
import com.fanruan.api.design.ui.component.table.model.ParameterTableModel;
import com.fanruan.api.design.ui.toolbar.ToolBarDef;
import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fanruan.api.util.ArrayKit;
import com.fanruan.api.util.IOKit;
import com.fr.base.TableData;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.stable.ParameterProvider;
import javax.swing.*;
@ -52,7 +49,7 @@ public abstract class RedisBaseTableDataPane<T extends TableData> extends Abstra
ParameterTableModel model = new ParameterTableModel() {
@Override
public UITableEditAction[] createAction() {
return ArrayKit.add(super.createDBTableAction(), new RedisBaseTableDataPane.RefreshAction());
return new UITableEditAction[]{new MoveUpAction(), new MoveDownAction(), new RedisBaseTableDataPane.RefreshAction()};
}
};
editorPane = new UITableEditorPane<ParameterProvider>(model);
@ -162,5 +159,4 @@ public abstract class RedisBaseTableDataPane<T extends TableData> extends Abstra
}
}

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

@ -1,5 +1,7 @@
package com.fr.plugin.db.redis.ui;
import com.fanruan.api.conf.ConfigurationKit;
import com.fanruan.api.conf.Runner;
import com.fanruan.api.design.DesignKit;
import com.fanruan.api.design.ui.component.UIActionLabel;
import com.fanruan.api.design.ui.component.UIIntNumberField;
@ -17,8 +19,6 @@ import com.fr.plugin.db.redis.core.pool.RedisConnectionPoolConfig;
import com.fr.plugin.db.redis.core.pool.RedisConnectionProxyConfig;
import com.fr.plugin.db.redis.ui.pool.RedisConnectionPoolConfigPane;
import com.fr.plugin.db.redis.ui.proxy.RedisConnectionProxyConfigPane;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.*;
import java.awt.*;
@ -64,7 +64,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
BasicDialog dialog = poolConfigPane.showWindow(SwingUtilities.getWindowAncestor(RedisConnectionPane.this), new DialogActionAdapter() {
@Override
public void doOk() {
Configurations.modify(new WorkerFacade(RedisConnectionPoolConfig.class) {
ConfigurationKit.modify(RedisConnectionPoolConfig.class, new Runner() {
@Override
public void run() {
poolConfigPane.update(poolConfig);
@ -84,7 +84,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
BasicDialog dialog = proxyConfigPane.showWindow(SwingUtilities.getWindowAncestor(RedisConnectionPane.this), new DialogActionAdapter() {
@Override
public void doOk() {
Configurations.modify(new WorkerFacade(RedisConnectionProxyConfig.class) {
ConfigurationKit.modify(RedisConnectionProxyConfig.class, new Runner() {
@Override
public void run() {
proxyConfigPane.update(proxyConfig);

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

@ -1,8 +1,8 @@
package com.fr.plugin.db.redis.ui;
import com.fanruan.api.design.work.ConnectionComboBoxPanel;
import com.fr.data.impl.Connection;
import com.fr.data.operator.DataOperator;
import com.fanruan.api.design.ui.container.ConnectionComboBoxPanel;
import com.fanruan.api.design.ui.component.UIButton;
import com.fanruan.api.design.ui.component.UIPlaceholderTextField;
import com.fanruan.api.design.DesignKit;

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

@ -1,18 +1,17 @@
package com.fr.plugin.db.redis.ui;
import com.fanruan.api.design.DesignKit;
import com.fanruan.api.design.ui.component.UIActionLabel;
import com.fanruan.api.design.ui.component.UILabel;
import com.fanruan.api.design.ui.component.code.SyntaxConstants;
import com.fanruan.api.design.ui.component.code.UISyntaxTextArea;
import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.layout.TableLayoutKit;
import com.fanruan.api.design.ui.editor.ValueEditorPane;
import com.fanruan.api.design.ui.layout.TableLayoutKit;
import com.fanruan.api.design.util.GUICoreKit;
import com.fanruan.api.log.LogKit;
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.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.net.CloudKit;
import com.fr.design.gui.itextarea.DescriptionTextArea;
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;
@ -26,14 +25,14 @@ import java.net.URI;
public class RedisQueryPane extends BasicPane {
private SQLEditPane sqlTextPane;
private UISyntaxTextArea sqlTextPane;
private ValueEditorPane dbIndexEditor;
private UISyntaxTextArea scriptTextPane;
public RedisQueryPane() {
setLayout(new BorderLayout());
sqlTextPane = new SQLEditPane();
sqlTextPane = new UISyntaxTextArea();
scriptTextPane = new UISyntaxTextArea();
@ -60,20 +59,16 @@ public class RedisQueryPane extends BasicPane {
Component[][] coms = new Component[][]{
{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)}
RedisDesignUtils.createConditionTextPane(sqlTextPane, SyntaxConstants.SYNTAX_STYLE_NONE, 300)}
};
// {GUICoreUtils.createBorderLayoutPane(new UILabel(Toolkit.i18nText("Plugin-Redis_Script_Text") + ":"), BorderLayout.NORTH),
// RedisDesignUtils.createConditionTextPane(scriptTextPane, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, 200)
// }
double p = TableLayoutKit.PREFERRED;
double f = TableLayoutKit.FILL;
double[] rowSize = {p, p};
double[] columnSize = {p, f};
add(GUICoreKit.createTableLayoutPane(coms, rowSize, columnSize));
add(TableLayoutKit.createTableLayoutPane(coms, rowSize, columnSize));
}

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

@ -1,13 +1,12 @@
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.DesignKit;
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.design.ui.component.code.UISyntaxTextArea;
import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.design.ui.editor.ValueEditorPane;
import com.fanruan.api.design.ui.layout.TableLayoutKit;
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;
@ -44,7 +43,7 @@ public class RedisScriptPane extends BasicPane {
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
add(GUICoreKit.createTableLayoutPane(coms, rowSize, columnSize));
add(TableLayoutKit.createTableLayoutPane(coms, rowSize, columnSize));
}

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

@ -1,11 +1,11 @@
package com.fr.plugin.db.redis.ui;
import com.fanruan.api.database.nameDatabase.NameReference;
import com.fanruan.api.data.ConnectionKit;
import com.fanruan.api.util.StringKit;
import com.fr.plugin.db.redis.core.RedisScriptTableData;
import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fanruan.api.util.StringKit;
import javax.swing.*;
import java.util.List;
@ -62,7 +62,7 @@ public class RedisScriptTableDataPane extends RedisBaseTableDataPane<RedisScript
RedisScriptTableData tableData = new RedisScriptTableData();
String connectionName = chosePane.getSelectRedisConnectionName();
if (StringKit.isNotEmpty(connectionName)) {
tableData.setDatabase(new NameReference(connectionName));
tableData.setDatabase(ConnectionKit.createNameConnection(connectionName));
}
List<ParameterProvider> parameterList = editorPane.update();
ParameterProvider[] parameters = parameterList.toArray(new ParameterProvider[parameterList.size()]);

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

@ -1,12 +1,12 @@
package com.fr.plugin.db.redis.ui;
import com.fanruan.api.data.ConnectionKit;
import com.fanruan.api.design.DesignKit;
import com.fanruan.api.database.nameDatabase.NameReference;
import com.fanruan.api.util.StringKit;
import com.fr.plugin.db.redis.core.RedisTableData;
import com.fr.plugin.db.redis.core.order.OrderValue;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fanruan.api.util.StringKit;
import javax.swing.*;
import java.util.List;
@ -69,7 +69,7 @@ public class RedisTableDataPane extends RedisBaseTableDataPane<RedisTableData> {
String connectionName = chosePane.getSelectRedisConnectionName();
if (StringKit.isNotEmpty(connectionName)) {
tableData.setDatabase(new NameReference(connectionName));
tableData.setDatabase(ConnectionKit.createNameConnection(connectionName));
}
List<ParameterProvider> parameterList = editorPane.update();

18
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.TableLayoutKit;
import com.fanruan.api.design.util.GUICoreKit;
import com.fanruan.api.design.DesignKit;
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.UILabel;
import com.fanruan.api.design.ui.component.UIPasswordField;
import com.fanruan.api.design.ui.component.UITextField;
import com.fanruan.api.design.DesignKit;
import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.design.ui.layout.TableLayoutKit;
import com.fanruan.api.design.util.GUICoreKit;
import com.fr.plugin.db.redis.core.pool.RedisConnectionProxyConfig;
import javax.swing.*;
@ -30,7 +30,7 @@ public class RedisConnectionProxyConfigPane extends BasicPane {
private UITextField hostTextField;
private UIIntNumberField portNumberField;
private UITextField usernameTextField;
private UIPassWordField passwordTextField;
private UIPasswordField passwordTextField;
private UITextField privateKeyPathTextField;
public RedisConnectionProxyConfigPane() {
@ -43,7 +43,7 @@ public class RedisConnectionProxyConfigPane extends BasicPane {
portNumberField = new UIIntNumberField();
usernameTextField = new UITextField();
passwordTextField = new UIPassWordField();
passwordTextField = new UIPasswordField();
privateKeyPathTextField = new UITextField();
privateKeyPathTextField.setPlaceholder(DesignKit.i18nText("Plugin-Redis_Proxy_Private_Key_Tip"));
@ -83,7 +83,7 @@ public class RedisConnectionProxyConfigPane extends BasicPane {
double[] rowSize = new double[]{p, p, p, p, p, p};
double[] columnSize = new double[]{p, f};
add(GUICoreKit.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER);
add(TableLayoutKit.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.CENTER);
}

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

@ -1,13 +1,13 @@
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.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.fanruan.api.design.ui.component.UITextField;
import com.fanruan.api.design.ui.container.DialogActionAdapter;
import com.fanruan.api.design.util.GUICoreKit;
import com.fanruan.api.design.work.formula.FormulaUIKit;
import com.fr.base.BaseFormula;
import com.fr.design.editor.editor.Editor;
import com.fr.design.formula.UIFormula;
import com.fr.plugin.db.redis.core.order.impl.FormulaOrderValue;
import javax.swing.*;
@ -38,7 +38,7 @@ public class FormulaEditor extends Editor<FormulaOrderValue> {
if (formula != null) {
this.orderValue = formula;
}
this.setLayout(GUICoreKit.createBorderLayout());
this.setLayout(new BorderLayout());
JPanel editPane = GUICoreKit.createBorderLayoutPane();
currentTextField = new UITextField(28);
@ -78,7 +78,7 @@ public class FormulaEditor extends Editor<FormulaOrderValue> {
protected void showFormulaPane() {
final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula();
final UIFormula formulaPane = FormulaUIKit.createFormulaPaneWhenReserveFormula();
formulaPane.populate(orderValue.getValue());
formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(FormulaEditor.this), new DialogActionAdapter() {

6
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.fanruan.api.design.ui.editor.ValueEditorPane;
import com.fanruan.api.design.ui.editor.ValueEditorPane;
import com.fanruan.api.design.ui.editor.Editor;
import com.fanruan.api.design.ui.editor.ValueEditors;
import com.fr.design.editor.editor.Editor;
public class IndexValuePaneFactory {
@ -12,7 +12,7 @@ public class IndexValuePaneFactory {
* @return 返回pane
*/
public static ValueEditorPane createValueEditorPane() {
return ValueEditorPaneFactory.createValueEditorPane(new Editor[]{
return ValueEditors.createValueEditorPane(new Editor[]{
new IntegerEditor(),
new FormulaEditor()
});

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

@ -1,12 +1,11 @@
package com.fr.plugin.db.redis.ui.value;
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.fanruan.api.design.util.GUICoreKit;
import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue;
import com.fanruan.api.util.GeneralKit;
import com.fanruan.api.util.StringKit;
import com.fr.design.editor.editor.Editor;
import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue;
import java.awt.*;
import java.awt.event.KeyAdapter;
@ -32,7 +31,7 @@ public class IntegerEditor extends Editor<NumberOrderValue> {
* Constructor.
*/
public IntegerEditor(NumberOrderValue value, String name) {
this.setLayout(GUICoreKit.createBorderLayout());
this.setLayout(new BorderLayout());
numberField = new UIIntNumberField();
this.add(numberField, BorderLayout.CENTER);
this.numberField.addKeyListener(textKeyListener);

Loading…
Cancel
Save