本文整理汇总了Java中org.uberfire.client.workbench.type.ClientResourceType类的典型用法代码示例。如果您正苦于以下问题:Java ClientResourceType类的具体用法?Java ClientResourceType怎么用?Java ClientResourceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientResourceType类属于org.uberfire.client.workbench.type包,在下文中一共展示了ClientResourceType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: registerResourceTypeDefinition
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的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
示例2: createIcon
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
private void createIcon(final SocialItemExpandedWidgetModel model) {
UpdateItem updateItem = model.getUpdateItems().get(0);
if (updateItem.getEvent().isVFSLink()) {
MessageBuilder.createCall(new RemoteCallback<Path>() {
public void callback(Path path) {
for (ClientResourceType type : model.getModel().getResourceTypes()) {
if (type.accept(path)) {
addIconImage((Image) type.getIcon());
break;
}
}
}
},
VFSService.class).get(updateItem.getEvent().getLinkTarget());
} else {
//TODO, provide icons per event type.
addIconImage(GENERIC_FILE_IMAGE);
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:SocialItemExpandedWidget.java
示例3: getPluginsTypeLabels
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
public Map<ClientResourceType, String> getPluginsTypeLabels() {
final Map<ClientResourceType, String> labelsByResourceType = new HashMap<ClientResourceType, String>();
labelsByResourceType.put(perspectiveLayoutPluginResourceType,
CommonConstants.INSTANCE.PerspectivePlugin());
labelsByResourceType.put(screenPluginResourceType,
CommonConstants.INSTANCE.ScreenPlugin());
labelsByResourceType.put(editorPluginResourceType,
CommonConstants.INSTANCE.EditorPlugin());
labelsByResourceType.put(splashPluginResourceType,
CommonConstants.INSTANCE.SplashScreenPlugin());
labelsByResourceType.put(dynamicMenuResourceType,
CommonConstants.INSTANCE.DynamicMenu());
return labelsByResourceType;
}
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:PluginsInfo.java
示例4: getClassifiedPluginsTest
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@Test
public void getClassifiedPluginsTest() {
final Map<ClientResourceType, Set<Activity>> classifiedPlugins = pluginsInfo.getClassifiedPlugins(getPlugins());
assertEquals(5,
classifiedPlugins.keySet().size());
assertEquals(1,
classifiedPlugins.get(editorPluginResourceType).size());
assertEquals(2,
classifiedPlugins.get(perspectiveLayoutPluginResourceType).size());
assertEquals(3,
classifiedPlugins.get(screenPluginResourceType).size());
assertEquals(4,
classifiedPlugins.get(splashPluginResourceType).size());
assertEquals(5,
classifiedPlugins.get(dynamicMenuResourceType).size());
}
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:PluginsInfoTest.java
示例5: activityAndMetaInfoShouldLookupResourceTypesOnRuntime
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@Test
public void activityAndMetaInfoShouldLookupResourceTypesOnRuntime() {
ClientResourceType clientResourceType = mock(ClientResourceType.class);
SyncBeanDef<ClientResourceType> syncBeanDef = mock(SyncBeanDef.class);
when(syncBeanDef.getInstance()).thenReturn(clientResourceType);
Collection<SyncBeanDef> resourceTypeBeans = Arrays.asList(syncBeanDef);
when(iocManager.lookupBeans("resource1")).thenReturn(resourceTypeBeans);
ActivityBeansCache.ActivityAndMetaInfo activatedActivityAndMetaInfo =
cache.new ActivityAndMetaInfo(mock(SyncBeanDef.class),
0,
Arrays.asList("resource1"));
assertNull(activatedActivityAndMetaInfo.resourceTypes);
assertTrue(!activatedActivityAndMetaInfo.resourceTypesNames.isEmpty());
activatedActivityAndMetaInfo.getResourceTypes();
assertTrue(activatedActivityAndMetaInfo.resourceTypes.length > 0);
}
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:ActivityBeansCacheTest.java
示例6: init
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@PostConstruct
public void init() {
final Collection<SyncBeanDef<ClientResourceType>> availableTypes = iocManager.lookupBeans(ClientResourceType.class);
for (final SyncBeanDef<ClientResourceType> availableType : availableTypes) {
localResourceTypes.add(availableType.getInstance());
}
sort(localResourceTypes,
new Comparator<ClientResourceType>() {
@Override
public int compare(final ClientResourceType o1,
final ClientResourceType o2) {
if (o1.getPriority() < o2.getPriority()) {
return 1;
} else if (o1.getPriority() > o2.getPriority()) {
return -1;
} else {
return 0;
}
}
});
}
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:ClientTypeRegistryImpl.java
示例7: create
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@Override
public void create( final Package pkg,
final String baseFileName,
final NewResourcePresenter presenter ) {
final RuleModel ruleModel = new RuleModel();
final boolean useDSL = useDSLCheckbox.getValue();
final ClientResourceType resourceType = ( useDSL ? resourceTypeDSLR : resourceTypeDRL );
ruleModel.name = baseFileName;
busyIndicatorView.showBusyIndicator( CommonConstants.INSTANCE.Saving() );
service.call( getSuccessCallback( presenter ),
new HasBusyIndicatorDefaultErrorCallback( busyIndicatorView ) ).create( pkg.getPackageMainResourcesPath(),
buildFileName( baseFileName,
resourceType ),
ruleModel,
"" );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:18,代码来源:NewGuidedRuleHandler.java
示例8: updateMainTimeline
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
private void updateMainTimeline( String param,
final SocialUser socialUser ) {
if ( param.contains( Constants.INSTANCE.AllRepositories() ) ) {
param = "";
}
SocialTimelineWidget socialTimelineWidget = GWT.create( SocialTimelineWidget.class );
List<ClientResourceType> resourceTypes = iconLocator.getResourceTypes();
SocialTimelineWidgetModel model = new SocialTimelineWidgetModel( socialUser, placeManager, resourceTypes )
.withUserClickCommand( generateUserClickCommand() )
.withFollowUnfollowCommand( generateFollowUnfollowCommand() )
.withLinkCommand( generateLinkCommand() );
Map<String, String> globals = new HashMap();
globals.put( "filter", param );
model.droolsQuery( globals, "filterTimelineRecentAssets", "10" );
socialTimelineWidget.init( model );
main.setSocialWidget( socialTimelineWidget );
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:18,代码来源:SocialHomePageMainPresenter.java
示例9: compare
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@Override
public int compare(final ClientResourceType o1,
final ClientResourceType o2) {
final String o1description = o1.getDescription();
final String o2description = o2.getDescription();
if (o1description == null && o2description == null) {
return 0;
}
if (o1description == null && o2description != null) {
return 1;
}
if (o1description != null && o2description == null) {
return -1;
}
return o1description.compareTo(o2description);
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:17,代码来源:Sorters.java
示例10: makeTriggerWidget
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
private TriggerWidget makeTriggerWidget(final ClientResourceType resourceType,
final PanelCollapse collapse) {
final String description = getResourceTypeDescription(resourceType);
if (resourceType.getIcon() != null) {
return new TriggerWidget(resourceType.getIcon(),
description,
!collapse.isIn()) {{
setDataToggle(Toggle.COLLAPSE);
setDataParent(itemsContainer.getId());
setDataTargetWidget(collapse);
}};
}
return new TriggerWidget(description,
!collapse.isIn()) {{
setDataToggle(Toggle.COLLAPSE);
setDataParent(itemsContainer.getId());
setDataTargetWidget(collapse);
}};
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:20,代码来源:BusinessViewWidget.java
示例11: init
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
protected void init(final ObservablePath path,
final PlaceRequest place,
final ClientResourceType type,
final MenuItems... menuItems) {
init(path,
place,
type,
true,
false,
menuItems);
}
开发者ID:kiegroup,项目名称:appformer,代码行数:12,代码来源:BaseEditor.java
示例12: createIcon
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
private void createIcon(final SimpleItemWidgetModel model) {
if (model.isVFSLink()) {
for (ClientResourceType type : model.getResourceTypes()) {
if (type.accept(model.getLinkPath())) {
addIconImage((Image) type.getIcon());
break;
}
}
} else {
final Image maybeAlreadyAttachedImage = GENERIC_FILE_IMAGE;
addIconImage(maybeAlreadyAttachedImage);
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:14,代码来源:SimpleItemWidget.java
示例13: SocialTimelineWidgetModel
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
public SocialTimelineWidgetModel(SocialUser socialUser,
PlaceManager placeManager,
List<ClientResourceType> resourceTypes) {
this.socialUser = socialUser;
this.placeManager = placeManager;
this.resourceTypes = resourceTypes;
}
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:SocialTimelineWidgetModel.java
示例14: getActivity
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
/**
* Returns the activated activity with the highest priority that can handle the given file. Returns null if no
* activated activity can handle the path.
* @param path the file to find a path-based activity for (probably a {@link WorkbenchEditorActivity}, but this cache
* makes no guarantees).
*/
public SyncBeanDef<Activity> getActivity(final Path path) {
for (final ActivityAndMetaInfo currentActivity : getResourceActivities()) {
for (final ClientResourceType resourceType : currentActivity.getResourceTypes()) {
if (resourceType.accept(path)) {
return currentActivity.getActivityBean();
}
}
}
throw new EditorResourceTypeNotFound();
}
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:ActivityBeansCache.java
示例15: dynamicLookupResourceTypes
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
private void dynamicLookupResourceTypes() {
this.resourceTypes = new ClientResourceType[resourceTypesNames.size()];
for (int i = 0; i < resourceTypesNames.size(); i++) {
final String resourceTypeIdentifier = resourceTypesNames.get(i);
final Collection<SyncBeanDef> resourceTypeBeans = iocManager.lookupBeans(resourceTypeIdentifier);
if (resourceTypeBeans.isEmpty()) {
throw new RuntimeException("ClientResourceType " + resourceTypeIdentifier + " not found");
}
this.resourceTypes[i] = (ClientResourceType) resourceTypeBeans.iterator().next().getInstance();
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:13,代码来源:ActivityBeansCache.java
示例16: generateActivityMetaInfo
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void generateActivityMetaInfo() {
IOCBeanDef<?> beanDefinition = mock(IOCBeanDef.class);
Priority priority = mock(Priority.class);
Integer priorityValue = 1;
when(priority.value()).thenReturn(priorityValue);
Set<Annotation> qualifiers = new HashSet<Annotation>();
AssociatedResources associatedResources = mock(AssociatedResources.class);
final List<Class<? extends ClientResourceType>> typesList = new ArrayList<Class<? extends ClientResourceType>>();
typesList.add(ClientResourceType.class);
Class<? extends ClientResourceType>[] array = typesList.toArray(new Class[typesList.size()]);
when(associatedResources.value()).thenReturn(array);
qualifiers.add(associatedResources);
qualifiers.add(priority);
when(beanDefinition.getQualifiers()).thenReturn(qualifiers);
Pair<Integer, List<String>> generated = ActivityMetaInfo.generate(beanDefinition);
assertEquals(priorityValue,
generated.getK1());
assertTrue(generated.getK2().contains(ClientResourceType.class.getName()));
}
开发者ID:kiegroup,项目名称:appformer,代码行数:29,代码来源:ActivityMetaInfoTest.java
示例17: generateActivityMetaInfoForDynamicActivity
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@Test
public void generateActivityMetaInfoForDynamicActivity() {
final String otherResourceType = "org.uberfire.OtherResourceType";
IOCBeanDef<?> beanDefinition = mock(IOCBeanDef.class);
DynamicAnnotation priority = mock(DynamicAnnotation.class);
when(priority.getName()).thenReturn(Priority.class.getName());
when(priority.getMember("value")).thenReturn("1");
Set<Annotation> qualifiers = new HashSet<Annotation>();
DynamicAnnotation associatedResources = mock(DynamicAnnotation.class);
when(associatedResources.getName()).thenReturn(AssociatedResources.class.getName());
when(associatedResources.getMember("value")).thenReturn("[" + ClientResourceType.class.getName() + "," + otherResourceType + "]");
qualifiers.add(associatedResources);
qualifiers.add(priority);
when(beanDefinition.isDynamic()).thenReturn(true);
when(beanDefinition.getQualifiers()).thenReturn(qualifiers);
Pair<Integer, List<String>> generated = ActivityMetaInfo.generate(beanDefinition);
assertEquals(Integer.valueOf(1),
generated.getK1());
assertTrue(generated.getK2().contains(ClientResourceType.class.getName()));
assertTrue(generated.getK2().contains("org.uberfire.OtherResourceType"));
}
开发者ID:kiegroup,项目名称:appformer,代码行数:28,代码来源:ActivityMetaInfoTest.java
示例18: resolve
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@Override
public ClientResourceType resolve(final Path path) {
for (final ClientResourceType resourceType : localResourceTypes) {
if (resourceType.accept(path)) {
return resourceType;
}
}
return null;
}
开发者ID:kiegroup,项目名称:appformer,代码行数:10,代码来源:ClientTypeRegistryImpl.java
示例19: resolveWildcardPattern
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@Override
public String resolveWildcardPattern(final String shortName) {
for (final ClientResourceType resourceType : localResourceTypes) {
if (resourceType.getShortName().equalsIgnoreCase(shortName)) {
return resourceType.getSimpleWildcardPattern();
}
}
return shortName;
}
开发者ID:kiegroup,项目名称:appformer,代码行数:10,代码来源:ClientTypeRegistryImpl.java
示例20: setupUploadWidget
import org.uberfire.client.workbench.type.ClientResourceType; //导入依赖的package包/类
@Override
public void setupUploadWidget(final ClientResourceType resourceTypeDefinition) {
uploadWidget = constructUploadWidget(resourceTypeDefinition);
uploadWidgetContainer.clear();
uploadWidgetContainer.setWidget(uploadWidget);
uploadWidget.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
BusyPopup.showMessage(DecisionTableXLSEditorConstants.INSTANCE.Uploading());
presenter.onUpload();
}
});
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:16,代码来源:DecisionTableXLSEditorViewImpl.java
注:本文中的org.uberfire.client.workbench.type.ClientResourceType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论