Browse Source

自定义校验接口

master
richie 9 years ago
parent
commit
7b0d7935a3
  1. 2
      designer/src/com/fr/design/report/VerifierListPane.java
  2. 19
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  3. 24
      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<VerifyDefineProvider> verifyDefineProviders;
public TableDataPaneProcessor getTableDataPaneProcessor() {
return tableDataPaneProcessor;
}
@ -804,6 +806,21 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
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);
} else if (tagName.equals(ExportAttrTabProvider.XML_TAG)) {
addExportAttrTabProvider(impl, simplify);
} else if (tagName.equals(VerifyDefineProvider.MARK_STRING)) {
addVerifyDefineProvider(impl, simplify);
}
} catch (PluginInvalidLevelException e) {
PluginMessage.remindUpdate(e.getMessage());

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

@ -0,0 +1,24 @@
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;
Class<? extends Verifier> classForVerifier();
Class<? extends BasicBeanPane> appearanceForVerifier();
String nameForVerifier();
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