本文整理汇总了Java中com.extjs.gxt.ui.client.data.ModelData类的典型用法代码示例。如果您正苦于以下问题:Java ModelData类的具体用法?Java ModelData怎么用?Java ModelData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelData类属于com.extjs.gxt.ui.client.data包,在下文中一共展示了ModelData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setRenderer
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
@Override
public void setRenderer(GridCellRenderer renderer) {
this.specificRender = renderer;
super.setRenderer(new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store) {
String text = specificRender.render(model, property, config, rowIndex, colIndex, store);
config.css = "x-grid3-popup-col-td";
if (permissions.getCurrentState().equals(CMDBPermissions.PermissionState.READONLY)) {
return "<div class='x-grid3-popup-col x-grid3-popup-" + getId() + "'>" +
text +
"</div>";
} else {
return(text);
}
}
});
}
开发者ID:luox12,项目名称:onecmdb,代码行数:25,代码来源:PopupTextColumnConfig.java
示例2: onMouseDown
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
protected void onMouseDown(GridEvent ge) {
if (this.readonly) {
return;
}
String cls = ge.getTarget().getClassName();
if (cls != null && cls.indexOf("x-grid3-cc-" + getId()) != -1) {
ge.stopEvent();
int index = grid.getView().findRowIndex(ge.getTarget());
ModelData m = grid.getStore().getAt(index);
int col = grid.getView().findCellIndex(ge.getTarget(), null);
ColumnConfig colModel = grid.getColumnModel().getColumn(col);
String property = colModel.getDataIndex();
if (!isModelEditable(m, property)) {
return;
}
Record r = grid.getStore().getRecord(m);
boolean v = getValue(m, property);
r.set(property, "" + !v);
}
}
开发者ID:luox12,项目名称:onecmdb,代码行数:22,代码来源:MyCheckColumnConfig.java
示例3: init
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
protected void init() {
setRenderer(new GridCellRenderer() {
public String render(ModelData model, String property, ColumnData config, int rowIndex,
int colIndex, ListStore store) {
boolean v = getValue(model, property);
String on = v ? "-on" : "";
config.css = "x-grid3-check-col-td";
if (readonly || !isModelEditable(model, property)) {
return "<div class='x-grid3-check-ro-col" + on + " x-grid3-cc-" +getId() + "'> </div>";
}
return "<div class='x-grid3-check-col" + on + " x-grid3-cc-" +getId() + "'> </div>";
}
});
}
开发者ID:luox12,项目名称:onecmdb,代码行数:20,代码来源:MyCheckColumnConfig.java
示例4: init
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
protected void init() {
setRenderer(new GridCellRenderer() {
public String render(ModelData model, String property, ColumnData config, int rowIndex,
int colIndex, ListStore store) {
String value = getStringValue(model, property);
config.css = "x-grid3-url-col-td";
if (readonly) {
return "<div class='x-grid3-url-col x-grid3-url-" + getId() + "'>" +
"<a href='javascript:void()'>" + value + "</a>" +
"</div>";
} else {
return(value);
}
}
});
}
开发者ID:luox12,项目名称:onecmdb,代码行数:21,代码来源:URLColumnConfig.java
示例5: onMouseDown
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
protected void onMouseDown(GridEvent ge) {
String cls = ge.getTarget().getParentElement().getClassName();
if (cls != null && cls.indexOf("x-grid3-url-" + getId()) != -1) {
ge.stopEvent();
int index = grid.getView().findRowIndex(ge.getTarget());
ModelData m = grid.getStore().getAt(index);
String property = "";
if (m instanceof CIPropertyGrid.ValueWrapper) {
property = getId();
m = ((CIPropertyGrid.ValueWrapper)m).getModel();
} else {
int col = grid.getView().findCellIndex(ge.getTarget(), null);
ColumnConfig colModel = grid.getColumnModel().getColumn(col);
property = colModel.getDataIndex();
}
String url = getStringValue(m, property);
com.google.gwt.user.client.Window.open(url, "_blank", "");
}
}
开发者ID:luox12,项目名称:onecmdb,代码行数:24,代码来源:URLColumnConfig.java
示例6: getStringValue
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
protected String getStringValue(ModelData model, String property) {
String v = null;
Object value = model.get(property);
if (value instanceof ValueModel) {
v = ((ValueModel)value).getValue();
} else {
if (value != null) {
v = value.toString();
}
}
if (v == null) {
v = "";
}
return(v);
}
开发者ID:luox12,项目名称:onecmdb,代码行数:17,代码来源:URLColumnConfig.java
示例7: openView
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
protected void openView(ModelData data) {
String def = data.get("definition");
ContentFile f = new ContentFile();
f.setPath(def);
ModelServiceFactory.get().loadCustomView(CMDBSession.get().getToken(), f, new CMDBAsyncCallback<BaseModel>() {
@Override
public void onSuccess(BaseModel arg0) {
BaseModel widgets = arg0.get("widgets");
Object o = widgets.get("widget");
if (o instanceof List) {
for (CMDBDesktopWindowItem item : (List<CMDBDesktopWindowItem>)o) {
WindowFactory.showWindow(CMDBSession.get().getDesktop(), item);
}
}
}
});
}
开发者ID:luox12,项目名称:onecmdb,代码行数:19,代码来源:CustomViewSelectWidget.java
示例8: getAvailableProfiles
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
/**
* Gets the available profiles.
*
* @return the available profiles
*/
private ListStore<UserGroupModel> getAvailableProfiles()
{
ListStore<UserGroupModel> availableProfiles = new ListStore<UserGroupModel>();
RpcProxy<PagingLoadResult<UserGroupModel>> profileProxy = new RpcProxy<PagingLoadResult<UserGroupModel>>()
{
@Override
protected void load(Object loadConfig, AsyncCallback<PagingLoadResult<UserGroupModel>> callback)
{
profilesManagerServiceRemote.getProfiles(
((PagingLoadConfig) loadConfig).getOffset(), ((PagingLoadConfig) loadConfig).getLimit(),
false, callback);
}
};
BasePagingLoader<PagingLoadResult<ModelData>> profilesLoader =
new BasePagingLoader<PagingLoadResult<ModelData>>(
profileProxy);
profilesLoader.setRemoteSort(false);
availableProfiles = new ListStore<UserGroupModel>(profilesLoader);
return availableProfiles;
}
开发者ID:geoserver,项目名称:geofence,代码行数:30,代码来源:AddGsUserWidget.java
示例9: createStore
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
@Override
public void createStore() {
// /////////////////////////////
// Loader for rulesService
// /////////////////////////////
this.proxy = new RpcProxy<List<LayerStyle>>() {
@Override
protected void load(Object loadConfig,
AsyncCallback<List<LayerStyle>> callback) {
workspacesService.getStyles(theRule, callback);
}
};
loader = new BaseListLoader<ListLoadResult<ModelData>>(proxy);
loader.setRemoteSort(false);
store = new ListStore<LayerStyle>(loader);
store.sort(BeanKeyValue.STYLES_COMBO.getValue(), SortDir.ASC);
setUpLoadListener();
}
开发者ID:geoserver,项目名称:geofence,代码行数:23,代码来源:RuleDetailsGridWidget.java
示例10: createStore
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
@Override
public void createStore()
{
// /////////////////////////////
// Loader for rulesService
// /////////////////////////////
this.proxy = new RpcProxy<PagingLoadResult<UserGroupModel>>()
{
@Override
protected void load(Object loadConfig, AsyncCallback<PagingLoadResult<UserGroupModel>> callback)
{
profilesService.getProfiles(-1,-1,false, callback);
}
};
loader = new BaseListLoader<ListLoadResult<ModelData>>(proxy);
loader.setRemoteSort(false);
store = new ListStore<UserGroupModel>(loader);
store.sort(BeanKeyValue.STYLES_COMBO.getValue(), SortDir.ASC);
setUpLoadListener();
}
开发者ID:geoserver,项目名称:geofence,代码行数:25,代码来源:ProfilesGridWidget.java
示例11: getAvailableStyles
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
/**
* Gets the available styles.
*
* @param rule
* the rule
* @return the available styles
*/
private ListStore<LayerStyle> getAvailableStyles(final RuleModel rule)
{
RpcProxy<List<LayerStyle>> workspacesProxy = new RpcProxy<List<LayerStyle>>()
{
@Override
protected void load(Object loadConfig, AsyncCallback<List<LayerStyle>> callback)
{
workspacesService.getStyles(rule, callback);
}
};
BaseListLoader<ListLoadResult<ModelData>> workspacesLoader = new BaseListLoader<ListLoadResult<ModelData>>(
workspacesProxy);
workspacesLoader.setRemoteSort(false);
ListStore<LayerStyle> geoserverStyles = new ListStore<LayerStyle>(workspacesLoader);
return geoserverStyles;
}
开发者ID:geoserver,项目名称:geofence,代码行数:29,代码来源:RuleDetailsInfoWidget.java
示例12: load
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
@Override
protected void load(Object loadConfig,
final AsyncCallback<ListLoadResult<ModelData>> callback) {
dispatcher.execute(new GetIndicators(databaseId), new AsyncCallback<IndicatorListResult>() {
@Override
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess(IndicatorListResult result) {
callback.onSuccess((ListLoadResult)result);
}
});
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:19,代码来源:IndicatorFilterCombo.java
示例13: load
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
@Override
protected void load(Object loadConfig,
final AsyncCallback<ListLoadResult<ModelData>> callback) {
Filter filter = new Filter();
filter.addRestriction(DimensionType.Database, databaseId);
GetSites request = new GetSites();
request.setFilter(filter);
dispatcher.execute(request, new AsyncCallback<SiteResult>() {
@Override
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess(SiteResult result) {
callback.onSuccess((ListLoadResult)result);
}
});
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:25,代码来源:SiteFilterCombo.java
示例14: onResize
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void onResize(int width, int height) {
super.onResize(width, height);
int buttonWidth = buttonAdapter.el().getParent().getWidth();
if (buttonWidth <= 0) {
// TODO Try to 'always' determine dynamic button width (see 'EditFlexibleElementAdminView' problem).
buttonWidth = 70; // Arbitrary width considering all i18n translations widths.
button.setWidth(buttonWidth);
}
final int comboBoxesNumber = comboBoxes.size();
final int comboBoxesTotalWidth = width - buttonWidth - (comboBoxesNumber * spacing);
final int comboBoxWidth = comboBoxesTotalWidth / comboBoxesNumber;
for (final ComboBox<ModelData> comboBox : comboBoxes) {
comboBox.setSize(comboBoxWidth, height);
}
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:24,代码来源:ComboboxButtonField.java
示例15: createOrgUnitFilters
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
/**
* Creates filters for OrgUnits tree grid widget.
*
* @return The {@link GridFilters} instance.
*/
private static GridFilters createOrgUnitFilters() {
final GridFilters filters = new GridFilters();
filters.setLocal(true);
// Data index of each filter should be identical with column id in ColumnModel of TreeGrid
filters.addFilter(new StringFilter(OrgUnitDTO.NAME));
filters.addFilter(new StringFilter(OrgUnitDTO.FULL_NAME));
filters.addFilter(new StringFilter(OrgUnitDTO.OFFICE_LOCATION_COUNTRY) {
@Override
@SuppressWarnings("unchecked")
protected <X> X getModelValue(final ModelData model) {
final CountryDTO country = (CountryDTO) super.getModelValue(model);
return (X) CountryDTO.toString(country);
}
});
return filters;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:29,代码来源:OrgUnitTreeGrid.java
示例16: getSelectionAsDataSources
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
/**
*
* @return the selected indicators as {@link IndicatorDataSourceDTO} dtos.
*/
public List<IndicatorDataSourceDTO> getSelectionAsDataSources() {
List<IndicatorDataSourceDTO> list = new ArrayList<IndicatorDataSourceDTO>();
for(ModelData model : treePanel.getCheckedSelection()) {
IndicatorDTO indicator = (IndicatorDTO) model;
ProjectDTO project = (ProjectDTO) treePanel.getStore().getParent(model);
IndicatorDataSourceDTO datasource = new IndicatorDataSourceDTO();
datasource.setDatabaseId(project.getId());
datasource.setDatabaseName(project.getName());
datasource.setIndicatorCode(indicator.getCode());
datasource.setIndicatorName(indicator.getName());
datasource.setIndicatorId(indicator.getId());
list.add(datasource);
}
return list;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:23,代码来源:IndicatorBrowsePopup.java
示例17: getProjectManagerStore
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
private ListStore<BeanModel> getProjectManagerStore(){
RpcProxy<List<UserDTO>> UserProxy = new RpcProxy<List<UserDTO>>() {
@Override
protected void load(Object loadConfig, AsyncCallback<List<UserDTO>> callback) {
userService.getUsersByRole("pm",callback);
}
};
userloader = new BaseListLoader<ListLoadResult<ModelData>>(UserProxy,new BeanModelReader());
final ListStore<BeanModel> userStore = new ListStore<BeanModel>(userloader);
userStore.setMonitorChanges(true);
userloader.load();
return userStore;
}
开发者ID:treblereel,项目名称:Opensheet,代码行数:18,代码来源:AssignmentTreeGrid.java
示例18: populateAuthmethodGrid
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
private void populateAuthmethodGrid(){
RpcProxy<List<AuthmethodDTO>> authMethodProxy = new RpcProxy<List<AuthmethodDTO>>() {
@Override
protected void load(Object loadConfig, AsyncCallback<List<AuthmethodDTO>> callback) {
authService.getAuthMethods(callback);
}
};
loader = new BaseListLoader<ListLoadResult<ModelData>>(authMethodProxy,new BeanModelReader());
authMethodStore = new ListStore<BeanModel>(loader);
authMethodStore.setMonitorChanges(true);
loader.load();
}
开发者ID:treblereel,项目名称:Opensheet,代码行数:18,代码来源:AuthPanel.java
示例19: getGridCellRenderer
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
private GridCellRenderer<ModelData> getGridCellRenderer(){
GridCellRenderer<ModelData> r = new GridCellRenderer<ModelData>(){
@Override public Object render(ModelData model, String property,ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store, Grid<ModelData> grid) {
if(model.get(property).toString().equals("true")){
config.style = "background-image: url("+ GWT.getHostPageBaseURL().toString() + "resources/icons/add.gif) !important; background-repeat: no-repeat;";
}else{
config.style = "background-color: white;";
}
return "";
}
};
return r;
}
开发者ID:treblereel,项目名称:Opensheet,代码行数:19,代码来源:PermissionFormGrid.java
示例20: render
import com.extjs.gxt.ui.client.data.ModelData; //导入依赖的package包/类
@Override
public Object render(ModelData model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore store, Grid grid) {
/*
if(Integer.parseInt(property) <= holidays.size()){
if(holidays.get(Integer.parseInt(property))){
config.css = "x-treegrid-column-holiday";
}
}
*/
config.css = "x-treegrid-column-holiday";
if(model.get(property) == null){
return "<span style='color: green'></span>";
} else{
return "<span style='color: green'>" + model.get(property) + "</span>";
}
}
开发者ID:treblereel,项目名称:Opensheet,代码行数:22,代码来源:HourGridCellRenderer.java
注:本文中的com.extjs.gxt.ui.client.data.ModelData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论