本文整理汇总了Java中com.smartgwt.client.widgets.viewer.DetailViewer类的典型用法代码示例。如果您正苦于以下问题:Java DetailViewer类的具体用法?Java DetailViewer怎么用?Java DetailViewer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DetailViewer类属于com.smartgwt.client.widgets.viewer包,在下文中一共展示了DetailViewer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMetadataViews
import com.smartgwt.client.widgets.viewer.DetailViewer; //导入依赖的package包/类
private void createMetadataViews() {
basicMetadataDetailViewer = new DetailViewer();
basicMetadataDetailViewer.setWidth100();
basicMetadataDetailViewer.setFields(
new DetailViewerField(GeneralItemModel.NAME_FIELD, "Title"),
new DetailViewerField(GeneralItemModel.SORTKEY_FIELD, "Order") ,
new DetailViewerField(GeneralItemModel.AUTO_LAUNCH, "Automatic Launch"),
new DetailViewerField(GeneralItemModel.RICH_TEXT_FIELD, "Description"),
new DetailViewerField("dependsOn", "Depends On")
);
extendedMetadataDetailViewer = new DetailViewer();
extendedMetadataDetailViewer.setWidth100();
extendedMetadataDetailViewer.setEmptyMessage("Select an item to view its details");
}
示例2: getCellHoverComponent
import com.smartgwt.client.widgets.viewer.DetailViewer; //导入依赖的package包/类
@Override
protected Canvas getCellHoverComponent(Record record, Integer rowNum, Integer colNum) {
DetailViewer detailViewer = new DetailViewer();
detailViewer.setWidth(400);
// Define the fields that we want to display in the details popup. These
// fields are populated from the selected record.
DetailViewerField dateField = new DetailViewerField(NewsColumns.DATE.colName(),
NewsColumns.DATE.normName());
DetailViewerField newsField = new DetailViewerField(NewsColumns.INFO.colName(), "News");
detailViewer.setFields(dateField, newsField);
detailViewer.setData(new Record[] { record });
return detailViewer;
}
示例3: build
import com.smartgwt.client.widgets.viewer.DetailViewer; //导入依赖的package包/类
/**
* @return the Widget to display, ready to be added in a container
*/
public Layout build() {
this.label = new Label(this.emptyMessage);
this.label.setWidth100();
this.label.setAlign(Alignment.CENTER);
this.details = new DetailViewer();
this.details.setWidth100();
this.details.setHeight100();
this.details.setCanSelectText(true);
this.details.hide();
GridColumns[] lines = this.factory.getColumns();
DetailViewerField[] fields = new DetailViewerField[lines.length];
for (int i = 0; i < lines.length; i++) {
fields[i] = new DetailViewerField(lines[i].getName(), lines[i].getTitle());
if (lines[i] == TasksColumnsFactory.EXEC_DURATION_ATTR || lines[i] == JobsColumnsFactory.DURATION_ATTR) {
fields[i].setDetailFormatter(new DetailFormatter() {
@Override
public String format(Object duration, Record record, DetailViewerField detailViewerField) {
if (duration != null) {
return Job.formatDuration(duration.toString());
} else {
return "";
}
}
});
}
}
this.details.setFields(fields);
return getLayout();
}
示例4: getExpansionComponent
import com.smartgwt.client.widgets.viewer.DetailViewer; //导入依赖的package包/类
@Override
protected Canvas getExpansionComponent(final ListGridRecord record) {
if (expandRecord != null && expandRecord != record) {
this.collapseRecord(expandRecord);
}
this.expandRecord = record;
Task t = TaskRecord.getTask(record);
DetailViewer detail = new DetailViewer();
detail.setWidth100();
detail.setHeight100();
detail.setCanSelectText(true);
DetailViewerField[] fields = new DetailViewerField[4];
fields[0] = buildDetailViewer(TasksColumnsFactory.HOST_ATTR);
fields[1] = buildDetailViewer(TasksColumnsFactory.START_TIME_ATTR);
fields[2] = buildDetailViewer(TasksColumnsFactory.FINISHED_TIME_ATTR);
fields[3] = buildDetailViewer(TasksColumnsFactory.DESCRIPTION_ATTR);
detail.setFields(fields);
DetailViewerRecord detailRecord = new DetailViewerRecord();
this.expandTasksColumnsFactory.buildRecord(t, detailRecord);
detail.setData(new DetailViewerRecord[] { detailRecord });
VLayout layout = new VLayout();
layout.addMember(detail);
return layout;
}
示例5: generateDetails
import com.smartgwt.client.widgets.viewer.DetailViewer; //导入依赖的package包/类
private DetailViewer generateDetails(JSONObject hostc) {
DetailViewer details = new DetailViewer();
DetailViewerRecord dv = new DetailViewerRecord();
DetailViewerField[] fields = new DetailViewerField[hostc.keySet().size()];
int j = 0;
for (String hostatt : hostc.keySet()) {
fields[j++] = new DetailViewerField(convertIdToJavascriptId(hostatt));
}
details.setFields(fields);
for (String hostattkey : hostc.keySet()) {
String value = null;
if (hostc.get(hostattkey).isString() != null) {
value = hostc.get(hostattkey).isString().stringValue();
} else if (hostc.get(hostattkey).isNumber() != null) {
value = hostc.get(hostattkey).isNumber().toString();
} else if (hostc.get(hostattkey).isObject() != null) {
value = "< composed data >";
} else {
value = "";
}
dv.setAttribute(convertIdToJavascriptId(hostattkey), value);
}
details.setData(new DetailViewerRecord[] { dv });
details.setWidth("45%");
return details;
}
示例6: createGameDetailViewer
import com.smartgwt.client.widgets.viewer.DetailViewer; //导入依赖的package包/类
public void createGameDetailViewer() {
gameDetailViewer = new DetailViewer();
gameDetailViewer.setFields(
new DetailViewerField(GameModel.GAME_TITLE_FIELD, "Title"),
new DetailViewerField(GameModel.GAME_DESCRIPTION_FIELD, "Description")
);
}
示例7: setUpInformationArea
import com.smartgwt.client.widgets.viewer.DetailViewer; //导入依赖的package包/类
private void setUpInformationArea() {
informationArea = new DetailViewer();
informationArea.setHeight("45%");
informationArea.setTop(250);
informationArea.setFields(
new DetailViewerField(GameModel.GAME_TITLE_FIELD, "Title"),
new DetailViewerField(GameModel.GAMEID_FIELD, "Id"),
new DetailViewerField(GameModel.DELETED_FIELD, "Deleted"),
new DetailViewerField(GameModel.TIME_FIELD, "Time"));
informationArea.setEmptyMessage("Click a game in the grid");
}
示例8: getCellHoverComponent
import com.smartgwt.client.widgets.viewer.DetailViewer; //导入依赖的package包/类
@Override
protected Canvas getCellHoverComponent(Record record, Integer rowNum, Integer colNum) {
DetailViewer detailViewer = new DetailViewer();
detailViewer.setWidth(320);
// Define the fields that we want to display in the details popup. These
// fields are populated from the record of the selected algorithm.
DetailViewerField versionField = new DetailViewerField(UploadColumns.VERSION.colName(),
"Version");
DetailViewerField uploadedDateField = new DetailViewerField(
UploadColumns.UPLOAD_DATE.colName(), "Date Uploaded");
DetailViewerField algorithmNameField = new DetailViewerField(UploadColumns.NAME.colName(),
"Algorithm");
DetailViewerField userField = new DetailViewerField(UploadColumns.USER.colName(), "User");
DetailViewerField descriptionField = new DetailViewerField(
UploadColumns.DESCRIPTION.colName(), "Description");
DetailViewerField institutionField = new DetailViewerField(
UploadColumns.INSTITUTION.colName(), "Institution");
DetailViewerField creationDateField = new DetailViewerField(
UploadColumns.CREATEDATE.colName(), "Date Created");
DetailViewerField commentsField = new DetailViewerField(UploadColumns.COMMENT.colName(),
"Comments");
DetailViewerField statusField = new DetailViewerField(UploadColumns.STATUS.colName(),
"Status");
detailViewer
.setFields(algorithmNameField, statusField, institutionField, userField,
versionField, uploadedDateField, creationDateField, descriptionField,
commentsField);
detailViewer.setData(new Record[] { record });
return detailViewer;
}
示例9: build
import com.smartgwt.client.widgets.viewer.DetailViewer; //导入依赖的package包/类
Canvas build() {
VLayout vl = new VLayout();
vl.setOverflow(Overflow.AUTO);
this.label = new Label("No node selected");
this.label.setWidth100();
this.label.setAlign(Alignment.CENTER);
this.nodeDetails = new DetailViewer();
this.nodeDetails.setWidth100();
this.nodeDetails.setHeight100();
this.nodeDetails.setCanSelectText(true);
DetailViewerField d1 = new DetailViewerField("nodeUrl", "URL");
DetailViewerField d2 = new DetailViewerField("nodeState", "Status");
DetailViewerField d3 = new DetailViewerField("nodeProvider", "Provider");
DetailViewerField d4 = new DetailViewerField("nodeOwner", "Used by");
DetailViewerField d5 = new DetailViewerField("sourceName", "Source");
DetailViewerField d6 = new DetailViewerField("hostName", "Host");
DetailViewerField d7 = new DetailViewerField("vmName", "JVM");
DetailViewerField d8 = new DetailViewerField("description", "Description");
this.nodeDetails.setFields(d1, d5, d6, d2, d3, d4, d7, d8);
this.nodeCanvas = new VLayout();
this.nodeCanvas.setWidth100();
this.nodeLabel = new Label("<h3>Node</h3>");
this.nodeLabel.setIcon(RMImages.instance.node_add_16().getSafeUri().asString());
this.nodeLabel.setHeight(16);
this.nodeCanvas.addMember(this.nodeLabel);
this.nodeCanvas.addMember(this.nodeDetails);
this.nodeCanvas.hide();
this.nsDetails = new DetailViewer();
this.nsDetails.setWidth100();
this.nsDetails.setHeight100();
this.nsDetails.setCanSelectText(true);
DetailViewerField n1 = new DetailViewerField("sourceName", "Node Source");
DetailViewerField n2 = new DetailViewerField("description", "Description");
DetailViewerField n3 = new DetailViewerField("nodeProvider", "Owner");
DetailViewerField n4 = new DetailViewerField("hosts", "Hosts");
DetailViewerField n5 = new DetailViewerField("nodes", "Nodes");
this.nsDetails.setFields(n1, n2, n3, n4, n5);
this.nsCanvas = new VLayout();
this.nsCanvas.setWidth100();
this.nsCanvas.setHeight100();
Label nsl = new Label("<h3>Node Source</h3>");
nsl.setHeight(16);
nsl.setIcon(RMImages.instance.nodesource_16().getSafeUri().asString());
this.nsCanvas.addMember(nsl);
this.nsCanvas.addMember(this.nsDetails);
this.nsCanvas.hide();
this.hostDetails = new DetailViewer();
this.hostDetails.setWidth100();
this.hostDetails.setHeight100();
this.hostDetails.setCanSelectText(true);
DetailViewerField h1 = new DetailViewerField("hostName", "Host");
DetailViewerField h2 = new DetailViewerField("nodes", "Nodes");
this.hostDetails.setFields(h1, h2);
this.hostCanvas = new VLayout();
this.hostCanvas.setWidth100();
this.hostLabel = new Label("<h3>Host</h3>");
hostLabel.setHeight(16);
hostLabel.setIcon(RMImages.instance.host_16().getSafeUri().asString());
this.hostCanvas.addMember(hostLabel);
this.hostCanvas.addMember(this.hostDetails);
this.hostCanvas.hide();
vl.setMembers(label, nodeCanvas, nsCanvas, hostCanvas);
return vl;
}