本文整理汇总了Java中org.jboss.errai.ioc.client.container.IOC类的典型用法代码示例。如果您正苦于以下问题:Java IOC类的具体用法?Java IOC怎么用?Java IOC使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOC类属于org.jboss.errai.ioc.client.container包,在下文中一共展示了IOC类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: registerPlugin
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public static void registerPlugin(final Object _obj) {
final JavaScriptObject obj = (JavaScriptObject) _obj;
if (JSNativePlugin.hasStringProperty(obj,
"id") && JSNativePlugin.hasTemplate(obj)) {
final SyncBeanManager beanManager = IOC.getBeanManager();
final ActivityBeansCache activityBeansCache = beanManager.lookupBean(ActivityBeansCache.class).getInstance();
final JSNativeScreen newNativePlugin = beanManager.lookupBean(JSNativeScreen.class).getInstance();
newNativePlugin.build(obj);
JSWorkbenchScreenActivity activity = JSExporterUtils.findActivityIfExists(beanManager,
newNativePlugin.getId(),
JSWorkbenchScreenActivity.class);
if (activity == null) {
registerNewActivity(beanManager,
activityBeansCache,
newNativePlugin);
} else {
updateExistentActivity(newNativePlugin,
activity);
}
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:PluginJSExporter.java
示例2: registerPerspective
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public static void registerPerspective(final Object _obj) {
final JavaScriptObject obj = (JavaScriptObject) _obj;
if (JSNativePlugin.hasStringProperty(obj,
"id")) {
final SyncBeanManager beanManager = IOC.getBeanManager();
final ActivityBeansCache activityBeansCache = beanManager.lookupBean(ActivityBeansCache.class).getInstance();
final JSNativePerspective newNativePerspective = beanManager.lookupBean(JSNativePerspective.class).getInstance();
newNativePerspective.build(obj);
final JSWorkbenchPerspectiveActivity activity = new JSWorkbenchPerspectiveActivity(newNativePerspective);
beanManager.registerBean(new SingletonBeanDef<PerspectiveActivity, JSWorkbenchPerspectiveActivity>(activity,
PerspectiveActivity.class,
new HashSet<Annotation>(Arrays.asList(DEFAULT_QUALIFIERS)),
newNativePerspective.getId(),
true,
JSWorkbenchPerspectiveActivity.class));
activityBeansCache.addNewPerspectiveActivity(beanManager.lookupBeans(newNativePerspective.getId()).iterator().next());
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:PerspectiveJSExporter.java
示例3: registerResourceTypeDefinition
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public static void registerResourceTypeDefinition(final Object _obj) {
final JavaScriptObject obj = (JavaScriptObject) _obj;
if (JSNativePlugin.hasStringProperty(obj,
"id")) {
final SyncBeanManager beanManager = IOC.getBeanManager();
final JSNativeClientResourceType newNativeClientResourceType = beanManager.lookupBean(JSNativeClientResourceType.class).getInstance();
newNativeClientResourceType.build(obj);
JSClientResourceType jsClientResourceType = new JSClientResourceType(newNativeClientResourceType);
beanManager.registerBean(new SingletonBeanDef<ClientResourceType, JSClientResourceType>(jsClientResourceType,
ClientResourceType.class,
new HashSet<Annotation>(Arrays.asList(DEFAULT_QUALIFIERS)),
jsClientResourceType.getId(),
true,
JSClientResourceType.class));
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:ResourceTypeDefinitionJSExporter.java
示例4: getItemDescription
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public static String getItemDescription(final String key) {
Collection<SyncBeanDef<SocialBundleService>> socialBundleServices = IOC.getBeanManager().lookupBeans(SocialBundleService.class);
String value = null;
for (SyncBeanDef<SocialBundleService> serviceBean : socialBundleServices) {
SocialBundleService service = serviceBean.getInstance();
try {
value = getTranslationFromService(key,
value,
service);
} catch (DuplicatedTranslationException e) {
GWT.log(e.getMessage());
break;
}
IOC.getBeanManager().destroyBean(serviceBean);
}
return value != null ? value : key;
}
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:SocialBundleHelper.java
示例5: gwtSetUp
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
@Override
protected void gwtSetUp() throws Exception {
MarshallerFramework.initializeDefaultSessionProvider();
// because UberFire uses @Inject User, the only way we can set the current user is by putting this
// cookie in place before the GWT modules get bootstrapped (so before super.gwtSetUp())
Collection<? extends Role> roles = Arrays.asList(new RoleImpl("admin"));
admin = new UserImpl("admin",
roles);
Cookies.setCookie(UserCookieEncoder.USER_COOKIE_NAME,
UserCookieEncoder.toCookieValue(admin));
super.gwtSetUp();
placeManager = IOC.getBeanManager().lookupBean(PlaceManager.class).getInstance();
securityContext = IOC.getBeanManager().lookupBean(SecurityContext.class).getInstance();
}
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:MenuAuthorizationTest.java
示例6: testScreenActivityOnlyCreatedOneTimeOnPerspectiveLoad
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public void testScreenActivityOnlyCreatedOneTimeOnPerspectiveLoad() throws Exception {
final PlaceManager placeManager = IOC.getBeanManager().lookupBean(PlaceManager.class).getInstance();
DefaultScreenActivity.instanceCount = 0;
pollWhile(DEFAULT_SCREEN_NOT_LOADED)
.thenDo(new Runnable() {
@Override
public void run() {
assertEquals(1,
DefaultScreenActivity.instanceCount);
placeManager.goTo(new DefaultPlaceRequest(MultiPanelPerspective.class.getName()));
}
})
.thenPollWhile(NESTING_SCREEN_NOT_LOADED)
.thenDo(new Runnable() {
@Override
public void run() {
assertEquals(1,
NestingScreen.instanceCount);
}
});
}
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:ScreenLifecycleTest.java
示例7: getDefaultPerspectiveActivity
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
private PerspectiveActivity getDefaultPerspectiveActivity() {
PerspectiveActivity first = null;
SyncBeanManagerImpl beanManager = (SyncBeanManagerImpl) IOC.getBeanManager();
Collection<SyncBeanDef<PerspectiveActivity>> perspectives = beanManager.lookupBeans(PerspectiveActivity.class);
Iterator<SyncBeanDef<PerspectiveActivity>> perspectivesIterator = perspectives.iterator();
while (perspectivesIterator.hasNext() ) {
SyncBeanDef<PerspectiveActivity> perspective = perspectivesIterator.next();
PerspectiveActivity instance = perspective.getInstance();
if (instance.isDefault()) {
return instance;
}
if (first == null) {
first = instance;
}
}
return first;
}
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:DashboardPerspectiveActivity.java
示例8: init
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
@PostConstruct
public void init() {
dependencyPagedJarTable = IOC.getBeanManager().lookupBean( DependencyListWidget.class ).getInstance();
dependencyPagedJarTable.addOnSelect( new ParameterizedCommand<String>() {
@Override
public void execute( String parameter ) {
presenter.onPathSelection( parameter );
lockRequired.fire( new LockRequiredEvent() );
}
} );
setTitle( "Artifacts" );
setBody( dependencyPagedJarTable );
setSize( ModalSize.LARGE );
//Need to refresh the grid to load content after the popup is shown
addShownHandler( new ModalShownHandler() {
@Override
public void onShown( final ModalShownEvent shownEvent ) {
dependencyPagedJarTable.search();
}
} );
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:27,代码来源:DependencySelectorPopupViewImpl.java
示例9: getBuildExtensions
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
protected Pair<Collection<BuildOptionExtension>, Collection<BuildOptionExtension>> getBuildExtensions() {
AsyncBeanManager beanManager = IOC.getAsyncBeanManager();
Collection<AsyncBeanDef<BuildOptionExtension>> beans = beanManager.lookupBeans(BuildOptionExtension.class);
final Collection<BuildOptionExtension> dependentScoped = new ArrayList<>(beans.size());
final Collection<BuildOptionExtension> instances = new ArrayList<>(beans.size());
for (final AsyncBeanDef<BuildOptionExtension> bean : beans) {
/*
* We are assuming that extensions are not marked with @LoadAsync.
* Thus getInstance will immediately invoke the callback.
*/
bean.getInstance(new CreationalCallback<BuildOptionExtension>() {
@Override
public void callback(BuildOptionExtension extension) {
instances.add(extension);
if (bean.getScope().equals(Dependent.class)) {
dependentScoped.add(extension);
}
}
});
}
return new Pair<>(instances,
dependentScoped);
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:27,代码来源:ProjectScreenPresenter.java
示例10: initialize
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
@PostConstruct
public void initialize() {
SyncBeanManager beanManager = IOC.getBeanManager();
Collection<SyncBeanDef<FormElementProcessor>> processors = beanManager.lookupBeans(FormElementProcessor.class);
processors.forEach(processorDef -> {
registerProcessor(processorDef.getInstance());
});
Collection<SyncBeanDef<FormGenerationResourcesProvider>> builderDefs = beanManager.lookupBeans(FormGenerationResourcesProvider.class);
builderDefs.forEach(builderDef -> {
FormGenerationResourcesProvider instance = builderDef.getInstance();
registerResources(instance);
beanManager.destroyBean(instance);
});
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:19,代码来源:ClientFormGenerator.java
示例11: getHelper
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public static BindingHelper getHelper(FormRenderingContext context,
MultipleSubFormFieldDefinition field) {
Class<? extends BindingHelper> helperClazz = null;
if (context instanceof MapModelRenderingContext) {
helperClazz = DynamicBindingHelper.class;
} else {
helperClazz = StaticBindingHelper.class;
}
BindingHelper helper = IOC.getBeanManager().lookupBean(helperClazz).newInstance();
helper.setUp(field,
context);
return helper;
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:19,代码来源:BindingHelpers.java
示例12: generateBbox
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public void generateBbox() {
queryBbox = true;
GeoMap geoMap = IOC.getBeanManager().lookupBean(GeoMap.class)
.getInstance();
if (GeoMap.INTERNAL_EPSG.equals(getEpsg())) {
this.bbox = geoMap.getMap().getExtent();
} else {
this.bbox = geoMap.getMap().getExtent()
.transform(new Projection(GeoMap.INTERNAL_EPSG),
new Projection(getEpsg()));
}
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:13,代码来源:WfsVectorLayerDef.java
示例13: addVector
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public void addVector(final Layer layer) {
layer.setName(getName(layer.getName()));
final DivideTool divideTool = IOC.getBeanManager()
.lookupBean(DivideTool.class).getInstance();
((Vector) layer).addVectorFeatureAddedListener(divideTool
.getFeatureAddedListener((Vector) layer));
layerTrees.get(LayerManagerWidget.VECTOR_TAB).add(layer);
updateStatusBar();
for (final AddLayerListener listener : addLayerListeners) {
listener.onAddLayer(layerTrees.get(VECTOR_TAB).getLayers());
}
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:14,代码来源:LayerManagerWidget.java
示例14: lookupBeanInstance
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
protected <T> T lookupBeanInstance(Class<T> type) {
T instance = null;
SyncBeanDef<T> bean = IOC.getBeanManager().lookupBean(type);
if (bean != null) {
instance = bean.getInstance();
assertNotNull(instance);
}
return instance;
}
开发者ID:baldram,项目名称:tristar-eye,代码行数:10,代码来源:AbstractTristarCDITest.java
示例15: dispose
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
@Override
public void dispose() {
onRenameCommand.clear();
onDeleteCommand.clear();
onUpdateCommand.clear();
onCopyCommand.clear();
onConcurrentRenameCommand.clear();
onConcurrentDeleteCommand.clear();
onConcurrentUpdateCommand.clear();
onConcurrentCopyCommand.clear();
if (IOC.getBeanManager() != null) {
IOC.getBeanManager().destroyBean(this);
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:ObservablePathImpl.java
示例16: registerEditor
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public static void registerEditor(final Object _obj) {
final JavaScriptObject obj = (JavaScriptObject) _obj;
if (JSNativeEditor.hasStringProperty(obj,
"id")) {
final SyncBeanManager beanManager = IOC.getBeanManager();
final ActivityBeansCache activityBeansCache = beanManager.lookupBean(ActivityBeansCache.class).getInstance();
final JSNativeEditor newNativeEditor = beanManager.lookupBean(JSNativeEditor.class).getInstance();
newNativeEditor.build(obj);
PlaceManager placeManager = beanManager.lookupBean(PlaceManager.class).getInstance();
JSEditorActivity activity = JSExporterUtils.findActivityIfExists(beanManager,
newNativeEditor.getId(),
JSEditorActivity.class);
if (activity == null) {
registerNewActivity(beanManager,
activityBeansCache,
newNativeEditor,
placeManager);
} else {
updateExistentActivity(newNativeEditor,
activity);
}
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:28,代码来源:EditorJSExporter.java
示例17: registerSplashScreen
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
public static void registerSplashScreen(final Object _obj) {
final JavaScriptObject obj = (JavaScriptObject) _obj;
if (JSNativeSplashScreen.hasStringProperty(obj,
"id") && JSNativeSplashScreen.hasTemplate(obj)) {
final SyncBeanManager beanManager = IOC.getBeanManager();
final ActivityBeansCache activityBeansCache = beanManager.lookupBean(ActivityBeansCache.class).getInstance();
final JSNativeSplashScreen newNativePlugin = beanManager.lookupBean(JSNativeSplashScreen.class).getInstance();
newNativePlugin.build(obj);
final SplashView splashView = beanManager.lookupBean(SplashView.class).getInstance();
JSSplashScreenActivity activity = JSExporterUtils.findActivityIfExists(beanManager,
newNativePlugin.getId(),
JSSplashScreenActivity.class);
if (activity == null) {
registerNewActivity(beanManager,
activityBeansCache,
newNativePlugin,
splashView);
} else {
updateExistentActivity(newNativePlugin,
activity);
}
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:29,代码来源:SplashScreenJSExporter.java
示例18: export
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
@PostConstruct
public void export() {
Collection<SyncBeanDef<UberfireJSExporter>> jsAPIs = IOC.getBeanManager().lookupBeans(UberfireJSExporter.class);
for (SyncBeanDef<UberfireJSExporter> bean : jsAPIs) {
UberfireJSExporter jsAPI = bean.getInstance();
jsAPI.export();
}
if (!jsAPIs.isEmpty()) {
jsapiReadyEvent.fire(new UberfireJSAPIReadyEvent());
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:12,代码来源:UberfireJSAPIExporter.java
示例19: getWidget
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
private static Widget getWidget(final PropertyEditorFieldInfo property,
final Class fieldType) {
SyncBeanManager beanManager = IOC.getBeanManager();
SyncBeanDef<?> iocBeanDef = beanManager.lookupBean(fieldType);
AbstractField field = (AbstractField) iocBeanDef.getInstance();
return field.widget(property);
}
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:PropertyEditorHelper.java
示例20: lookupBean
import org.jboss.errai.ioc.client.container.IOC; //导入依赖的package包/类
private LayoutDragComponent lookupBean(String dragTypeClassName) {
SyncBeanManagerImpl beanManager = (SyncBeanManagerImpl) IOC.getBeanManager();
Collection<SyncBeanDef<LayoutDragComponent>> iocBeanDefs = beanManager.lookupBeans(LayoutDragComponent.class);
for (SyncBeanDef<LayoutDragComponent> iocBeanDef : iocBeanDefs) {
LayoutDragComponent instance = iocBeanDef.getInstance();
instances.add(instance);
if (getRealBeanClass(instance).equalsIgnoreCase(dragTypeClassName)) {
return instance;
}
}
return null;
}
开发者ID:kiegroup,项目名称:appformer,代码行数:13,代码来源:LayoutDragComponentHelper.java
注:本文中的org.jboss.errai.ioc.client.container.IOC类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论