package com.vci.client.framework.appConfig;
|
|
import java.util.Locale;
|
|
import com.vci.client.LogonApplication;
|
import com.vci.client.framework.appConfig.object.AppConfigCategoryObject;
|
import com.vci.client.framework.delegate.AppConfigCategoryClientDelegate;
|
import com.vci.client.ui.exception.VCIException;
|
import com.vci.client.ui.locale.LocaleDisplay;
|
import com.vci.client.ui.swing.VCIOptionPane;
|
import com.vci.client.ui.swing.components.table.AbstractVCIJTableDataProvider;
|
import com.vci.client.ui.swing.components.table.VCIJTableNode;
|
|
public class AppConfigCategoryDataProvider extends AbstractVCIJTableDataProvider<AppConfigCategoryObject> {
|
|
private AppConfigCategoryPanel ownerPanel = null;
|
public AppConfigCategoryDataProvider(AppConfigCategoryPanel ownerPanel){
|
this.ownerPanel = ownerPanel;
|
}
|
|
@Override
|
public String[] getSpecialColumns() {
|
return "名称,描述".split(",");
|
}
|
|
@Override
|
public int getTotal() {
|
return total;
|
}
|
|
@Override
|
public VCIJTableNode<AppConfigCategoryObject> getNewRowNode(
|
AppConfigCategoryObject dataObj) {
|
VCIJTableNode<AppConfigCategoryObject> node = new VCIJTableNode<AppConfigCategoryObject>(
|
dataObj);
|
node.setPropertyValue(getSpecialColumns()[0], dataObj.getName());
|
node.setPropertyValue(getSpecialColumns()[1], dataObj.getDesc());
|
return node;
|
}
|
|
@Override
|
public AppConfigCategoryObject[] getDatas(int pageIndex, int pageSize) {
|
AppConfigCategoryObject[] objects = null;
|
try {
|
AppConfigCategoryClientDelegate delegate = new AppConfigCategoryClientDelegate(LogonApplication.getUserEntityObject());
|
objects = delegate.getAppConfigCategorys();
|
this.total = objects.length;
|
} catch (VCIException e) {
|
VCIOptionPane.showError(LogonApplication.frame, LocaleDisplay.getI18nString(e, "RMIPFramework", Locale.getDefault()));
|
}
|
return objects;
|
}
|
|
}
|