final PackageConfigData pc = (PackageConfigData) node.getParentNode().getUserObject();
RulePackageSelector.currentlySelectedPackage = pc.name;
String key = key(fmts, pc);
if (!centertabbedPanel.showIfOpen(key)) {
final AssetItemGrid list = new AssetItemGrid(new EditItemEvent() {
public void open(String uuid) {
centertabbedPanel.openAsset(uuid);
}
public void open(MultiViewRow[] rows) {
centertabbedPanel.openAssets(rows);
}
}, AssetItemGrid.PACKAGEVIEW_LIST_TABLE_ID, new AssetItemGridDataLoader() {
public void loadData(int startRow, int numberOfRows, GenericCallback<TableDataResult> cb) {
RepositoryServiceFactory.getService().listAssets(pc.uuid, fmts, startRow, numberOfRows,
AssetItemGrid.PACKAGEVIEW_LIST_TABLE_ID, cb);
}
}, GWT.getModuleBaseURL() + "feed/package?name=" + pc.name + "&viewUrl="
+ CategoriesPanel.getSelfURL() + "&status=*");
tabPanel.addTab(uo[1] + " [" + pc.name + "]", true, list, key);
final ServerPushNotification sub = new ServerPushNotification() {
public void messageReceived(PushResponse response) {
if (response.messageType.equals("packageChange") && response.message.equals(pc.name)) {
list.refreshGrid();
}
}
};
PushClient.instance().subscribe(sub);
list.addUnloadListener(new Command() {
public void execute() {
PushClient.instance().unsubscribe(sub);
}
});
}