• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TranslatableString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.isis.applib.services.i18n.TranslatableString的典型用法代码示例。如果您正苦于以下问题:Java TranslatableString类的具体用法?Java TranslatableString怎么用?Java TranslatableString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TranslatableString类属于org.apache.isis.applib.services.i18n包,在下文中一共展示了TranslatableString类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: delete

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
@Action(
        domainEvent = DeletedDomainEvent.class,
        invokeOn = InvokeOn.OBJECT_AND_COLLECTION
)
public Object delete() {

    // obtain title first, because cannot reference object after deleted
    final String title = titleService.titleOf(this);

    final List<ToDoItem> returnList = actionInvocationContext.getInvokedOn().isCollection() ? toDoItems.notYetComplete() : null;

    // there's actually a bug in this method; shouldn't be returning the current object in the list if just deleted.
    // however, ISIS-1269 transparently handles this and won't attempt to render a deleted object.
    repositoryService.remove(this);

    messageService.informUser(
            TranslatableString.tr("Deleted {title}", "title", title), this.getClass(), "delete");

    return returnList;
}
 
开发者ID:isisaddons,项目名称:isis-app-todoapp,代码行数:21,代码来源:ToDoItem.java


示例2: validateNewTextTemplate

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
public TranslatableString validateNewTextTemplate(
        final DocumentType proposedType,
        final LocalDate proposedDate,
        final String name,
        final String mimeType,
        final String fileSuffix,
        final ApplicationTenancy proposedApplicationTenancy,
        final String templateText,
        final RenderingStrategy contentRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy,
        final boolean previewOnly) {

    final DocumentSort documentSort = DocumentSort.TEXT;

    return validateNewTemplate(proposedType, proposedDate, proposedApplicationTenancy, contentRenderingStrategy,
            documentSort);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:19,代码来源:DocumentTemplateMenu.java


示例3: validateNewClobTemplate

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
public TranslatableString validateNewClobTemplate(
        final DocumentType proposedType,
        final LocalDate proposedDate,
        final String name,
        final String fileSuffix,
        final ApplicationTenancy proposedApplicationTenancy,
        final Clob clob,
        final RenderingStrategy contentRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy,
        final boolean previewOnly) {

    final DocumentSort documentSort = DocumentSort.CLOB;

    return validateNewTemplate(
            proposedType, proposedDate, proposedApplicationTenancy, contentRenderingStrategy,
            documentSort);

}
 
开发者ID:estatio,项目名称:estatio,代码行数:20,代码来源:DocumentTemplateMenu.java


示例4: validateNewBlobTemplate

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
public TranslatableString validateNewBlobTemplate(
        final DocumentType proposedType,
        final LocalDate proposedDate,
        final String name,
        final String fileSuffix,
        final ApplicationTenancy proposedApplicationTenancy,
        final Blob blob,
        final RenderingStrategy contentRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy,
        final boolean previewOnly) {

    final DocumentSort documentSort = DocumentSort.BLOB;

    return validateNewTemplate(
            proposedType, proposedDate, proposedApplicationTenancy, contentRenderingStrategy, documentSort);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:18,代码来源:DocumentTemplateMenu.java


示例5: validateNewTemplate

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
private TranslatableString validateNewTemplate(
        final DocumentType proposedType,
        final LocalDate proposedDate,
        final ApplicationTenancy proposedApplicationTenancy,
        final RenderingStrategy proposedRenderingStrategy,
        final DocumentSort documentSort) {
    TranslatableString translatableString = documentTemplateRepository.validateApplicationTenancyAndDate(
            proposedType, proposedApplicationTenancy.getPath(), proposedDate, null);
    if(translatableString != null) {
        return translatableString;
    }

    translatableString = documentTemplateRepository.validateSortAndRenderingStrategyInputNature(documentSort,
            proposedRenderingStrategy);
    if(translatableString != null) {
        return translatableString;
    }

    return null;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:21,代码来源:DocumentTemplateMenu.java


示例6: disableIfIncomingAndCategorisedFor

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
@Programmatic
@com.google.common.eventbus.Subscribe
@org.axonframework.eventhandling.annotation.EventHandler
public void disableIfIncomingAndCategorisedFor(final Document_delete.ActionDomainEvent ev) {
    final Document document = (Document) ev.getMixedIn();
    switch (ev.getEventPhase()) {
    case DISABLE:
        if(DocumentTypeData.hasIncomingType(document) && !DocumentTypeData.INCOMING.isDocTypeFor(document)) {
            ev.veto(TranslatableString.tr(
                    "Document has already been categorised (as {documentType})",
                    "documentType", document.getType().getName()));
        }
        break;
    case EXECUTING:
        repository.deleteFor(document);
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:18,代码来源:IncomingDocumentPresentationSubscriber.java


示例7: validateRemoveCascade

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
@Programmatic
public TranslatableString validateRemoveCascade(final Category category) {
    List<Classification> classifications = classificationRepository.findByCategory(category);
    if (!classifications.isEmpty()) {
        return TranslatableString.tr("Child '{child}' is classified by '{object}' and cannot be removed",
                "child", category.getFullyQualifiedName(), "object", classifications.get(0).getClassified().toString());
    } else {
        SortedSet<Category> children = category.getChildren();
        for (final Category child : children) {
            TranslatableString childValidation = validateRemoveCascade(child);
            if (childValidation != null) {
                return childValidation;
            }
        }

        return null;
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:19,代码来源:CategoryRepository.java


示例8: determineCharset

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
private Charset determineCharset(final String contentType) {

            final String charsetName = parseCharset(contentType);
            if(charsetName == null) {
                return null;
            }

            try {
                return Charset.forName(charsetName);
            } catch (Exception e) {
                messageService.warnUser(TranslatableString.tr(
                        "Could not download from URL (charset '{charsetName}' not recognized)",
                        "charsetName", charsetName),
                        UrlDownloadService.class, "determineCharset");
                return null;
            }
        }
 
开发者ID:estatio,项目名称:estatio,代码行数:18,代码来源:UrlDownloadService.java


示例9: parseCharset

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
private String parseCharset(final String contentType) {
    final Iterable<String> values = Splitter.on(";").split(contentType);

    for (String value : values) {
        value = value.trim();

        if (value.toLowerCase().startsWith("charset=")) {
            return value.substring("charset=".length());
        }
    }

    messageService.warnUser(TranslatableString.tr(
            "Could not download from URL (charset not recognized within content-type header '{contentType}')",
            "contentType", contentType),
            UrlDownloadService.class, "parseCharset");
    return null;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:18,代码来源:UrlDownloadService.java


示例10: validateApplicationTenancyAndDate

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
@Programmatic
public TranslatableString validateApplicationTenancyAndDate(
        final DocumentType proposedType,
        final String proposedAtPath,
        final LocalDate proposedDate,
        final DocumentTemplate ignore) {

    final List<DocumentTemplate> existingTemplates =
            findByTypeAndAtPath(proposedType, proposedAtPath);
    for (DocumentTemplate existingTemplate : existingTemplates) {
        if(existingTemplate == ignore) {
            continue;
        }
        if(java.util.Objects.equals(existingTemplate.getDate(), proposedDate)) {
            return TranslatableString.tr("A template already exists for this date");
        }
        if (proposedDate == null && existingTemplate.getDate() != null) {
            return TranslatableString.tr(
                    "Must provide a date (there are existing templates that already have a date specified)");
        }
    }
    return null;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:24,代码来源:DocumentTemplateRepository.java


示例11: if_no_background_service

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
@Test
public void if_no_background_service() throws Exception {

    // given
    assumeThat(backgroundCommandService, is(nullValue()));

    // when
    final TranslatableString reason = _createAndAttachDocumentAndScheduleRender(demoObject).disable$$();

    // then
    assertThat(reason).isNotNull();

    // expect
    expectedExceptions.expect(DisabledException.class);

    // when
    final DocumentTemplate anyTemplate = templateFs.getFmkTemplate();
    wrap(_createAndAttachDocumentAndScheduleRender(demoObject)).$$(anyTemplate);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:20,代码来源:T_createAndAttachDocumentAndScheduleRender_IntegTest.java


示例12: onExecutedThrowExceptionIfSet

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
private void onExecutedThrowExceptionIfSet() {
    if(getSubscriberBehaviour() == DemoBehaviour.ANY_EXECUTE_VETO_WITH_RECOVERABLE_EXCEPTION) {
        throw new RecoverableException(
                TranslatableString.tr("Rejecting event (recoverable exception thrown)"),
                this.getClass(), "on(ActionDomainEvent)");
    }
    if(getSubscriberBehaviour() == DemoBehaviour.ANY_EXECUTE_VETO_WITH_NON_RECOVERABLE_EXCEPTION) {
        throw new NonRecoverableException(
                TranslatableString.tr("Rejecting event (non-recoverable exception thrown)"),
                this.getClass(), "on(ActionDomainEvent)");
    }
    if(getSubscriberBehaviour() == DemoBehaviour.ANY_EXECUTE_VETO_WITH_OTHER_EXCEPTION) {
        throw new RuntimeException("Throwing some other exception");
    }
}
 
开发者ID:isisaddons,项目名称:isis-app-todoapp,代码行数:16,代码来源:DemoDomainEventSubscriptions.java


示例13: notYetComplete

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(
    cssClassFa = "fa fa-thumbs-down",
    bookmarking = BookmarkPolicy.AS_ROOT
)
@MemberOrder(sequence = "10")
public List<ToDoItem> notYetComplete() {
    final List<ToDoItem> items = notYetCompleteNoUi();
    if(items.isEmpty()) {
        container.informUser(
                TranslatableString.tr("All to-do items have been completed :-)"), this.getClass(), "notYetComplete");
    }
    return items;
}
 
开发者ID:isisaddons,项目名称:isis-app-todoapp,代码行数:15,代码来源:ToDoItems.java


示例14: complete

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
@ActionLayout(
    cssClassFa = "fa fa-thumbs-up"
)
@Action(semantics = SemanticsOf.SAFE)
@MemberOrder(sequence = "20")
public List<ToDoItem> complete() {
    final List<ToDoItem> items = completeNoUi();
    if(items.isEmpty()) {
        container.informUser(TranslatableString.tr("No to-do items have yet been completed :-("), this.getClass(), "complete");
    }
    return items;
}
 
开发者ID:isisaddons,项目名称:isis-app-todoapp,代码行数:13,代码来源:ToDoItems.java


示例15: satisfiesTranslatableSafely

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
@Override
public TranslatableString satisfiesTranslatableSafely(final String obj) {
    return TranslatableString.tr(
            obj != null && obj.contains(" ")
                    ? "Proposed value '{proposed}' cannot contain spaces!"
                    : null,
            "proposed", obj);
}
 
开发者ID:isisaddons,项目名称:isis-app-kitchensink,代码行数:9,代码来源:CannotContainSpacesTr.java


示例16:

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
public TranslatableString validate$$(
        final String name,
        final ApplicationTenancy proposedApplicationTenancy,
        final LocalDate proposedDate,
        final String templateText,
        final RenderingStrategy customRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy,
        final boolean previewOnly) {

    return documentTemplateRepository.validateApplicationTenancyAndDate(
            documentTemplate.getType(), proposedApplicationTenancy.getPath(), proposedDate, null);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:14,代码来源:DocumentTemplate_cloneWhenText.java


示例17: on

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
@Programmatic
@com.google.common.eventbus.Subscribe
@org.axonframework.eventhandling.annotation.EventHandler
public void on(final Document_delete.ActionDomainEvent ev) {
    final Document document = (Document) ev.getMixedIn();
    switch (ev.getEventPhase()) {
    case DISABLE:
        final List<Paperclip> attachments = paperclipRepository.findByDocument(document);
        for (Paperclip attachment : attachments) {
            if(attachment.getAttachedTo() instanceof Communication) {
                ev.veto(TranslatableString.tr("Document has already been sent as a communication"));
            }
        }
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:16,代码来源:VetoDocumentDeleteIfSent.java


示例18: titleOf

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
private TranslatableString titleOf(final CommChannelRole role) {
    return TranslatableString.tr(
            "{type} {description}",
            "type", role.getType().name(),
            "description", role.getDescription()
    );
}
 
开发者ID:estatio,项目名称:estatio,代码行数:8,代码来源:CommChannelRole.java


示例19: validateName

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
public TranslatableString validateName(final String name) {
    if (name == null)
        return null;
    final Category existingCategoryIfAny = categoryRepository.findByParentAndName(getParent(), name);
    return existingCategoryIfAny != null
            ? TranslatableString.tr("A category with name '{name}' already exists (under this parent)", "name", name)
            : null;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:9,代码来源:Category.java


示例20: validateReference

import org.apache.isis.applib.services.i18n.TranslatableString; //导入依赖的package包/类
public TranslatableString validateReference(final String reference) {
    if (reference == null)
        return null;
    final Category existingCategoryIfAny = categoryRepository.findByParentAndReference(getParent(), reference);
    return existingCategoryIfAny != null
            ? TranslatableString.tr("A category with reference '{reference}' already exists (under this parent)", "reference", reference)
            : null;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:9,代码来源:Category.java



注:本文中的org.apache.isis.applib.services.i18n.TranslatableString类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Traverser类代码示例发布时间:2022-05-22
下一篇:
Java StorageMetrics类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap