當前位置: 首頁>>代碼示例>>Java>>正文


Java BasePagingLoadConfig類代碼示例

本文整理匯總了Java中com.extjs.gxt.ui.client.data.BasePagingLoadConfig的典型用法代碼示例。如果您正苦於以下問題:Java BasePagingLoadConfig類的具體用法?Java BasePagingLoadConfig怎麽用?Java BasePagingLoadConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BasePagingLoadConfig類屬於com.extjs.gxt.ui.client.data包,在下文中一共展示了BasePagingLoadConfig類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: bind

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
@Override
public void bind(PagingLoader loader) {
	super.bind(loader);
	if (loader instanceof BasePagingLoader) {
		
		config = getLoadConfig();
		((BasePagingLoadConfig)config).set("query", gridConfig.getQuery());
		config.setOffset(0);
		config.setLimit(pageSize);
		((BasePagingLoader)loader).setReuseLoadConfig(true);
		((BasePagingLoader)loader).useLoadConfig(config);
	}
	loader.addListener(Loader.BeforeLoad, new Listener<LoadEvent>() {

		public void handleEvent(LoadEvent be) {
			if (be.config instanceof BasePagingLoadConfig) {
				beforeLoad((BasePagingLoadConfig)be.config);
			}
		}
		
	});
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:23,代碼來源:SearchPagingToolBar.java

示例2: bind

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
public void bind(BasePagingLoader loader, BasePagingLoadConfig cfg) {
	this.loader = loader;
	config = cfg;
	loader.addListener(Loader.BeforeLoad, new Listener<LoadEvent>() {

		public void handleEvent(LoadEvent be) {
			if (be.config instanceof BasePagingLoadConfig) {
				beforeLoad((BasePagingLoadConfig)be.config);
			}
		}
		
	});
	
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:15,代碼來源:GridControllToolBar.java

示例3: prepareLoadConfig

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
@Override
protected BasePagingLoadConfig prepareLoadConfig(BasePagingLoadConfig config) {
	((BasePagingLoadConfig)config).set("query", modelConfig.getQuery());
	((BasePagingLoadConfig)config).set("mdr", modelConfig.getMDR());
	if (config.getSortInfo() != null) {
		config.getSortInfo().setSortDir(getSortDir());
		config.getSortInfo().setSortField(getSortField());
		
		String sortField = config.getSortInfo().getSortField();
		if (sortField != null) {
			for (AttributeColumnConfig colCfg : this.modelConfig.getColumnConfig()) {
				if (colCfg.getId().equals(sortField)) {
					String attrType = "valueAsString";

					if (colCfg.isComplex()) {
						attrType = "complex";
					}

					if (colCfg.getType().startsWith("xs:date")) {
						attrType = "valueAsDate";
					}
					if (colCfg.getType().startsWith("xs:integer")) {
						attrType = "valueAsLong";
					}
					((BasePagingLoadConfig)config).set("attrType", attrType);
					break;
				}
			}
		}
	}
	return(config);	
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:33,代碼來源:GridQueryLoader.java

示例4: bind

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
@Override
public void bind(PagingLoader loader) {
	super.bind(loader);
	
	loader.addListener(Loader.BeforeLoad, new Listener<LoadEvent>() {

		public void handleEvent(LoadEvent be) {
			if (be.config instanceof BasePagingLoadConfig) {
				beforeLoad((BasePagingLoadConfig)be.config);
			}
		}
		
	});
	
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:16,代碼來源:PageSizePagingToolBar.java

示例5: beforeLoad

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
protected void beforeLoad(BasePagingLoadConfig config) {
	//config.setOffset(start);
	//config.setLimit(pageSize);
	
	SortInfo sortInfo = new SortInfo();
	sortInfo.setSortDir(loader.getSortDir());
	sortInfo.setSortField(loader.getSortField());
	config.setLimit(pageSize);
	config.setSortInfo(sortInfo);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:11,代碼來源:PageSizePagingToolBar.java

示例6: beforeLoad

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
protected void beforeLoad(BasePagingLoadConfig config) {
	//config.setOffset(start);
	//config.setLimit(pageSize);
	((BasePagingLoadConfig)config).set("searchText", mapNameToID(searchField.getValue()));
	SortInfo sortInfo = new SortInfo();
	sortInfo.setSortDir(loader.getSortDir());
	sortInfo.setSortField(loader.getSortField());
	config.setLimit(pageSize);
	config.setSortInfo(sortInfo);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:11,代碼來源:SearchPagingToolBar.java

示例7: doLoadRequest

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
@Override
protected void doLoadRequest(int offset, int limit) {
	if (config == null) {
		config = getLoadConfig();
		((BasePagingLoadConfig)config).set("query", gridConfig.getQuery());			
	}
	config.setLimit(limit);
	config.setOffset(offset);
	
	loader.load(config);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:12,代碼來源:SearchPagingToolBar.java

示例8: loadGroupData

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
public BasePagingLoadResult<GroupCollection> loadGroupData(String token, BasePagingLoadConfig config) throws CMDBRPCException {
	
	try {
		GroupDescription desc = config.get("groupDescription");
		ContentData mdrData = desc.getMDR();
		if (mdrData == null) {
			String path = ConfigurationFactory.getConfig().get(Config.OneCMDBWebService);
			mdrData = new ContentFile(path);
		}
		String xmlQuery = desc.getQuery();
		XML2GraphQuery parser = new XML2GraphQuery();
		GraphQuery query = parser.parse(xmlQuery);
		
		ICIMDR mdr = (ICIMDR) ContentParserFactory.get().getCachedAdaptor(mdrData, ICIMDR.class);
		
		// TODO: Handle Paging...
		ItemSelector prim = query.fetchPrimarySelectors();
		prim.setPageInfo(new PageInfo(config.getOffset(), config.getLimit()));
		Graph result = mdr.query(token, query);
		result.buildMap();
		GroupTransform gTransform = new GroupTransform();
		List<GroupCollection> group = gTransform.generateGroupData(mdr, token, query, result);
		BasePagingLoadResult<GroupCollection> data = new BasePagingLoadResult<GroupCollection>(group);
		
		data.setOffset(config.getOffset());
		data.setTotalLength(result.fetchNode(prim.getId()).getTotalCount());
		
		return(data);
	} catch (Throwable t) {
		throw new CMDBRPCException("Load Group Data", t.getMessage(), CMDBRPCHandler.getStackTrace(t));	
	}

}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:34,代碼來源:ModelServiceImpl.java

示例9: loadDataSourceData

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
public BasePagingLoadResult<BaseModel> loadDataSourceData(String token, BasePagingLoadConfig config) throws CMDBRPCException {
	try {
		return(new MDRSetupService().loadDataSourceData(token, config));
	} catch (Throwable e) {
		e.printStackTrace();
		throw new CMDBRPCException("Error loading datasource data", e.getMessage(), CMDBRPCHandler.getStackTrace(e));
	}
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:9,代碼來源:ModelServiceImpl.java

示例10: getProxy

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
public DataProxy<BasePagingLoadConfig, BasePagingLoadResult<GroupCollection>> getProxy(String id, GroupCollection scope) {
	return(new GroupProxy(id, scope, this));
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:4,代碼來源:GroupDescription.java

示例11: loadGroupData

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
public void loadGroupData(String token, BasePagingLoadConfig config, 
AsyncCallback<BasePagingLoadResult<GroupCollection>> callback);
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:3,代碼來源:IModelServiceAsync.java

示例12: beforeLoad

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
protected void beforeLoad(BasePagingLoadConfig config) {
	//config.setOffset(start);
	//config.setLimit(pageSize);
	((BasePagingLoadConfig)config).set("searchText", mapNameToID(searchField.getValue()));
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:6,代碼來源:GridControllToolBar.java

示例13: getLoadConfig

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
public BasePagingLoadConfig getLoadConfig() {	
	return(this.config);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:4,代碼來源:GridControllToolBar.java

示例14: load

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
@Override
protected void load(BasePagingLoadConfig loadConfig,
		final AsyncCallback<BasePagingLoadResult<GroupCollection>> callback) {
	
	
	if (scope == null) {
		//loadTestData(callback);
		
		// Load new GroupDescription.
		loadConfig.set("groupDescription", desc);
		ModelServiceFactory.get().loadGroupData(CMDBSession.get().getToken(), loadConfig, new CMDBAsyncCallback<BasePagingLoadResult<GroupCollection>>() {

			
			@Override
			public void onFailure(Throwable t) {
				super.onFailure(t);
				callback.onFailure(t);
			}

			@Override
			public void onSuccess(
					BasePagingLoadResult<GroupCollection> arg0) {
				callback.onSuccess(arg0);		
			}
			
		});
		
		return;
	}
	
	// Need to transform the model.
	
	Object group = scope.get(id);
	List<GroupCollection> data = new ArrayList<GroupCollection>();
	if (group instanceof ListModelItem) {
		data = ((ListModelItem)group).toList();
	}
	BasePagingLoadResult<GroupCollection> result = new BasePagingLoadResult<GroupCollection>(data);
	result.setOffset(0);
	result.setTotalLength(data.size());
	callback.onSuccess(result);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:43,代碼來源:GroupProxy.java

示例15: initUI

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig; //導入依賴的package包/類
public void initUI() {
	
	// Create Loader.
	BasePagingLoader<BasePagingLoadConfig, BasePagingLoadResult<GroupCollection>> loader = new BasePagingLoader<BasePagingLoadConfig, BasePagingLoadResult<GroupCollection>>(desc.getProxy(id, (GroupCollection)getValue()));
	
	// Create Store
	ListStore<GroupCollection> store = new ListStore<GroupCollection>(loader);
	store.setMonitorChanges(true);
	
	// Create editor grid.
	ColumnModel model = desc.getTableColumnModel(name, id, permissions);
	EditorGrid<GroupCollection> grid = new EditorGrid<GroupCollection>(store, model);
	for (int i = 0; i < model.getColumnCount(); i++) {
		ColumnConfig cfg = model.getColumn(i);
		if (cfg instanceof ComponentPlugin) {
			grid.addPlugin((ComponentPlugin)cfg);
		}
	}
	
	grid.setBorders(true);
	grid.setLoadMask(true);
	
	
	// Fill the component with the grid.
	setLayout(new FitLayout());
	
	// Add this for scrollbars!
	ContentPanel panel = new ContentPanel();
	panel.setHeaderVisible(false);
	panel.setLayout(new FitLayout());
	panel.add(grid);
	PagingToolBar paging = new PageSizePagingToolBar(50);
	paging.bind(loader);
	panel.setBottomComponent(paging);
	
	add(panel);

	
	
	loader.load();
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:42,代碼來源:GroupTableWidget.java


注:本文中的com.extjs.gxt.ui.client.data.BasePagingLoadConfig類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。