diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..70e7e4c
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/finekit-10.0.jar b/lib/finekit-10.0.jar
index 6b626db..0916a8e 100644
Binary files a/lib/finekit-10.0.jar and b/lib/finekit-10.0.jar differ
diff --git a/plugin.xml b/plugin.xml
new file mode 100644
index 0000000..300bb7f
--- /dev/null
+++ b/plugin.xml
@@ -0,0 +1,27 @@
+
+
+ com.fr.plugin.parameter.slider
+ com.fr.plugin.parameter.slider
+
+ yes
+ 1.0
+ 10.0~
+ 2018-10-20
+ author
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..213f2cc
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,27 @@
+
+
+ 4.0.0
+
+
+ com.fr.plugin
+ starter
+ 10.0
+
+ jar
+ demo-parameter-widget-slider
+
+
+ com.fanruan.api
+ finekit
+ 10.0
+ system
+ ${project.basedir}/lib/finekit-10.0.jar
+
+
+
+
+ ${project.basedir}/../webroot/WEB-INF/plugins/plugin-com.fr.plugin.parameter.slider-1.0/classes
+
+
\ No newline at end of file
diff --git a/src/main/java/com/fr/plugin/parameter/slider/design/XSlider.java b/src/main/java/com/fr/plugin/parameter/slider/design/XSlider.java
index c332c35..b4d3bd3 100644
--- a/src/main/java/com/fr/plugin/parameter/slider/design/XSlider.java
+++ b/src/main/java/com/fr/plugin/parameter/slider/design/XSlider.java
@@ -26,6 +26,13 @@ public class XSlider extends XOpenCreator {
@Override
protected JComponent initEditor() {
- return new UISlider();
+ if (editor == null) {
+ JSlider slider = new JSlider();
+ slider.setMinimum(0);
+ slider.setMaximum(100);
+ slider.setValue(50);
+ editor = slider;
+ }
+ return editor;
}
}
diff --git a/src/main/java/com/fr/plugin/parameter/slider/fun/Slider.java b/src/main/java/com/fr/plugin/parameter/slider/fun/Slider.java
index a478017..6c05e12 100644
--- a/src/main/java/com/fr/plugin/parameter/slider/fun/Slider.java
+++ b/src/main/java/com/fr/plugin/parameter/slider/fun/Slider.java
@@ -1,9 +1,12 @@
package com.fr.plugin.parameter.slider.fun;
-import com.fanruan.api.report.form.BaseWidget;
+import com.fanruan.api.report.form.category.ValueWidget;
+import com.fanruan.api.report.form.value.InitializerKit;
+import com.fr.form.ui.concept.data.ValueInitializer;
import com.fr.intelli.record.Focus;
import com.fr.json.JSONObject;
import com.fr.record.analyzer.EnableMetrics;
+import com.fr.stable.StringUtils;
import com.fr.stable.script.CalculatorProvider;
import com.fr.stable.web.Repository;
@@ -13,12 +16,12 @@ import com.fr.stable.web.Repository;
* Created by richie on 2019/9/29
*/
@EnableMetrics
-public class Slider extends BaseWidget {
+public class Slider extends ValueWidget {
@Override
@Focus(id = "com.fr.plugin.parameter.slider", text = "Plugin-Slider_Name")
public void mixinJSON(Repository repository, CalculatorProvider calculatorProvider, JSONObject jsonObject) {
-
+ System.out.println(jsonObject);
}
@Override
@@ -30,4 +33,20 @@ public class Slider extends BaseWidget {
public String[] supportedEvents() {
return new String[0];
}
+
+ @Override
+ public int[] getValueType() {
+ return new int[]{TYPE_STRING, TYPE_DATABINDING, TYPE_FORMULA};
+ }
+
+ @Override
+ public void createValueResult(CalculatorProvider calculator, JSONObject widgetResult) {
+ ValueInitializer initializer = getWidgetValue();
+ if (initializer == null) {
+ initializer = InitializerKit.newValue();
+ setWidgetValue(initializer);
+ }
+ Object result = initializer.executeResult(calculator);
+ widgetResult.put(widgetName.toUpperCase(), result == null ? StringUtils.EMPTY : result);
+ }
}
diff --git a/src/main/resources/com/fr/plugin/parameter/slider/web/slider.js b/src/main/resources/com/fr/plugin/parameter/slider/web/slider.js
index b39862c..bc2a335 100644
--- a/src/main/resources/com/fr/plugin/parameter/slider/web/slider.js
+++ b/src/main/resources/com/fr/plugin/parameter/slider/web/slider.js
@@ -10,14 +10,38 @@
},
_init: function () {
FR.ParameterSlider.superclass._init.apply(this, arguments);
+ var opts = this.options;
+ var normalSingleSlider = BI.createWidget({
+ type: "bi.single_slider",
+ width: opts.width,
+ height: opts.height,
+ cls: "layout-bg-white"
+ });
+ normalSingleSlider.setMinAndMax({
+ min: 0,
+ max: 100
+ });
+ normalSingleSlider.setValue(10);
+ normalSingleSlider.populate();
+ this.loader = normalSingleSlider;
+ BI.createWidget({
+ type: "bi.vertical",
+ element: this.element,
+ items: [{
+ type: "bi.center_adapt",
+ items: [{
+ el: normalSingleSlider
+ }]
+ }]
+ });
},
getValue: function () {
- return this.options.value;
+ return this.loader.getValue();
},
setValue: function (value) {
- this.options.value = value;
+ this.loader.setValue(value);
},
setText: function (text) {