use of org.whole.lang.actions.model.LanguageActionFactory in project whole by wholeplatform.
the class ActionsVisibleWhen method isVisible.
@Override
public boolean isVisible(IBindingManager bm) {
if (!HandlersBehavior.isValidEntityPartSelection(bm, false))
return false;
String languageURI = bm.wGet("self").wGetLanguageKit().getURI();
IResourceRegistry<Resource> registry = ActionsRegistry.instance();
for (IResource resource : registry.getResources(false)) {
LanguageActionFactory actionsModule = resource.getEntity();
URI targetLanguage = actionsModule.getTargetLanguage();
if (DataTypeUtils.getDataKind(targetLanguage).isString() && !languageURI.equals(targetLanguage.getValue()))
continue;
IEntityIterator<GuardedAction> iterator = IteratorFactory.<GuardedAction>childMatcherIterator().withPattern(ActionsEntityDescriptorEnum.GuardedAction);
iterator.reset(getActions(actionsModule));
if (iterator.hasNext())
return true;
}
return false;
}
Aggregations