richie
5 years ago
commit
a5ec6777cb
14 changed files with 204 additions and 0 deletions
@ -0,0 +1,5 @@
|
||||
*.iml |
||||
.idea/ |
||||
lib/report/*.jar |
||||
.classpath |
||||
.DS_Store |
Binary file not shown.
@ -0,0 +1,35 @@
|
||||
package com.fr.plugin.parameter.slider; |
||||
|
||||
import com.fanruan.api.i18n.I18nKit; |
||||
import com.fr.design.fun.impl.AbstractParameterWidgetOptionProvider; |
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.plugin.parameter.slider.design.XSlider; |
||||
import com.fr.plugin.parameter.slider.fun.Slider; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/29 |
||||
*/ |
||||
public class SliderBridge extends AbstractParameterWidgetOptionProvider { |
||||
|
||||
@Override |
||||
public Class<? extends Widget> classForWidget() { |
||||
return Slider.class; |
||||
} |
||||
|
||||
@Override |
||||
public Class<?> appearanceForWidget() { |
||||
return XSlider.class; |
||||
} |
||||
|
||||
@Override |
||||
public String iconPathForWidget() { |
||||
return "/com/fr/plugin/parameter/slider/images/slider.png"; |
||||
} |
||||
|
||||
@Override |
||||
public String nameForWidget() { |
||||
return I18nKit.getLocText("Plugin-Slider_Name"); |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.plugin.parameter.slider; |
||||
|
||||
import com.fr.stable.fun.impl.AbstractJavaScriptFileHandler; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/29 |
||||
*/ |
||||
public class SliderJavaScriptBridge extends AbstractJavaScriptFileHandler { |
||||
@Override |
||||
public String[] pathsForFiles() { |
||||
return new String[] { |
||||
"/com/fr/plugin/parameter/slider/web/slider.js" |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,18 @@
|
||||
package com.fr.plugin.parameter.slider; |
||||
|
||||
import com.fr.stable.fun.impl.AbstractJavaScriptPlaceHolder; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/29 |
||||
*/ |
||||
public class SliderJavaScriptHolderBridge extends AbstractJavaScriptPlaceHolder { |
||||
|
||||
@Override |
||||
public ScriptTag[] holderScripts() { |
||||
return new ScriptTag[]{ |
||||
ScriptTag.build().type("text/javascript").src("http://fanruan.design/fineui/2.0/fineui.min.js") |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,15 @@
|
||||
package com.fr.plugin.parameter.slider; |
||||
|
||||
import com.fr.stable.fun.impl.AbstractLocaleFinder; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/29 |
||||
*/ |
||||
public class SliderLocaleBridge extends AbstractLocaleFinder { |
||||
@Override |
||||
public String find() { |
||||
return "com/fr/plugin/parameter/slider/slider"; |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.plugin.parameter.slider; |
||||
|
||||
import com.fr.stable.fun.impl.AbstractStylePlaceHolder; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/29 |
||||
*/ |
||||
public class SliderStyleHolderBridge extends AbstractStylePlaceHolder { |
||||
@Override |
||||
public LinkTag[] holderLinks() { |
||||
return new LinkTag[] { |
||||
LinkTag.build().type("text/css").rel("stylesheet").href("http://fanruan.design/fineui/2.0/fineui.min.css") |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.fr.plugin.parameter.slider.design; |
||||
|
||||
import com.fanruan.api.design.work.form.creator.Attribute; |
||||
import com.fanruan.api.design.work.form.creator.XOpenCreator; |
||||
import com.fr.design.gui.islider.UISlider; |
||||
import com.fr.plugin.parameter.slider.fun.Slider; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/29 |
||||
*/ |
||||
public class XSlider extends XOpenCreator { |
||||
|
||||
public XSlider(Slider slider, Dimension size) { |
||||
super(slider, size); |
||||
} |
||||
|
||||
@Override |
||||
public Attribute[] attributes() { |
||||
return new Attribute[0]; |
||||
} |
||||
|
||||
@Override |
||||
protected JComponent initEditor() { |
||||
return new UISlider(); |
||||
} |
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.fr.plugin.parameter.slider.fun; |
||||
|
||||
import com.fanruan.api.report.form.BaseWidget; |
||||
import com.fr.intelli.record.Focus; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.record.analyzer.EnableMetrics; |
||||
import com.fr.stable.script.CalculatorProvider; |
||||
import com.fr.stable.web.Repository; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/29 |
||||
*/ |
||||
@EnableMetrics |
||||
public class Slider extends BaseWidget { |
||||
|
||||
@Override |
||||
@Focus(id = "com.fr.plugin.parameter.slider", text = "Plugin-Slider_Name") |
||||
public void mixinJSON(Repository repository, CalculatorProvider calculatorProvider, JSONObject jsonObject) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public String getXType() { |
||||
return "parameter.slider"; |
||||
} |
||||
|
||||
@Override |
||||
public String[] supportedEvents() { |
||||
return new String[0]; |
||||
} |
||||
} |
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1 @@
|
||||
Plugin-Slider_Name=Slider |
@ -0,0 +1 @@
|
||||
Plugin-Slider_Name=\u6570\u503C\u6ED1\u5757 |
@ -0,0 +1,31 @@
|
||||
(function ($) { |
||||
|
||||
FR.ParameterSlider = FR.extend(FR.Widget, { |
||||
_defaultConfig: function () { |
||||
return $.extend(FR.ParameterSlider.superclass._defaultConfig.apply(), { |
||||
showWidth: 500, |
||||
showHeight: 280, |
||||
defaultWidth: 80 |
||||
}); |
||||
}, |
||||
_init: function () { |
||||
FR.ParameterSlider.superclass._init.apply(this, arguments); |
||||
}, |
||||
|
||||
getValue: function () { |
||||
return this.options.value; |
||||
}, |
||||
|
||||
setValue: function (value) { |
||||
this.options.value = value; |
||||
}, |
||||
|
||||
setText: function (text) { |
||||
this.editComp.val(text); |
||||
}, |
||||
getText: function () { |
||||
return this.editComp.val(); |
||||
} |
||||
}); |
||||
$.shortcut('parameter.slider', FR.ParameterSlider); |
||||
})(jQuery); |
Loading…
Reference in new issue