当前位置: 首页>>代码示例>>Java>>正文


Java Localizable类代码示例

本文整理汇总了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%");
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:27,代码来源:QuestionDialog.java

示例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[]
}
 
开发者ID:holon-platform,项目名称:holon-core,代码行数:17,代码来源:ExampleI18n.java

示例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;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:13,代码来源:RequiredInputValidator.java

示例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;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:8,代码来源:DefaultPropertyInputForm.java

示例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();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:8,代码来源:AbstractDateFieldBuilder.java

示例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();
		}
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:13,代码来源:DefaultPropertyColumn.java

示例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());
}
 
开发者ID:holon-platform,项目名称:holon-core,代码行数:15,代码来源:TestProperty.java

示例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);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:11,代码来源:DefaultDialog.java

示例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();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:8,代码来源:DefaultPropertyInputGroup.java

示例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();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:8,代码来源:AbstractDateFieldBuilder.java

示例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;
}
 
开发者ID:holon-platform,项目名称:holon-core,代码行数:10,代码来源:AbstractProperty.java

示例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;
}
 
开发者ID:holon-platform,项目名称:holon-core,代码行数:9,代码来源:LocalizableMessage.java

示例13: setRequiredMessage

import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public void setRequiredMessage(Localizable message) {
	this.requiredMessage = message;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:5,代码来源:DefaultPropertyColumn.java

示例14: withDefaultBooleanLocalization

import com.holonplatform.core.i18n.Localizable; //导入依赖的package包/类
@Override
public Builder withDefaultBooleanLocalization(boolean value, Localizable message) {
	context.setDefaultBooleanLocalization(value, message);
	return this;
}
 
开发者ID:holon-platform,项目名称:holon-core,代码行数:6,代码来源:DefaultLocalizationContext.java

示例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();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:7,代码来源:AbstractGridItemListingBuilder.java


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