*/
public void openCategory(String title,
String widgetID) {
if ( !explorerViewCenterPanel.showIfOpen( widgetID ) ) {
final String categoryName = widgetID.substring( widgetID.indexOf( "-" ) + 1 );
final AssetItemGrid grid = new AssetItemGrid( createEditEvent(),
AssetItemGrid.RULE_LIST_TABLE_ID,
new AssetItemGridDataLoader() {
public void loadData(int skip,
int numberOfRows,
GenericCallback<TableDataResult> cb) {
RepositoryServiceFactory.getService().loadRuleListForCategories( categoryName,
skip,
numberOfRows,
AssetItemGrid.RULE_LIST_TABLE_ID,
cb );
}
},
GWT.getModuleBaseURL() + "feed/category?name=" + categoryName + "&viewUrl=" + Util.getSelfURL() );
final ServerPushNotification push = new ServerPushNotification() {
public void messageReceived(PushResponse response) {
if ( response.messageType.equals( "categoryChange" ) && response.message.equals( categoryName ) ) {
grid.refreshGrid();
}
}
};
PushClient.instance().subscribe( push );
grid.addUnloadListener( new Command() {
public void execute() {
PushClient.instance().unsubscribe( push );
}
} );