本文整理汇总了Java中com.extjs.gxt.ui.client.store.TreeStore类的典型用法代码示例。如果您正苦于以下问题:Java TreeStore类的具体用法?Java TreeStore怎么用?Java TreeStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeStore类属于com.extjs.gxt.ui.client.store包,在下文中一共展示了TreeStore类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initUI
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
public void initUI() {
TreeStore<TreeModel> store = new TreeStore<TreeModel>();
store.add(root, true);
final Tree tree = new Tree();
TreeBinder<TreeModel> binder = new TreeBinder<TreeModel>(tree, store);
binder.setDisplayProperty(property);
ContentPanel cp = new ContentPanel();
cp.setHeaderVisible(false);
cp.setLayout(new FitLayout());
cp.add(tree);
add(cp);
layout();
}
开发者ID:luox12,项目名称:onecmdb,代码行数:19,代码来源:PropertyNavigationTree.java
示例2: populateItem
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
public void populateItem(TreeStore<BaseModel> store, BaseModel parent, String tag, Object value) {
if (value instanceof List) {
BaseModel list = new BaseModel();
list.set("name", tag);
store.add(parent, list, false);
for (Object o : (List)value) {
populateItem(store, list, tag, o);
}
return;
}
if (value instanceof BaseModel) {
BaseModel child = new BaseModel();
child.set("name", tag);
child.set("model", value);
populateTree(store, parent, child);
} else {
BaseModel leaf = new BaseModel();
leaf.set("name", tag);
leaf.set("object", value);
store.add(parent, leaf, false);
}
}
开发者ID:luox12,项目名称:onecmdb,代码行数:24,代码来源:GroupEditor.java
示例3: buildTreeGrid
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
/**
* Builds the tree grid component.
*
* @return The tree grid component.
*/
private TreeGrid<IndicatorElement> buildTreeGrid() {
// Columns
IndicatorResources.INSTANCE.css().ensureInjected();
final List<ColumnConfig> columns = createColumns();
// Store
final TreeStore<IndicatorElement> store = createTreeStore();
// Grid
treeGrid = createTreeGrid(store, columns);
treeGrid.setBorders(true);
treeGrid.getStyle().setNodeCloseIcon(null);
treeGrid.getStyle().setNodeOpenIcon(null);
treeGrid.getStyle().setLeafIcon(null);
treeGrid.setAutoExpandColumn(IndicatorDTO.NAME);
treeGrid.setTrackMouseOver(false);
treeGrid.setClicksToEdit(EditorGrid.ClicksToEdit.TWO);
// TODO: Add a SelectionModel
return treeGrid;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:29,代码来源:ProjectIndicatorManagementView.java
示例4: createTreeStore
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
/**
* Creates the store of the tree grid.
*
* @return The store of the tree grid.
*/
private TreeStore<IndicatorElement> createTreeStore() {
final TreeStore<IndicatorElement> store = new TreeStore<IndicatorElement>();
store.setKeyProvider(new ModelKeyProvider<IndicatorElement>() {
@Override
public String getKey(IndicatorElement model) {
final StringBuilder stringBuilder = new StringBuilder();
if (model instanceof IndicatorGroup) {
stringBuilder.append("group");
} else {
stringBuilder.append('i');
}
stringBuilder.append(model.get(IndicatorDTO.ID));
return stringBuilder.toString();
}
});
return store;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:28,代码来源:ProjectIndicatorManagementView.java
示例5: doLoad
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
private void doLoad() {
dispatch.execute(new GetIndicators(currentDatabaseId), new CommandResultHandler<IndicatorListResult>() {
@Override
protected void onCommandSuccess(IndicatorListResult result) {
final TreeStore<IndicatorElement> treeStore = view.getStore();
treeStore.removeAll();
for (IndicatorGroup group : result.getGroups()) {
treeStore.add(group, false);
for (IndicatorDTO indicator : group.getIndicators()) {
treeStore.add(group, indicator, false);
}
}
if (!result.getUngroupedIndicators().isEmpty()) {
treeStore.add((List) result.getUngroupedIndicators(), false);
}
view.refreshTreeGrid();
}
}, new LoadingMask(view.getTreeGrid()));
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:25,代码来源:ProjectIndicatorManagementPresenter.java
示例6: createGridPanel
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
private ContentPanel createGridPanel(String title, AbstractImagePrototype icon) {
final TreeStore<TreeGridFileModel> store = new TreeStore<TreeGridFileModel>();
final CheckBoxSelectionModel<TreeGridFileModel> selectionModel = createSelectionModel(store);
final TreeGrid<TreeGridFileModel> grid = new TreeGrid<TreeGridFileModel>(store, createColumnModel(selectionModel));
grid.setSelectionModel(selectionModel);
grid.addPlugin(selectionModel);
grid.getView().setForceFit(true);
final ToolBar bottomBar = new ToolBar();
bottomBar.add(new Status());
final ContentPanel panel = Panels.content(title);
panel.setIcon(icon);
panel.setHeight(200);
panel.add(grid);
panel.setBottomComponent(bottomBar);
return panel;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:22,代码来源:FileSelectionView.java
示例7: createSelectionModel
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
private CheckBoxSelectionModel<TreeGridFileModel> createSelectionModel(final TreeStore<TreeGridFileModel> store) {
final CheckBoxSelectionModel<TreeGridFileModel> selectionModel = new CheckBoxSelectionModel<TreeGridFileModel>();
selectionModel.addListener(Events.BeforeSelect, new Listener<SelectionEvent<TreeGridFileModel>>() {
@Override
public void handleEvent(SelectionEvent<TreeGridFileModel> be) {
final TreeGridFileModel model = be.getModel();
if(model.getChildren() != null) {
selectionModel.select(store.getChildren(model), true);
}
}
});
return selectionModel;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:17,代码来源:FileSelectionView.java
示例8: populateTree
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
public void populateTree(TreeStore<BaseModel> store, BaseModel parent, BaseModel child) {
if (parent == null) {
store.add(child, false);
} else {
store.add(parent, child, false);
}
BaseModel model = child.get("model");
for (String name : model.getPropertyNames()) {
Object value = model.get(name);
populateItem(store, child, name, value);
}
}
开发者ID:luox12,项目名称:onecmdb,代码行数:14,代码来源:GroupEditor.java
示例9: initUI
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
protected void initUI() {
setLayout(new FitLayout());
store = new TreeStore<ModelItem>();
Tree tree = new Tree();
TreeBinder<ModelItem> binder = new TreeBinder<ModelItem>(tree, store);
add(tree);
}
开发者ID:luox12,项目名称:onecmdb,代码行数:9,代码来源:QueryGraphTree.java
示例10: createTreeGrid
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
/**
* Creates the tree grid element using the given store and columns.
*
* @param store Tree store to use.
* @param columns List of columns.
* @return The tree grid element.
*/
private EditorTreeGrid<IndicatorElement> createTreeGrid(final TreeStore<IndicatorElement> store, final List<ColumnConfig> columns) {
return new EditorTreeGrid<IndicatorElement>(store, new ColumnModel(columns)) {
@Override
protected boolean hasChildren(IndicatorElement indicatorElement) {
return indicatorElement instanceof IndicatorGroup;
}
};
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:17,代码来源:ProjectIndicatorManagementView.java
示例11: PivotGridPanel
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
@Inject
public PivotGridPanel(EventBus eventBus, DispatchAsync dispatcher) {
this.eventBus = eventBus;
this.dispatcher = dispatcher;
setLayout(new FitLayout());
store = new TreeStore<PivotTableRow>();
PivotResources.INSTANCE.css().ensureInjected();
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:12,代码来源:PivotGridPanel.java
示例12: PartnerFieldSet
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
public PartnerFieldSet(SchemaDTO schema) {
setHeadingHtml(I18N.CONSTANTS.filterByPartner());
setLayout(new FitLayout() {
@Override
protected void setItemSize(Component item, Size size) {
// Leaves room for a FieldSet's header.
size.height = size.height - 30;
super.setItemSize(item, size);
}
});
setScrollMode(Style.Scroll.AUTO);
TreeStore<PartnerDTO> store = new TreeStore<PartnerDTO>();
store.add(schema.getVisiblePartnersList(), false);
TreePanel<PartnerDTO> tree = new TreePanel<PartnerDTO>(store);
tree.setCheckable(true);
tree.setIconProvider(new ModelIconProvider<PartnerDTO>() {
public AbstractImagePrototype getIcon(PartnerDTO model) {
return IconImageBundle.ICONS.group();
}
});
add(tree);
setHeight(250);
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:31,代码来源:PartnerFieldSet.java
示例13: deleteIndicatorGroup
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
private void deleteIndicatorGroup(IndicatorGroup selected) {
final TreeStore<IndicatorElement> treeStore = view.getStore();
List<IndicatorElement> children = treeStore.getChildren(selected);
treeStore.remove(selected);
treeStore.getRecord(selected).set("isDeleted", true);
// we don't delete the indicators, just move them out of the group
for (IndicatorElement child : children) {
treeStore.add(child, false);
treeStore.getRecord(child).set("groupId", null);
}
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:13,代码来源:ProjectIndicatorManagementPresenter.java
示例14: onDraftProjectDeleted
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
/**
* Method executed when a <b>draft</b> project is deleted.
*
* @param deletedDraftProject
* The deleted <b>draft</b> project.
*/
private void onDraftProjectDeleted(final ProjectDTO deletedDraftProject) {
final TreeStore<ProjectDTO> store = view.getStore();
store.clearFilters();
final Integer projectId = deletedDraftProject.getId();
// Inspect root elements.
final List<ProjectDTO> parents = store.getRootItems();
for (final ProjectDTO parent : parents) {
final List<ProjectDTO> childrens = parent.getChildrenProjects();
for (final ProjectDTO child : childrens) {
// Deletes children if equals to project.
if (child.getId().equals(projectId) || child.getId().equals(projectId)) {
store.remove(parent, child);
}
}
}
// Deletes the parent that corresponds to project.
if (store.findModel(ProjectDTO.ID, projectId) != null) {
// Deletes children links.
store.removeAll(store.findModel(ProjectDTO.ID, projectId));
store.remove(store.findModel(ProjectDTO.ID, projectId));
} else {
// Deletes children links.
store.removeAll(store.findModel(ProjectDTO.ID, projectId));
store.remove(store.findModel(ProjectDTO.ID, projectId));
}
store.applyFilters(null);
// Show notification.
N10N.infoNotif(I18N.CONSTANTS.deleteTestProjectHeader(), I18N.CONSTANTS.deleteTestProjectSucceededDetails());
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:45,代码来源:ProjectsListWidget.java
示例15: doAssignmentTree
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
private TreeGrid<ModelData> doAssignmentTree(){
ColumnConfig name = new ColumnConfig("name", "Name", 100);
name.setRenderer(new TreeGridCellRenderer<ModelData>());
ColumnConfig hours = new ColumnConfig("hours", "Hours", 80);
ColumnConfig inrate = new ColumnConfig("inrate", "Inrate", 80);
ColumnConfig exrate = new ColumnConfig("exrate", "Exrate", 80);
ColumnModel cm = new ColumnModel(Arrays.asList(name, hours, inrate,exrate));
store = new TreeStore<ModelData>();
tree = new TreeGrid<ModelData>(store, cm);
tree.setBorders(true);
tree.setAutoExpandColumn("name");
tree.setTrackMouseOver(false);
tree.setLoadMask(true);
tree.setWidth(630);
tree.setHeight(400);
tree.setBorders(true);
tree.getView().setEmptyText("no data");
tree.setId("myTreeid");
tree.getSelectionModel().addListener(Events.SelectionChange,
new Listener<SelectionChangedEvent<ModelData>>() {
public void handleEvent(SelectionChangedEvent<ModelData> be) {
}
});
return tree;
}
开发者ID:treblereel,项目名称:Opensheet,代码行数:33,代码来源:ExternalRatePanel.java
示例16: doTreeGrid
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
private TreeGrid<ModelData> doTreeGrid(){
assignmentStore = new TreeStore<ModelData>();
ColumnConfig name = new ColumnConfig("name",myConstants.name(), 150);
name.setFixed(true);
name.setRenderer(new TreeGridCellRenderer<ModelData>());
ColumnConfig index = new ColumnConfig("assignmentIndex",myConstants.index(), 150);
index.setFixed(true);
index.setSortable(false);
index.setFixed(true);
index.setMenuDisabled(true);
ColumnConfig owner = new ColumnConfig("owner",myConstants.owner(), 270);
ColumnModel cm = new ColumnModel(Arrays.asList(name, index, owner));
assignmentTreeGrid = new TreeGrid<ModelData>(assignmentStore, cm);
assignmentTreeGrid.setBorders(true);
assignmentTreeGrid.setAutoExpandColumn("name");
assignmentTreeGrid.setTrackMouseOver(false);
assignmentTreeGrid.setLoadMask(true);
assignmentTreeGrid.setWidth(600);
assignmentTreeGrid.setHeight(580);
assignmentTreeGrid.setBorders(true);
assignmentTreeGrid.getView().setEmptyText("no data");
assignmentTreeGrid.setId("myAssignmentTreeGridid");
assignmentTreeGrid.getSelectionModel().addListener(Events.SelectionChange,
new Listener<SelectionChangedEvent<ModelData>>() {
public void handleEvent(SelectionChangedEvent<ModelData> be) {
if (be.getSelection().size() > 0) {
} else {
}
}
});
return assignmentTreeGrid;
}
开发者ID:treblereel,项目名称:Opensheet,代码行数:40,代码来源:DepartmentReport.java
示例17: doUserTreeGrid
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
private TreeGrid<ModelData> doUserTreeGrid(){
userStore = new TreeStore<ModelData>();
ColumnConfig name = new ColumnConfig("name", "Name", 100);
name.setRenderer(new TreeGridCellRenderer<ModelData>());
name.setFixed(true);
ColumnConfig assignment = new ColumnConfig("assignment", "Assignment", 300);
assignment.setFixed(true);
assignment.setSortable(false);
assignment.setMenuDisabled(true);
ColumnConfig hour = new ColumnConfig("hour", "Hours", 50);
ColumnConfig inratesum = new ColumnConfig("inratesum", "Inratesum", 70);
ColumnConfig extratesum = new ColumnConfig("extratesum", "Extratesum", 70);
ColumnModel cm = new ColumnModel(Arrays.asList(name, assignment, hour,inratesum,extratesum));
userTreeGrid = new TreeGrid<ModelData>(userStore, cm);
userTreeGrid.setBorders(true);
userTreeGrid.setAutoExpandColumn("name");
userTreeGrid.setTrackMouseOver(false);
userTreeGrid.setLoadMask(true);
userTreeGrid.setWidth(700);
userTreeGrid.setHeight(500);
userTreeGrid.setBorders(true);
userTreeGrid.getView().setEmptyText("No users assigned");
userTreeGrid.setId("myUserTreeGridid");
return userTreeGrid;
}
开发者ID:treblereel,项目名称:Opensheet,代码行数:31,代码来源:UserDepartmentReportContentPanel.java
示例18: MyTreeTableBinder
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
public MyTreeTableBinder(TreeTable treeTable, TreeStore store) {
super(treeTable, store);
}
开发者ID:luox12,项目名称:onecmdb,代码行数:4,代码来源:MyTreeTableBinder.java
示例19: initUI
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
public void initUI() {
setLayout(new BorderLayout());
// ContentPanels
final ContentPanel center = new ContentPanel();
center.setLayout(new FitLayout());
ContentPanel west = new ContentPanel();
// Create a tree.
TreeStore<BaseModel> store = new TreeStore<BaseModel>();
Tree tree = new Tree();
TreeBinder binder = new TreeBinder(tree, store);
binder.setDisplayProperty("name");
tree.addListener(Events.SelectionChange, new Listener<TreeEvent>() {
public void handleEvent(TreeEvent te) {
TreeItem item = te.tree.getSelectedItem();
if (item != null) {
BaseModel model = (BaseModel) item.getModel();
Object obj = model.get("object");
if (obj != null) {
Widget edit = getEditor(obj);
center.removeAll();
center.add(edit);
center.layout();
}
}
}
});
west.add(tree);
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setMargins(new Margins(5, 0, 5, 0));
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 200);
westData.setSplit(true);
westData.setCollapsible(true);
westData.setMargins(new Margins(5));
add(west, westData);
add(center, centerData);
layout();
populateTree(store);
}
开发者ID:luox12,项目名称:onecmdb,代码行数:54,代码来源:GroupEditor.java
示例20: getStore
import com.extjs.gxt.ui.client.store.TreeStore; //导入依赖的package包/类
@Override
public TreeStore<IndicatorElement> getStore() {
return treeGrid.getTreeStore();
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:5,代码来源:ProjectIndicatorManagementView.java
注:本文中的com.extjs.gxt.ui.client.store.TreeStore类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论