use of org.activityinfo.ui.client.page.common.nav.Link in project activityinfo by bedatadriven.
the class TargetIndicatorView method createGridAndAddToContainer.
@Override
protected Grid<ModelData> createGridAndAddToContainer(Store store) {
final TreeStore treeStore = (TreeStore) store;
tree = new EditorTreeGrid<ModelData>(treeStore, createColumnModel());
tree.setAutoExpandColumn("name");
tree.setSelectionModel(new ImprovedCellTreeGridSelectionModel<ModelData>());
tree.setClicksToEdit(EditorGrid.ClicksToEdit.ONE);
tree.setLoadMask(true);
tree.setStateId("TargetValueGrid" + db.getId());
tree.setStateful(true);
tree.setIconProvider(new ModelIconProvider<ModelData>() {
@Override
public AbstractImagePrototype getIcon(ModelData model) {
if (model instanceof IsActivityDTO) {
return IconImageBundle.ICONS.activity();
} else if (model instanceof TargetValueDTO) {
return IconImageBundle.ICONS.indicator();
} else if (model instanceof Link) {
return IconImageBundle.ICONS.folder();
} else {
return null;
}
}
});
addBeforeEditListener();
addAfterEditListener();
add(tree, new BorderLayoutData(Style.LayoutRegion.CENTER));
return tree;
}
use of org.activityinfo.ui.client.page.common.nav.Link in project activityinfo by bedatadriven.
the class ConfigNavigator method loadDbList.
private void loadDbList(final AsyncCallback<List<Link>> callback, SchemaDTO result) {
List<Link> list = Lists.newArrayList();
for (UserDatabaseDTO db : result.getDatabases()) {
Link link = Link.to(new DbPageState(DbConfigPresenter.PAGE_ID, db.getId())).labeled(db.getName()).withIcon(icons.database()).build();
link.set("db", db);
list.add(link);
}
callback.onSuccess(list);
}
use of org.activityinfo.ui.client.page.common.nav.Link in project activityinfo by bedatadriven.
the class ConfigNavigator method load.
@Override
public void load(DataReader<List<Link>> dataReader, Object parent, AsyncCallback<List<Link>> callback) {
if (parent == null) {
Link dbListLink = Link.to(new DbListPageState()).labeled(messages.databases()).withIcon(icons.database()).build();
Link dbLinksLink = Link.to(new IndicatorLinkPlace()).labeled(messages.linkIndicators()).withIcon(icons.link()).build();
callback.onSuccess(Arrays.asList(dbListLink, dbLinksLink));
} else {
Link link = (Link) parent;
if (link.getPageState() instanceof DbListPageState) {
loadDbListAsync(callback);
}
}
}
Aggregations