Search in sources :

Example 1 with Link

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;
}
Also used : AbstractImagePrototype(com.google.gwt.user.client.ui.AbstractImagePrototype) ModelData(com.extjs.gxt.ui.client.data.ModelData) TreeStore(com.extjs.gxt.ui.client.store.TreeStore) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) Link(org.activityinfo.ui.client.page.common.nav.Link)

Example 2 with Link

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);
}
Also used : UserDatabaseDTO(org.activityinfo.legacy.shared.model.UserDatabaseDTO) Link(org.activityinfo.ui.client.page.common.nav.Link)

Example 3 with Link

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);
        }
    }
}
Also used : Link(org.activityinfo.ui.client.page.common.nav.Link) IndicatorLinkPlace(org.activityinfo.ui.client.page.config.link.IndicatorLinkPlace)

Aggregations

Link (org.activityinfo.ui.client.page.common.nav.Link)3 ModelData (com.extjs.gxt.ui.client.data.ModelData)1 TreeStore (com.extjs.gxt.ui.client.store.TreeStore)1 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)1 AbstractImagePrototype (com.google.gwt.user.client.ui.AbstractImagePrototype)1 UserDatabaseDTO (org.activityinfo.legacy.shared.model.UserDatabaseDTO)1 IndicatorLinkPlace (org.activityinfo.ui.client.page.config.link.IndicatorLinkPlace)1