package com.vci.client.framework.appConfig; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.util.LinkedHashMap; import java.util.LinkedList; import javax.swing.JScrollPane; import javax.swing.border.TitledBorder; import com.vci.client.framework.appConfig.object.AppConfigCategoryObject; import com.vci.client.ui.locale.LocaleDisplay; import com.vci.client.ui.swing.VCISwingUtil; import com.vci.client.ui.swing.components.VCIJButton; import com.vci.client.ui.swing.components.VCIJPanel; import com.vci.client.ui.swing.components.table.VCIJTablePanel; public class AppConfigCategoryPanel extends VCIJPanel{ /** * */ private static final long serialVersionUID = 8718243318609088441L; private AppConfigModulePanel ownerPanel = null; private VCIJTablePanel tablePanel = null; private AppConfigCategoryDataProvider dataProvider = null; private VCIJButton addButton = null; private VCIJButton editButton = null; private VCIJButton deleteButton = null; private LinkedList selfCustomButtons = new LinkedList(); private JScrollPane jsp = new JScrollPane(); public AppConfigCategoryPanel(AppConfigModulePanel ownerPanel) { this.ownerPanel = ownerPanel; init(); } private void init(){ this.setLayout(new BorderLayout()); this.setBorder(new TitledBorder("配置项分类管理")); initSelfButton(); VCIJPanel mainPannel = initMainPanl(); jsp.getViewport().add(mainPannel); this.add(jsp, BorderLayout.CENTER); } private void initSelfButton() { AppConfigCategoryPanelActionListener listener = new AppConfigCategoryPanelActionListener(this); addButton = VCISwingUtil.createVCIJButton("create", LocaleDisplay.getI18nString("rmip.framework.systemFunctionTree.modelManagment.addButton", "RMIPFramework", getLocale()), LocaleDisplay.getI18nString( "rmip.framework.systemFunctionTree.modelManagment.addButton", "RMIPFramework", getLocale()), "create.gif", listener); editButton = VCISwingUtil.createVCIJButton("edit", LocaleDisplay.getI18nString("rmip.framework.systemFunctionTree.modelManagment.modifyButton", "RMIPFramework", getLocale()), LocaleDisplay.getI18nString( "rmip.framework.systemFunctionTree.modelManagment.modifyButton", "RMIPFramework", getLocale()), "modify.gif", listener); deleteButton = VCISwingUtil.createVCIJButton("delete", LocaleDisplay.getI18nString("rmip.framework.systemFunctionTree.modelManagment.deleteButton", "RMIPFramework", getLocale()), LocaleDisplay.getI18nString( "rmip.framework.systemFunctionTree.modelManagment.deleteButton", "RMIPFramework", getLocale()), "delete.gif", listener); selfCustomButtons.add(addButton); selfCustomButtons.add(editButton); selfCustomButtons.add(deleteButton); } public VCIJPanel initMainPanl() { dataProvider = new AppConfigCategoryDataProvider(this); tablePanel = new VCIJTablePanel(dataProvider); int startIndex = dataProvider.getDataColumnStartIndex(); LinkedHashMap widthMaps = new LinkedHashMap(); widthMaps.put(startIndex++, 400); widthMaps.put(startIndex++, 400); tablePanel.setShowProgressBar(false); tablePanel.setColumnWidthMaps(widthMaps); tablePanel.setShowPaging(false); tablePanel.setCustomButtons(selfCustomButtons); tablePanel.setCustomButtonFlowAlign(FlowLayout.CENTER); tablePanel.setPageButtonFlowAlign(FlowLayout.CENTER); tablePanel.buildTablePanel(); tablePanel.refreshTableData(); return tablePanel; } public VCIJTablePanel getTablePanel() { return tablePanel; } public AppConfigModulePanel getOwnerPanel() { return this.ownerPanel; } }