本文整理汇总了Java中com.holonplatform.core.i18n.Localizable类的典型用法代码示例。如果您正苦于以下问题:Java Localizable类的具体用法?Java Localizable怎么用?Java Localizable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Localizable类属于com.holonplatform.core.i18n包,在下文中一共展示了Localizable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildActions
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
protected void buildActions(HorizontalLayout actionsContainer) {
actionsContainer.setSpacing(true);
// yes
final Button btnYes = Components.button().styleName(ValoTheme.BUTTON_PRIMARY)
.caption(Localizable.builder().message(DEFAULT_YES_BUTTON_MESSAGE)
.messageCode(DEFAULT_YES_BUTTON_MESSAGE_CODE).build())
.onClick(e -> onDialogYesButtonClick(e.getButton())).build();
getYesButtonConfigurator().ifPresent(c -> c.configureDialogButton(Components.configure(btnYes)));
actionsContainer.addComponent(btnYes);
actionsContainer.setComponentAlignment(btnYes, Alignment.MIDDLE_LEFT);
if (getWidth() > -1) {
btnYes.setWidth("100%");
}
// no
final Button btnNo = Components.button()
.caption(Localizable.builder().message(DEFAULT_NO_BUTTON_MESSAGE)
.messageCode(DEFAULT_NO_BUTTON_MESSAGE_CODE).build())
.onClick(e -> onDialogNoButtonClick(e.getButton())).build();
getNoButtonConfigurator().ifPresent(c -> c.configureDialogButton(Components.configure(btnNo)));
actionsContainer.addComponent(btnNo);
actionsContainer.setComponentAlignment(btnNo, Alignment.MIDDLE_RIGHT);
if (getWidth() > -1) {
btnNo.setWidth("100%");
}
}
示例2: contextbuild
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
public void contextbuild() {
// tag::ctxbuild[]
LocalizationContext localizationContext = LocalizationContext.builder()
.messageProvider(MessageProvider.fromProperties("messages").build()) // <1>
.messageProvider(MessageProvider.fromProperties("messages2").build()) // <2>
.messageArgumentsPlaceholder("$") // <3>
.withDefaultDateTemporalFormat(TemporalFormat.MEDIUM) // <4>
.withDefaultTimeTemporalFormat(TemporalFormat.FULL) // <5>
.withDefaultBooleanLocalization(Boolean.TRUE, Localizable.builder().messageCode("boolean.true").build()) // <6>
.withDefaultBooleanLocalization(Boolean.FALSE,
Localizable.builder().messageCode("boolean.false").build()) // <7>
.withInitialSystemLocale() // <8>
.withInitialLocale(Locale.US) // <9>
.build();
// end::ctxbuild[]
}
示例3: RequiredInputValidator
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
/**
* Constructor
* @param valueHolder the {@link ValueHolder} to which the validation refers (not null)
* @param message Optional validation failed message. If <code>null</code>, the {@link #DEFAULT_REQUIRED_ERROR}
* message will be used.
*/
public RequiredInputValidator(ValueHolder<T> valueHolder, Localizable message) {
super();
ObjectUtils.argumentNotNull(valueHolder, "ValueHolder must be not null");
this.valueHolder = valueHolder;
this.message = (message != null) ? message : DEFAULT_REQUIRED_ERROR;
}
示例4: propertyCaption
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public PropertyInputFormBuilder<C> propertyCaption(Property<?> property, Localizable caption) {
ObjectUtils.argumentNotNull(property, "Property must be not null");
ObjectUtils.argumentNotNull(caption, "Caption must be not null");
getInstance().setPropertyCaption(property, caption);
return this;
}
示例5: dateOutOfRangeMessage
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public DateInputBuilder dateOutOfRangeMessage(String defaultDateOutOfRangeMessage, String messageCode,
Object... arguments) {
this.outOfRangeMessage = Localizable.builder().message(defaultDateOutOfRangeMessage).messageCode(messageCode)
.messageArguments(arguments).build();
return builder();
}
示例6: DefaultPropertyColumn
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
public DefaultPropertyColumn(P property) {
super();
if (property != null) {
if (Localizable.class.isAssignableFrom(property.getClass())) {
this.caption = (Localizable) property;
}
if ((this.caption == null || this.caption.getMessage() == null)
&& Path.class.isAssignableFrom(property.getClass())) {
this.caption = Localizable.builder().message(((Path<?>) property).getName()).build();
}
}
}
示例7: testPropertyMessages
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Test
public void testPropertyMessages() {
PathProperty<String> qp = PathProperty.create("test", String.class);
assertEquals(String.class, qp.getType());
assertEquals("test", qp.getName());
qp = PathProperty.create("test", String.class).message("Test caption").messageCode("test.message");
assertEquals(String.class, qp.getType());
assertEquals("test", qp.getName());
assertThat(qp, instanceOf(Localizable.class));
assertEquals("Test caption", ((Localizable) qp).getMessage());
assertEquals("test.message", ((Localizable) qp).getMessageCode());
}
示例8: buildActions
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
protected void buildActions(HorizontalLayout actionsContainer) {
Button btn = Components.button().styleName(ValoTheme.BUTTON_PRIMARY)
.fullWidth().caption(Localizable.builder().message(DEFAULT_BUTTON_MESSAGE)
.messageCode(DEFAULT_BUTTON_MESSAGE_CODE).build())
.onClick(e -> onDialogButtonClick(e.getButton())).build();
// configurator
getOkButtonConfigurator().ifPresent(c -> c.configureDialogButton(Components.configure(btn)));
actionsContainer.addComponent(btn);
}
示例9: required
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public <T> B required(Property<T> property, Localizable message) {
ObjectUtils.argumentNotNull(property, "Property must be not null");
instance.getPropertyConfiguration(property).setRequired(true);
instance.getPropertyConfiguration(property).setRequiredMessage(message);
return builder();
}
示例10: parseErrorMessage
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public DateInputBuilder parseErrorMessage(String defaultParseErrorMessage, String messageCode,
Object... arguments) {
this.parseErrorMessage = Localizable.builder().message(defaultParseErrorMessage).messageCode(messageCode)
.messageArguments(arguments).build();
return builder();
}
示例11: message
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public P message(Localizable localizable) {
ObjectUtils.argumentNotNull(localizable, "Localizable must be not null");
this.message = localizable.getMessage();
this.messageCode = localizable.getMessageCode();
this.messageArguments = localizable.getMessageArguments();
return (P) this;
}
示例12: message
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public LocalizableBuilder message(Localizable localizable) {
ObjectUtils.argumentNotNull(localizable, "Localizable must be not null");
instance.setMessage(localizable.getMessage());
instance.setMessageCode(localizable.getMessageCode());
instance.setMessageArguments(localizable.getMessageArguments());
return this;
}
示例13: setRequiredMessage
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public void setRequiredMessage(Localizable message) {
this.requiredMessage = message;
}
示例14: withDefaultBooleanLocalization
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public Builder withDefaultBooleanLocalization(boolean value, Localizable message) {
context.setDefaultBooleanLocalization(value, message);
return this;
}
示例15: editorSaveCaption
import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public B editorSaveCaption(Localizable caption) {
ObjectUtils.argumentNotNull(caption, "Caption must be not null");
this.editorSaveCaption = caption;
return builder();
}