java.lang.Object
cc.wanforme.ofx.ViewHolder
- 所有已实现的接口:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@Component
public class ViewHolder
extends Object
implements org.springframework.context.ApplicationContextAware
all fxml file associate classes
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static ViewHolderget()<T extends BaseView>
TgetBaseView(Class<T> clazz) get by Class
根据具体的子类获取<T extends BaseView>
TgetBaseView(Class<T> clazz, String name) get by Class and name when clazz is parent class
当 clazz 是父类的时候,配合 name 获取<T extends BaseView>
TgetBaseView(String name, Class<T> clazz) get by name
直接从 spring 容器中获取getBaseViewByFxml(String fxml, boolean refreshCache) get the first associate-class
获取 fxml 绑定的第一个 class 实例(不定)getBaseViewByFxml(String fxml, String name, boolean refreshCache) 已过时。<T> Torg.springframework.context.ApplicationContextvoidrefresh all BaseViews' (fxml bean) cache
刷新缓存voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
构造器详细资料
-
ViewHolder
public ViewHolder()
-
-
方法详细资料
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - 指定者:
setApplicationContext在接口中org.springframework.context.ApplicationContextAware- 抛出:
org.springframework.beans.BeansException
-
getContext
public org.springframework.context.ApplicationContext getContext() -
getBaseView
get by Class
根据具体的子类获取- 参数:
clazz-- 返回:
-
getBean
-
getBaseView
get by name
直接从 spring 容器中获取- 参数:
clazz-- 返回:
-
getBaseView
get by Class and name when clazz is parent class
当 clazz 是父类的时候,配合 name 获取- 参数:
clazz-- 返回:
-
refreshBaseViewCache
public void refreshBaseViewCache()refresh all BaseViews' (fxml bean) cache
刷新缓存 -
getBaseViewByFxml
get the first associate-class
获取 fxml 绑定的第一个 class 实例(不定)BaseView view = ViewHolder.getBaseViewByFxml("/fxml/hello.fxml", false);- 参数:
fxml-refreshCache- refresh all BaseViews' cache- 返回:
-
getBaseViewByFxml
已过时。usegetBaseView(String, Class)insteadget the associate-class by fxml and bean name
根据 fxml 和 spring 容器中名字获取BaseView view = ViewHolder.getBaseViewByFxml("/fxml/hello.fxml", "Hello", false);- 参数:
fxml-name- bean namerefreshCache- refresh all BaseViews' cache- 返回:
-
get
-
getBaseView(String, Class)instead