com.smartgwt.client.widgets.grid.events.DataArrivedHandler Java Examples

The following examples show how to use com.smartgwt.client.widgets.grid.events.DataArrivedHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ShareFileTree.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ShareFileTree(boolean export) {
	super();

	setBodyStyleName("normal");
	setShowHeader(false);
	setLeaveScrollbarGap(false);
	setCanReorderRecords(false);
	setCanDragRecordsOut(false);
	setAutoFetchData(true);
	setLoadDataOnDemand(true);
	setDataSource(new ShareFileDS(export));
	setCanSelectAll(false);
	setShowConnectors(true);
	setCanAcceptDrop(false);
	setCanAcceptDroppedRecords(false);
	setShowRoot(false);

	if (export)
		setSelectionType(SelectionStyle.SINGLE);
	else {
		setSelectionType(SelectionStyle.MULTIPLE);
		setSelectionAppearance(SelectionAppearance.CHECKBOX);
	}

	addDataArrivedHandler(new DataArrivedHandler() {
		@Override
		public void onDataArrived(DataArrivedEvent event) {
			TreeNode node = getTree().getChildren(getTree().getRoot())[0];
			getTree().openFolder(node);
		}
	});

}
 
Example #2
Source File: ZohoTree.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ZohoTree(boolean export) {
	super();

	setBodyStyleName("normal");
	setShowHeader(false);
	setLeaveScrollbarGap(false);
	setCanReorderRecords(false);
	setCanDragRecordsOut(false);
	setAutoFetchData(true);
	setLoadDataOnDemand(true);
	setDataSource(new ZohoDS(null, export));
	setCanSelectAll(false);
	setShowConnectors(true);
	setCanAcceptDrop(false);
	setCanAcceptDroppedRecords(false);
	setShowRoot(false);

	if (export)
		setSelectionType(SelectionStyle.SINGLE);
	else {
		setSelectionType(SelectionStyle.MULTIPLE);
		setSelectionAppearance(SelectionAppearance.CHECKBOX);
	}

	addDataArrivedHandler(new DataArrivedHandler() {
		@Override
		public void onDataArrived(DataArrivedEvent event) {
			TreeNode node = getTree().getChildren(getTree().getRoot())[0];
			getTree().openFolder(node);
		}
	});

}
 
Example #3
Source File: DocumentsTileGrid.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void registerDataArrivedHandler(final DataArrivedHandler handler) {
	addDataArrivedHandler(new com.smartgwt.client.widgets.tile.events.DataArrivedHandler() {

		@Override
		public void onDataArrived(DataArrivedEvent event) {
			handler.onDataArrived(null);
		}
	});
}
 
Example #4
Source File: DropboxTree.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public DropboxTree(boolean export) {
	super();

	setBodyStyleName("normal");
	setShowHeader(false);
	setLeaveScrollbarGap(false);
	setCanReorderRecords(false);
	setCanDragRecordsOut(false);
	setAutoFetchData(true);
	setLoadDataOnDemand(true);
	setDataSource(new DropboxDS(null, export));
	setCanSelectAll(false);
	setShowConnectors(true);
	setCanAcceptDrop(false);
	setCanAcceptDroppedRecords(false);
	setShowRoot(false);

	if (export)
		setSelectionType(SelectionStyle.SINGLE);
	else {
		setSelectionType(SelectionStyle.MULTIPLE);
		setSelectionAppearance(SelectionAppearance.CHECKBOX);
	}

	addDataArrivedHandler(new DataArrivedHandler() {
		@Override
		public void onDataArrived(DataArrivedEvent event) {
			TreeNode node = getTree().getChildren(getTree().getRoot())[0];
			getTree().openFolder(node);
		}
	});

}
 
Example #5
Source File: CatalogBrowser.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createAdvancedOptions() {
        formCatalog = createCatalogForm();

        lgResult = new ListGrid();
        lgResult.setDataSource(BibliographyQueryDataSource.getInstance());
//        lgResult.setUseAllDataSourceFields(true);
        ListGridField preview = new ListGridField(BibliographyQueryDataSource.FIELD_PREVIEW,
                i18n.CatalogBrowser_HeaderPreview_Title());
        ListGridField title = new ListGridField(BibliographyQueryDataSource.FIELD_TITLE,
                i18n.CatalogBrowser_HeaderTitle_Title());
        lgResult.setDetailField(BibliographyQueryDataSource.FIELD_PREVIEW);
        lgResult.setFields(title, preview);
//        lgResult.setAutoFetchData(true);
        lgResult.setHeight100();
        lgResult.setWidth100();
        lgResult.setCanExpandRecords(true);
        lgResult.setCanExpandMultipleRecords(false);
        lgResult.setExpansionMode(ExpansionMode.DETAIL_FIELD);
        lgResult.setSelectionType(SelectionStyle.SINGLE);
//        lgResult.setSelectionAppearance(SelectionAppearance.CHECKBOX);
        lgResult.setAlternateRecordStyles(true);
        lgResult.addDataArrivedHandler(new DataArrivedHandler() {

            @Override
            public void onDataArrived(DataArrivedEvent event) {
                if (event.getStartRow() == 0 && event.getEndRow() > 0) {
                    lgResult.focus();
                    lgResult.selectSingleRecord(0);
                }
            }
        });

        VLayout layout = new VLayout();
        layout.setMembers(formCatalog, lgResult);
        layout.setMargin(4);
        layout.setMembersMargin(4);
        layout.setOverflow(Overflow.AUTO);
        return layout;
    }
 
Example #6
Source File: SelectionMenuModel.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void initData() {
    listGrid.addDataArrivedHandler(new DataArrivedHandler() {
        @Override
        public void onDataArrived(DataArrivedEvent event) {
            listGrid.expandRecord(listGrid.getRecord(0));
            listGrid.selectRecord(0);
        }
    });
    loadDataIntoListGrid();
}
 
Example #7
Source File: DocumentsListGrid.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void registerDataArrivedHandler(DataArrivedHandler handler) {
	addDataArrivedHandler(handler);
}
 
Example #8
Source File: DocumentsGrid.java    From document-management-software with GNU Lesser General Public License v3.0 votes vote down vote up
public void registerDataArrivedHandler(DataArrivedHandler handler);