本文整理汇总了Java中com.smartgwt.client.widgets.grid.ListGridRecord类的典型用法代码示例。如果您正苦于以下问题:Java ListGridRecord类的具体用法?Java ListGridRecord怎么用?Java ListGridRecord使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListGridRecord类属于com.smartgwt.client.widgets.grid包,在下文中一共展示了ListGridRecord类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: fillSummariesTable
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
private final void fillSummariesTable(List<ProcessDescriptorSummary> summaries) {
ListGridRecord[] array = new ListGridRecord[summaries.size()];
int i=0;
for(ProcessDescriptorSummary summary : summaries) {
ListGridRecord listGridRecord = new ListGridRecord();
listGridRecord.setAttribute("name", summary.name);
listGridRecord.setAttribute("iaCount", summary.initialActionCount);
listGridRecord.setAttribute("stepCount", summary.stepCount);
listGridRecord.setAttribute("splitCount", summary.splitCount);
listGridRecord.setAttribute("joinCount", summary.joinCount);
listGridRecord.setAttribute("piCount", summary.piCount);
listGridRecord.setAttribute("piCount-display", summary.piCount != 0 ? summary.piCount : "");
array[i++] = listGridRecord;
}
view.setData(array);
eventBus.fireEvent(new WorkflowSelectionChangedEvent(null));
}
开发者ID:will-gilbert,项目名称:OSWf-OSWorkflow-fork,代码行数:25,代码来源:WorkflowsPresenter.java
示例2: setCurrentSteps
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
private void setCurrentSteps(List<Step> steps) {
ListGridRecord[] array = new ListGridRecord[steps.size()];
int i=0;
for(Step step : steps) {
ListGridRecord listGridRecord = new ListGridRecord();
listGridRecord.setAttribute("id", step.id);
listGridRecord.setAttribute("name", step.name);
listGridRecord.setAttribute("status", step.status);
listGridRecord.setAttribute("owner", step.owner);
listGridRecord.setAttribute("created", step.startDate);
listGridRecord.setAttribute("due", step.dueDate);
array[i++] = listGridRecord;
}
view.setCurrentStepsData(array);
}
开发者ID:will-gilbert,项目名称:OSWf-OSWorkflow-fork,代码行数:22,代码来源:SimulatorPresenter.java
示例3: setHistorySteps
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
private void setHistorySteps(List<Step> steps) {
ListGridRecord[] array = new ListGridRecord[steps.size()];
int i=0;
for(Step step : steps) {
ListGridRecord listGridRecord = new ListGridRecord();
listGridRecord.setAttribute("id", step.id);
listGridRecord.setAttribute("name", step.name);
listGridRecord.setAttribute("status", step.status);
listGridRecord.setAttribute("actor", step.actor);
listGridRecord.setAttribute("action", step.action);
listGridRecord.setAttribute("finished", step.finishDate);
array[i++] = listGridRecord;
}
view.setHistoryStepsData(array);
}
开发者ID:will-gilbert,项目名称:OSWf-OSWorkflow-fork,代码行数:22,代码来源:SimulatorPresenter.java
示例4: setWorkflowOverview
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
private void setWorkflowOverview(List<Overview> list) {
ListGridRecord[] array = new ListGridRecord[list.size()];
int i=0;
for(Overview overview : list) {
ListGridRecord listGridRecord = new ListGridRecord();
listGridRecord.setAttribute("id", overview.id);
listGridRecord.setAttribute("name", overview.stepName);
listGridRecord.setAttribute("current", overview.current);
listGridRecord.setAttribute("current-display", overview.current != 0 ? overview.current : "");
listGridRecord.setAttribute("history", overview.history);
listGridRecord.setAttribute("history-display", overview.history != 0 ? overview.history : "");
listGridRecord.setAttribute("max", overview.maxPendingDisplay);
listGridRecord.setAttribute("max-display", overview.maxPendingDisplay.equals("0ms") ? "" : overview.maxPendingDisplay);
listGridRecord.setAttribute("avg", overview.avgPendingDisplay);
listGridRecord.setAttribute("avg-display", overview.avgPendingDisplay.equals("0ms") ? "" : overview.avgPendingDisplay);
array[i++] = listGridRecord;
}
view.setWorkflowOverviewData(array);
}
开发者ID:will-gilbert,项目名称:OSWf-OSWorkflow-fork,代码行数:26,代码来源:SimulatorPresenter.java
示例5: buildListGridField
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
protected Map<GridColumns, ListGridField> buildListGridField() {
Map<GridColumns, ListGridField> fields = super.buildListGridField();
ListGridField idField = fields.get(TasksColumnsFactory.ID_ATTR);
idField.setType(ListGridFieldType.INTEGER);
alignCells(fields);
ListGridField execDuration = fields.get(EXEC_DURATION_ATTR);
execDuration.setCellFormatter(new CellFormatter() {
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
if (value != null) {
return Job.formatDuration(value.toString());
} else {
return "";
}
}
});
return fields;
}
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:22,代码来源:TasksListGrid.java
示例6: getCellCSSText
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
@Override
protected String getCellCSSText(ListGridRecord record, int rowNum, int colNum) {
String base = super.getCellCSSText(record, rowNum, colNum);
String fieldName = this.getFieldName(colNum);
if (fieldName.equals(STATUS_ATTR.getName())) {
String st = record.getAttribute(STATUS_ATTR.getName());
if (st.equals(TaskStatus.PENDING.toString()) || st.equals(TaskStatus.SUBMITTED.toString())) {
return "color:#1a8bba;" + base;
} else if (st.equals(TaskStatus.RUNNING.toString())) {
return "color:#176925;font-weight:bold;" + base;
} else if (st.equals(TaskStatus.ABORTED.toString()) || st.equals(TaskStatus.FAILED.toString())) {
return "color:#d37a11;font-weight:bold;" + base;
} else if (st.equals(TaskStatus.FAULTY.toString()) || st.equals(TaskStatus.NOT_STARTED.toString()) ||
st.equals(TaskStatus.NOT_RESTARTED.toString()) || st.equals(TaskStatus.IN_ERROR.toString())) {
return "color:#c50000;font-weight:bold;" + base;
} else {
return base;
}
}
return base;
}
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:25,代码来源:TasksListGrid.java
示例7: createRecordComponent
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
@Override
protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) {
String fieldName = this.getFieldName(colNum);
if ("visu".equals(fieldName)) {
ImgButton button = new ImgButton();
button.setSrc("transp.gif");
button.setWidth(16);
button.setHeight(16);
button.setShowFocused(false);
button.setShowHover(false);
button.setShowRollOver(false);
button.setShowOverCanvas(false);
button.setShowDown(false);
visuButtons.put(record.getAttributeAsString(TasksColumnsFactory.ID_ATTR.getName()), button);
for (RemoteHint rh : controller.getModel().getRemoteHints()) {
loadRemoteHint(rh, record);
}
return button;
} else {
return null;
}
}
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:25,代码来源:TasksListGrid.java
示例8: loadRemoteHint
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
private void loadRemoteHint(final RemoteHint hint, final ListGridRecord rec) {
String taskId = rec.getAttributeAsString(TasksColumnsFactory.ID_ATTR.getName());
String jobId = this.controller.getModel()
.getParentModel()
.getExecutionsModel()
.getJobsModel()
.getSelectedJob()
.getId()
.toString();
final String taskName = rec.getAttributeAsString(NAME_ATTR.getName());
if (taskId.equals(hint.taskId) && jobId.equals(hint.jobId)) {
ImgButton button = visuButtons.get(taskId);
button.setSrc(SchedulerImages.instance.visu_16().getSafeUri().asString());
if (visuButtonsClickHandlers.containsKey(button)) {
visuButtonsClickHandlers.get(button).removeHandler();
}
HandlerRegistration clickHandler = button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
showRemoteVisuChoices(hint, taskName);
}
});
visuButtonsClickHandlers.put(button, clickHandler);
}
}
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:25,代码来源:TasksListGrid.java
示例9: sortStatusAndGroup
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
/**
* A custom sort for status:
* - pending first
* - running, stalled, paused then
* - all other status (finished, killed,...)
*/
private SortNormalizer sortStatusAndGroup() {
return new SortNormalizer() {
@Override
public Object normalize(ListGridRecord record, String fieldName) {
String status = record.getAttribute(fieldName);
if (status.equals(JobStatus.PENDING.toString())) {
return 0;
} else if (status.equals(JobStatus.RUNNING.toString()) || status.equals(JobStatus.STALLED.toString()) ||
status.equals(JobStatus.PAUSED.toString())) {
return 1;
} else {
return 2;
}
}
};
}
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:23,代码来源:JobsListGrid.java
示例10: fixListGridContextMenu
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
/**
* Fixes {@link ListGrid} context menu
* to update grid selection on right click properly.
* <p>Bug: right click selects row without firing selection event.
*/
public static void fixListGridContextMenu(final ListGrid grid) {
grid.addShowContextMenuHandler(new ShowContextMenuHandler() {
@Override
public void onShowContextMenu(ShowContextMenuEvent event) {
int eventRow = grid.getEventRow();
if (eventRow < 0) {
return ;
}
ListGridRecord[] selectedRecords = grid.getSelectedRecords();
if (selectedRecords.length <= 1) {
// ListGrid does not fire selection updated event if right click
// no select if multi-selection exists
grid.selectSingleRecord(eventRow);
}
Menu contextMenu = grid.getContextMenu();
contextMenu.showContextMenu();
event.cancel();
}
});
}
开发者ID:proarc,项目名称:proarc,代码行数:29,代码来源:Actions.java
示例11: createUserList
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
private ListGrid createUserList(ToolStrip gridEditControls) {
final ListGrid grid = new ListGrid() {
@Override
protected Canvas getExpansionComponent(ListGridRecord record) {
return getRowProfileEditor(record);
}
};
grid.setDataSource(UserDataSource.getInstance());
grid.setUseAllDataSourceFields(true);
grid.setSelectionType(SelectionStyle.SINGLE);
grid.setCanExpandRecords(true);
grid.setCanExpandMultipleRecords(false);
grid.setGridComponents(gridEditControls, ListGridComponent.HEADER, ListGridComponent.BODY);
// Since SmartGWT 4.0; disable auto-save to post updates of nested forms just on the submit actions.
grid.setAutoSaveEdits(false);
grid.setShowClippedValuesOnHover(true);
return grid;
}
开发者ID:proarc,项目名称:proarc,代码行数:21,代码来源:UsersView.java
示例12: onChanged
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
@Override
public void onChanged(ChangedEvent event) {
ListGridRecord r = selectCatalog.getSelectedRecord();
String lastFieldSelection = selectField.getValueAsString();
Record[] fields = r.getAttributeAsRecordArray(BibliographicCatalogResourceApi.CATALOG_FIELDS);
LinkedHashMap<String, String> fieldMap = new LinkedHashMap<String, String>();
for (Record field : fields) {
String fId = field.getAttribute(BibliographicCatalogResourceApi.CATALOG_FIELD_ID);
String fTitle = field.getAttribute(BibliographicCatalogResourceApi.CATALOG_FIELD_TITLE);
fTitle = fTitle == null || fId.equals(fTitle) ? FIELD_TYPE_TITLES.get(fId) : fTitle;
fTitle = fTitle == null ? fId : fTitle;
fieldMap.put(fId, fTitle);
}
if (!fieldMap.containsKey(lastFieldSelection)) {
if (fieldMap.isEmpty()) {
lastFieldSelection = null;
} else {
lastFieldSelection = fieldMap.keySet().iterator().next();
}
}
selectField.setValueMap(fieldMap);
selectField.setValue(lastFieldSelection);
}
开发者ID:proarc,项目名称:proarc,代码行数:24,代码来源:CatalogBrowser.java
示例13: getRoleGrid
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
private Canvas getRoleGrid() {
listGrid = new GenericListGrid(false, true, false, false, false){
protected void deleteItem(ListGridRecord rollOverRecord) {
RoleConfigSection.this.deleteRole(rollOverRecord.getAttributeAsString(GameRoleModel.ROLE_FIELD));
}
};
listGrid.setWidth(300);
listGrid.setShowRollOverCanvas(true);
listGrid.setAutoFetchData(true);
listGrid.setDataSource(GameRolesDataSource.getInstance());
ListGridField roleField = new ListGridField(GameRoleModel.ROLE_FIELD, constants.roles());
listGrid.setFields(new ListGridField[] { roleField });
return listGrid;
}
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:18,代码来源:RoleConfigSection.java
示例14: deleteRecord
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
public void deleteRecord(final ListGridRecord record) {
SC.ask("do you want to delete this item", new BooleanCallback() {
@Override
public void execute(Boolean value) {
if (value) {
GeneralItemsClient.getInstance().deleteGeneralItem(record.getAttributeAsLong(GameModel.GAMEID_FIELD), record.getAttributeAsLong(GeneralItemModel.GENERALITEMID_FIELD), new JsonCallback() {
public void onJsonReceived(JSONValue jsonValue) {
GeneralItemDataSource.getInstance().removeRecordWithKey(record.getAttributeAsLong(GeneralItemModel.GENERALITEMID_FIELD));
}
});
}
}
});
}
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:18,代码来源:GeneralItemsTab.java
示例15: deleteItem
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
@Override
protected void deleteItem(final ListGridRecord rollOverRecord) {
SC.ask(constants.deleteThisRun().replace("***", rollOverRecord.getAttributeAsString(RunModel.RUNTITLE_FIELD)), new BooleanCallback() {
public void execute(Boolean value) {
if (value != null && value) {
RunClient.getInstance().deleteItemsForRun(rollOverRecord.getAttributeAsLong("runId"), new JsonCallback() {
@Override
public void onJsonReceived(JSONValue jsonValue) {
RunDataSource.getInstance().loadDataFromWeb();
}
});
}
}
});
}
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:20,代码来源:RunsTab.java
示例16: setDragDropEnabled
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
@Override
public void setDragDropEnabled(boolean dragDropEnabled) {
/* drag drop*/
setCanAcceptDroppedRecords(dragDropEnabled);
setCanReorderRecords(dragDropEnabled);
addDropCompleteHandler(new DropCompleteHandler() {
@Override
public void onDropComplete(DropCompleteEvent dropCompleteEvent) {
if (dropCompleteEvent.getTransferredRecords().length == 1) {
ListGridRecord record = (ListGridRecord) dropCompleteEvent.getTransferredRecords()[0];
int index = getRecordIndex(record);
if (index >= 0) { // for some reason dropComplete is done twice, second time index = -1
Layer layer = (Layer) record.getAttributeAsObject(FLD_OBJECT);
int recordsAmount = getTotalRows();
// return the index of the rendered list, not the inverse list as presented in the view
handler.onMoveLayer(layer, recordsAmount - 1 - index);
}
}
}
});
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:22,代码来源:LayerListGrid.java
示例17: getCellCSSText
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
@Override
/* Override getCellCSSText to implement padding-left of ordinary feature rows */
protected String getCellCSSText(ListGridRecord record, int rowNum, int colNum) {
// Note: using listGrid.setCellPadding() would also padd group rows
String newStyle;
String style = record.getCustomStyle(); /* returns groupNode if group row, else e.g. null */
if (LABEL.equals(getFieldName(colNum)) && (null == style || !"groupNode".equalsIgnoreCase(style))) {
newStyle = "padding-left: 40px;";
} else { /* groupCell */
newStyle = "padding-left: 5px;";
}
if (null != super.getCellCSSText(record, rowNum, colNum)) {
newStyle = super.getCellCSSText(record, rowNum, colNum) + newStyle;
/* add padding after original, the latter specified wins. */
}
return newStyle;
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:19,代码来源:MultiLayerFeaturesList.java
示例18: addFeature
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
/**
* Adds a new feature to the grid list. A {@link VectorLayer} must have been
* set first, and the feature must belong to that VectorLayer.
*
* @param feature
* The feature to be added to the grid list.
* @return Returns true in case of success, and false if the feature is null
* or if the feature does not belong to the correct layer or if the
* layer has not yet been set.
*/
private boolean addFeature(Feature feature, Layer<?> layer) {
// Basic checks:
if (feature == null || layer == null ) {
return false;
}
// Feature checks out, add it to the grid:
ListGridRecord record = new ListGridRecord();
if (layer instanceof VectorLayer) {
record.setAttribute(LABEL, getLabel(feature));
} else if (layer instanceof RasterLayer) {
record.setAttribute(LABEL, feature.getId());
}
record.setAttribute(FEATURE_ID, getFullFeatureId(feature, layer));
record.setAttribute(LAYER_ID, layer.getId());
record.setAttribute(LAYER_LABEL, layer.getLabel());
addData(record);
return true;
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:29,代码来源:MultiLayerFeaturesList.java
示例19: addFeature
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
/**
* Adds a new feature to the list. A {@link VectorLayer} must have been set first, and the feature must belong to
* that VectorLayer.
*
* @param feature
* The feature to be added to the list.
* @return Returns true in case of success, and false if the feature is already in the list or the feature is null
* or if the feature does not belong to the correct layer or if the layer has not yet been set.
*/
public boolean addFeature(Feature feature) {
// Basic checks:
if (feature == null || layer == null || !feature.getLayer().getId().equals(layer.getId())) {
return false;
}
// Does feature already exist?
if (featureIds.contains(feature.getId())) {
return false;
}
featureIds.add(feature.getId());
// Feature checks out, add it to the grid:
ListGridRecord record = new ListGridRecord();
record.setAttribute(FIELD_NAME_FEATURE_ID, feature.getId());
copyToRecord(feature, record);
addData(record);
return true;
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:29,代码来源:FeatureListGrid.java
示例20: onFeatureDeselected
import com.smartgwt.client.widgets.grid.ListGridRecord; //导入依赖的package包/类
/**
* This method is used only when selection is enabled (see setSelectionEnabled). When a feature deselection event is
* sent out from the MapModel, check if we have that row selected and deselect it.
*/
public void onFeatureDeselected(FeatureDeselectedEvent event) {
Feature feature = event.getFeature();
// Only deselect if it is actually selected:
boolean selected = false;
ListGridRecord[] selections = getSelection();
for (ListGridRecord selection : selections) {
if (selection.getAttribute(FIELD_NAME_FEATURE_ID).equals(feature.getId())) {
selected = true;
break;
}
}
// If selected, find the correct row and deselect:
if (selected) {
ListGridRecord[] records = this.getRecords();
for (ListGridRecord record : records) {
if (record.getAttribute(FIELD_NAME_FEATURE_ID).equals(feature.getId())) {
deselectRecord(record);
break;
}
}
}
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:29,代码来源:FeatureListGrid.java
注:本文中的com.smartgwt.client.widgets.grid.ListGridRecord类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论