本文整理汇总了Java中org.bubblecloud.ilves.component.field.TimestampField类的典型用法代码示例。如果您正苦于以下问题:Java TimestampField类的具体用法?Java TimestampField怎么用?Java TimestampField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TimestampField类属于org.bubblecloud.ilves.component.field包,在下文中一共展示了TimestampField类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.bubblecloud.ilves.component.field.TimestampField; //导入依赖的package包/类
@Override
public void initialize() {
// Get entity manager from site context and prepare container.
final EntityManager entityManager = getSite().getSiteContext().getObject(EntityManager.class);
entityContainer = new EntityContainer<AuditLogEntry>(entityManager, true, false, false, AuditLogEntry.class, 1000,
new String[] { "created" }, new boolean[] { false }, "auditLogEntryId");
// Get descriptors and set container properties.
final List<FilterDescriptor> filterDescriptors = new ArrayList<FilterDescriptor>();
filterDescriptors.add(new FilterDescriptor("startTime", "created", getSite().localize("filter-start-time"),
new TimestampField(),
200, ">=", Date.class, new DateTime().withTimeAtStartOfDay().toDate()));
filterDescriptors.add(new FilterDescriptor("endTime", "created", getSite().localize("filter-end-time"),
new TimestampField(),
200, "<=", Date.class, new DateTime().withTimeAtStartOfDay().plusDays(1).toDate()));
final List<FieldDescriptor> fieldDescriptors = FieldSetDescriptorRegister.getFieldSetDescriptor(
AuditLogEntry.class).getFieldDescriptors();
ContainerUtil.addContainerProperties(entityContainer, fieldDescriptors);
// Initialize layout
final GridLayout gridLayout = new GridLayout(1, 2);
gridLayout.setSizeFull();
gridLayout.setMargin(false);
gridLayout.setSpacing(true);
gridLayout.setRowExpandRatio(1, 1f);
setViewContent(gridLayout);
final HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setSpacing(true);
buttonLayout.setSizeUndefined();
gridLayout.addComponent(buttonLayout, 0, 0);
final Table table = new FormattingTable();
table.setPageLength(13);
// Initialize grid
entityGrid = new Grid(table, entityContainer);
entityGrid.setFields(fieldDescriptors);
entityGrid.setFilters(filterDescriptors);
gridLayout.addComponent(entityGrid, 0, 1);
final Button viewButton = getSite().getButton("view");
buttonLayout.addComponent(viewButton);
viewButton.addClickListener(new ClickListener() {
/** Serial version UID. */
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(final ClickEvent event) {
if (entityGrid.getSelectedItemId() == null) {
return;
}
final AuditLogEntry entity = entityContainer.getEntity(entityGrid.getSelectedItemId());
final AuditLogEntryFlowlet contentView = getFlow().forward(AuditLogEntryFlowlet.class);
contentView.edit(entity, false);
}
});
}
示例2: initialize
import org.bubblecloud.ilves.component.field.TimestampField; //导入依赖的package包/类
/**
* Initialize field descriptors if not done yet.
*/
public static synchronized void initialize() {
if (initialized) {
return;
}
initialized = true;
HootFields.add(Entry.class, new FieldDescriptor(
"entryId", "Entry ID",
TextField.class, null,
100, null, String.class, null,
true, false, false));
HootFields.add(Entry.class, new FieldDescriptor(
"path", "Path",
TextField.class, null,
250, null, String.class, "",
true, true, true));
HootFields.add(Entry.class, new FieldDescriptor(
"basename", "Basename",
TextField.class, null,
100, null, String.class, "",
true, true, true));
HootFields.add(Entry.class, new FieldDescriptor(
"language", "Language",
TextField.class, null,
75, null, String.class, "",
true, true, false));
HootFields.add(Entry.class, new FieldDescriptor(
"country", "Country",
TextField.class, null,
75, null, String.class, "",
true, true, false));
HootFields.add(Entry.class, new FieldDescriptor(
"key", "Key",
TextField.class, null,
-1, null, String.class, "",
true, true, true));
HootFields.add(Entry.class, new FieldDescriptor(
"value", "Value",
TextArea.class, null,
300, null, String.class, "",
false, true, true));
HootFields.add(Entry.class, new FieldDescriptor(
"author", "Author",
TextField.class, null,
100, null, String.class, "",
true, true, false));
HootFields.add(Entry.class, new FieldDescriptor(
"created", "Created",
TimestampField.class, new TimestampConverter(),
150, null, Date.class, null, true,
true, true));
HootFields.add(Entry.class, new FieldDescriptor(
"modified", "Modified",
TimestampField.class, new TimestampConverter(),
150, null, Date.class, null,
true, true, true));
HootFields.add(Entry.class, new FieldDescriptor(
"deleted", "Deleted",
TimestampField.class, new TimestampConverter(),
150, null, Date.class, null,
true, true, true));
}
示例3: initialize
import org.bubblecloud.ilves.component.field.TimestampField; //导入依赖的package包/类
/**
* Initialize field descriptors if not done yet.
*/
public static synchronized void initialize() {
if (initialized) {
return;
}
initialized = true;
TranslationFields.add(Entry.class, new FieldDescriptor(
"entryId", "Entry ID",
TextField.class, null,
100, null, String.class, null,
true, false, false));
TranslationFields.add(Entry.class, new FieldDescriptor(
"path", "Path",
TextField.class, null,
250, null, String.class, "",
true, true, true));
TranslationFields.add(Entry.class, new FieldDescriptor(
"basename", "Basename",
TextField.class, null,
100, null, String.class, "",
true, true, true));
TranslationFields.add(Entry.class, new FieldDescriptor(
"language", "Language",
TextField.class, null,
75, null, String.class, "",
true, true, false));
TranslationFields.add(Entry.class, new FieldDescriptor(
"country", "Country",
TextField.class, null,
75, null, String.class, "",
true, true, false));
TranslationFields.add(Entry.class, new FieldDescriptor(
"key", "Key",
TextField.class, null,
-1, null, String.class, "",
true, true, true));
TranslationFields.add(Entry.class, new FieldDescriptor(
"value", "Value",
TextArea.class, null,
300, null, String.class, "",
false, true, true));
TranslationFields.add(Entry.class, new FieldDescriptor(
"author", "Author",
TextField.class, null,
100, null, String.class, "",
true, true, false));
TranslationFields.add(Entry.class, new FieldDescriptor(
"created", "Created",
TimestampField.class, new TimestampConverter(),
150, null, Date.class, null, true,
true, true));
TranslationFields.add(Entry.class, new FieldDescriptor(
"modified", "Modified",
TimestampField.class, new TimestampConverter(),
150, null, Date.class, null,
true, true, true));
TranslationFields.add(Entry.class, new FieldDescriptor(
"deleted", "Deleted",
TimestampField.class, new TimestampConverter(),
150, null, Date.class, null,
true, true, false));
}