Browse Source

无JIRA任务 整理开放接口以及文档

final/10.0
richie 6 years ago
parent
commit
adf47eb703
  1. 16
      designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java
  2. 16
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java
  3. 3
      designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java

16
designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java

@ -2,11 +2,12 @@ package com.fr.design.fun;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.javascript.JavaScriptActionPane;
import com.fr.design.mainframe.JTemplate;
import com.fr.js.JavaScript;
import com.fr.stable.fun.mark.Mutable;
/**
* Created by zack on 2015/8/14.
* 控件的事件扩展接口
*/
public interface JavaScriptActionProvider extends Mutable{
@ -14,10 +15,21 @@ public interface JavaScriptActionProvider extends Mutable{
int CURRENT_LEVEL = 1;
/**
* 事件的界面
*/
FurtherBasicBeanPane<? extends JavaScript> getJavaScriptActionPane();
/**
* 这个界面在哪些类型模板设计的时候会出现
* @see com.fr.design.mainframe.JWorkBook
* @see com.fr.design.mainframe.JForm
*/
boolean accept(JTemplate template);
@Deprecated
FurtherBasicBeanPane<? extends JavaScript> getJavaScriptActionPane(JavaScriptActionPane pane);
@Deprecated
boolean isSupportType();
}

16
designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java

@ -3,6 +3,8 @@ package com.fr.design.fun.impl;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.fun.JavaScriptActionProvider;
import com.fr.design.javascript.JavaScriptActionPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.js.JavaScript;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
@ -27,10 +29,16 @@ public abstract class AbstractJavaScriptActionProvider extends AbstractProvider
return getJavaScriptActionPane();
}
/**
* 判断是否是支持的类型cpt,frm默认是
* @return
*/
@Override
public boolean accept(JTemplate template) {
// 这里只是为了兼容原来的isSupportType方法
boolean result = isSupportType();
if (result) {
return true;
}
return true;
}
@Override
public boolean isSupportType(){
return true;

3
designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java

@ -7,6 +7,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.fun.JavaScriptActionProvider;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.write.submit.DBManipulationPane;
import com.fr.form.ui.WebContentUtils;
import com.fr.js.JavaScript;
@ -45,7 +46,7 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
Set<JavaScriptActionProvider> javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG);
if (javaScriptActionProviders != null) {
for (JavaScriptActionProvider jsp : javaScriptActionProviders) {
if(jsp.isSupportType()){
if(jsp.accept(DesignerContext.getDesignerFrame().getSelectedJTemplate())){
paneList.add(jsp.getJavaScriptActionPane(this));
}
}

Loading…
Cancel
Save