本文整理汇总了Java中com.smartgwt.client.widgets.viewer.DetailViewer.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java DetailViewer.setWidth方法的具体用法?Java DetailViewer.setWidth怎么用?Java DetailViewer.setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.smartgwt.client.widgets.viewer.DetailViewer
的用法示例。
在下文中一共展示了DetailViewer.setWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}