Browse Source

Merge pull request #136 in BA/design from ~RICHIE/design:dev to dev

* commit 'e9a3c2b1d362df67fce13ff56a32f8193c450705':
  自定义校验接口
  自定义校验接口
master
superman 9 years ago
parent
commit
cf5160a799
  1. 2
      designer/src/com/fr/design/report/VerifierListPane.java
  2. 19
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  3. 40
      designer_base/src/com/fr/design/fun/VerifyDefineProvider.java
  4. 20
      designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java

2
designer/src/com/fr/design/report/VerifierListPane.java

File diff suppressed because one or more lines are too long

19
designer_base/src/com/fr/design/ExtraDesignClassManager.java

@ -138,6 +138,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
private Set<BackgroundUIProvider> backgroundUIProviders; private Set<BackgroundUIProvider> backgroundUIProviders;
private Set<VerifyDefineProvider> verifyDefineProviders;
public TableDataPaneProcessor getTableDataPaneProcessor() { public TableDataPaneProcessor getTableDataPaneProcessor() {
return tableDataPaneProcessor; return tableDataPaneProcessor;
} }
@ -804,6 +806,21 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
backgroundUIProviders.add((BackgroundUIProvider) level); backgroundUIProviders.add((BackgroundUIProvider) level);
} }
public VerifyDefineProvider[] getVerifyDefineProviders() {
if (verifyDefineProviders == null) {
return new VerifyDefineProvider[0];
}
return verifyDefineProviders.toArray(new VerifyDefineProvider[verifyDefineProviders.size()]);
}
private void addVerifyDefineProvider(Level level, PluginSimplify simplify) throws Exception {
if (verifyDefineProviders == null) {
verifyDefineProviders = new HashSet<>();
}
validAPILevel(level, VerifyDefineProvider.CURRENT_LEVEL, simplify.getPluginName());
verifyDefineProviders.add((VerifyDefineProvider) level);
}
/** /**
* 文件名 * 文件名
* *
@ -902,6 +919,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
addWidgetAttrProvider(impl, simplify); addWidgetAttrProvider(impl, simplify);
} else if (tagName.equals(ExportAttrTabProvider.XML_TAG)) { } else if (tagName.equals(ExportAttrTabProvider.XML_TAG)) {
addExportAttrTabProvider(impl, simplify); addExportAttrTabProvider(impl, simplify);
} else if (tagName.equals(VerifyDefineProvider.MARK_STRING)) {
addVerifyDefineProvider(impl, simplify);
} }
} catch (PluginInvalidLevelException e) { } catch (PluginInvalidLevelException e) {
PluginMessage.remindUpdate(e.getMessage()); PluginMessage.remindUpdate(e.getMessage());

40
designer_base/src/com/fr/design/fun/VerifyDefineProvider.java

@ -0,0 +1,40 @@
package com.fr.design.fun;
import com.fr.data.Verifier;
import com.fr.design.beans.BasicBeanPane;
import com.fr.stable.fun.Level;
import com.fr.stable.fun.Provider;
/**
* Created by richie on 16/6/8.
*/
public interface VerifyDefineProvider extends Level, Provider {
String MARK_STRING = "VerifyDefineProvider";
int CURRENT_LEVEL = 1;
/**
* 对应的校验类
* @return 校验类
*/
Class<? extends Verifier> classForVerifier();
/**
* 校验设置的界面
* @return 界面
*/
Class<? extends BasicBeanPane> appearanceForVerifier();
/**
* 此种类型的校验的名字
* @return 名字
*/
String nameForVerifier();
/**
* 菜单图标
* @return 图标路径
*/
String iconPath();
}

20
designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java

@ -0,0 +1,20 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.VerifyDefineProvider;
import com.fr.stable.fun.impl.AbstractProvider;
/**
* Created by richie on 16/6/8.
*/
public abstract class AbstractVerifyDefineProvider extends AbstractProvider implements VerifyDefineProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}
Loading…
Cancel
Save