Browse Source

Merge pull request #642 in DESIGN/design from ~RICHIE/design:release/10.0 to release/10.0

* commit '17ba31d17e096b2555db78e816f2394fadac19e7':
  无JIRA任务 整理开放接口以及文档
final/10.0
richie 6 years ago
parent
commit
1dc901a99f
  1. 31
      designer-base/src/main/java/com/fr/design/fun/HyperlinkProvider.java
  2. 24
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractHyperlinkProvider.java

31
designer-base/src/main/java/com/fr/design/fun/HyperlinkProvider.java

@ -1,21 +1,44 @@
package com.fr.design.fun;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.stable.fun.Level;
import com.fr.js.Hyperlink;
import com.fr.stable.fun.mark.Mutable;
/**
* Created by zack on 2016/1/20.
*/
public interface HyperlinkProvider extends Mutable {
public interface HyperlinkProvider<T extends Hyperlink> extends Mutable {
String XML_TAG = "HyperlinkProvider";
int CURRENT_LEVEL = 2;
/**
* 创建一个超级连接类型
* @return NameableCreator
* 超级链接的描述信息如果是实现类中重载了这个方法就不需要再实现下面的三个方法
* @see HyperlinkProvider#text()
* @see HyperlinkProvider#target()
* @see HyperlinkProvider#appearance()
* 如果并不重载就需要分别实现上面的三个方法不推荐重载这个方法
* @return 描述信息
*/
NameableCreator createHyperlinkCreator();
/**
* 超级链接的名字
* @return 名字
*/
String text();
/**
* 超级链接的实现类
* @return 实现类
*/
Class<T> target();
/**
* 超级链接的界面配置类
* @return 配置类
*/
Class<? extends BasicBeanPane<T>> appearance();
}

24
designer-base/src/main/java/com/fr/design/fun/impl/AbstractHyperlinkProvider.java

@ -1,6 +1,10 @@
package com.fr.design.fun.impl;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.stable.StringUtils;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
@ -18,4 +22,24 @@ public abstract class AbstractHyperlinkProvider extends AbstractProvider impleme
public String mark4Provider() {
return getClass().getName();
}
@Override
public NameableCreator createHyperlinkCreator() {
return new NameObjectCreator(text(), target(), appearance());
}
@Override
public String text() {
return StringUtils.EMPTY;
}
@Override
public Class target() {
return null;
}
@Override
public Class<? extends BasicBeanPane> appearance() {
return null;
}
}
Loading…
Cancel
Save