From 9b6b60729d8178399396e2670c0e7914a9746b59 Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期一, 29 四月 2024 17:22:41 +0800
Subject: [PATCH] 文件上传以及接口权限修改
---
Source/Client/PLTClient/src/com/vci/client/framework/rightdistribution/roleRight/BSTypeRoleRightPanel2.java | 616 ++++++++++++++++++++++++++-----------------------------
1 files changed, 287 insertions(+), 329 deletions(-)
diff --git a/Source/Client/PLTClient/src/com/vci/client/framework/rightdistribution/roleRight/BSTypeRoleRightPanel2.java b/Source/Client/PLTClient/src/com/vci/client/framework/rightdistribution/roleRight/BSTypeRoleRightPanel2.java
index 26f0216..e469e27 100644
--- a/Source/Client/PLTClient/src/com/vci/client/framework/rightdistribution/roleRight/BSTypeRoleRightPanel2.java
+++ b/Source/Client/PLTClient/src/com/vci/client/framework/rightdistribution/roleRight/BSTypeRoleRightPanel2.java
@@ -58,7 +58,7 @@
import com.vci.client.portal.utility.UIDataFetcher;
import com.vci.client.portal.utility.UITools;
import com.vci.client.ui.exception.VCIException;
-import com.vci.client.ui.image.bundle.BundleImage;
+import com.vci.client.ui.image.BundleImage;
import com.vci.client.ui.locale.LocaleDisplay;
import com.vci.client.ui.process.QANProcessBar;
import com.vci.client.ui.process.QANProcessBarFrame;
@@ -142,7 +142,7 @@
JPanel buttonPanel = new JPanel();
JPanel midPanel = new JPanel();
palMain.setLayout(new BorderLayout());
- roleList("");
+ initRoleList("");
contentItem(contentPanel);
jButtonPanl(buttonPanel);
initTreeNode();
@@ -235,7 +235,10 @@
BizTypeEx btEx = (BizTypeEx)comboType.getSelectedItem();
if (btEx == null || btEx.getBizType() == null)
+ {
+ initUIContextTree(null, null);
return;
+ }
BtmItem bt = btEx.getBizType();
@@ -255,11 +258,102 @@
private void UIContextSelectChanged(ItemEvent e) {
- // TODO Auto-generated method stub
+ BtmItem bt = null;
+ PLUILayout uiContext = null;
+ BizTypeEx btEx = (BizTypeEx)comboType.getSelectedItem();
+ if (btEx != null)
+ bt = btEx.getBizType();
+
+ UILayoutEx uiEx = (UILayoutEx)comboUIContext.getSelectedItem();
+ if (uiEx != null)
+ uiContext = uiEx.getUIContext();
+
+ initUIContextTree(bt, uiContext);
+ }
+
+ private String getNodeText(Object obj) {
+ String text = "";
+
+ if (obj == null)
+ return null;
+
+ if (obj instanceof BtmItem) {
+ BtmItem bt = (BtmItem)obj;
+ return bt.name+" ["+ bt.label+"]";
+ } else if (obj instanceof PLUILayout) {
+ PLUILayout ui = (PLUILayout)obj;
+ return ui.plCode+" ["+ui.plName+"]";
+ } else if (obj instanceof PLTabPage) {
+ PLTabPage tab = (PLTabPage)obj;
+ return tab.plName;
+ } else if (obj instanceof PLPageDefination) {
+ PLPageDefination page = (PLPageDefination)obj;
+ return page.name;
+ } else if (obj instanceof PLTabButton) {
+ PLTabButton btn = (PLTabButton)obj;
+ return btn.plLabel;
+ }
+ return text;
+ }
+
+ private void initUIContextTree(BtmItem bt, PLUILayout uiContext) {
+
+ treeManager.getSelectionModel().removeSelectionPath(new TreePath(rootNode.getPath()));
+ //鍏堟竻闄ゆ墍鏈夊睍寮�鐨勮妭鐐�
+ rootNode.removeAllChildren();
+ treeModel.reload();
+// for(int i=rootNode.getChildCount(); i>0; i--){
+// VCIBaseTreeNode childNode = (VCIBaseTreeNode)rootNode.getChildAt(i-1);
+// treeModel.removeNodeFromParent(childNode);
+// }
+ funMap.clear();
+
+ //rootNode.setExpand(true);
+
+ if(bt != null) {
+ if (uiContext != null) {
+ Map<String, VCIBaseTreeNode> showNodes = new HashMap<String, VCIBaseTreeNode>();
+ VCIBaseTreeNode typeNode = showNodes.get(bt.name);
+ if(typeNode == null){
+ //娣诲姞绫诲瀷鑺傜偣
+ typeNode = new VCIBaseTreeNode(getNodeText(bt), bt);//bt.name+" ["+ bt.label+"]", bt);
+ treeModel.insertNodeInto(typeNode, rootNode,rootNode.getChildCount());
+ //typeNode.setExpand(true);
+ funMap.put(bt.name, bt.name);
+ showNodes.put(bt.name, typeNode);
+ }
+ //娣诲姞涓婁笅鏂囪妭鐐瑰強瀛愯妭鐐�
+ VCIBaseTreeNode curNode = new VCIBaseTreeNode(getNodeText(uiContext), uiContext);//uiContext.plName+" ["+uiContext.plCode+"]", uiContext);
+ //curNode.setExpand(true);
+ treeModel.insertNodeInto(curNode, typeNode,typeNode.getChildCount());
+ funMap.put(uiContext.plOId, uiContext.plCode);
+ setChildNode(curNode, uiContext);
+ } else {
+ VCIBaseTreeNode typeNode = new VCIBaseTreeNode(getNodeText(bt), bt);//bt.label+" ["+ bt.name+"]", bt);
+ treeModel.insertNodeInto(typeNode, rootNode,rootNode.getChildCount());
+ //typeNode.setExpand(true);
+ funMap.put(bt.name, bt.name);
+ setChildNode(typeNode, bt, uiDataFechter);
+ }
+ }else{
+ BtmItem[] btmItems = BtmProvider.getInstance().getAllBtmItems();
+ for (int i = 0; i < btmItems.length; i++) {
+ VCIBaseTreeNode typeNode = new VCIBaseTreeNode(getNodeText(btmItems[i]), btmItems[i]);//btmItems[i].label+"("+ btmItems[i].name+")", btmItems[i]);
+ treeModel.insertNodeInto(typeNode, rootNode,rootNode.getChildCount());
+ //typeNode.setExpand(true);
+ funMap.put(btmItems[i].name, btmItems[i].name);
+ setChildNode(typeNode, bt, uiDataFechter);
+ }
+ }
+
+ tree.scrollPathToVisible(new TreePath(rootNode.getPath()));
+ //tree.expandAllTreeNode(new TreePath(rootNode.getPath()), true);
+ if (curRole != null)
+ initRoleRight(curRole.getId());
}
- public void roleList(String searchText) {
+ public void initRoleList(String searchText) {
setRoleList(searchText);
roleList.setCellRenderer(new ListLabelCellRender());
roleList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
@@ -276,72 +370,22 @@
leftPanel.getViewport().add(roleList);
}
+
+
Map<String,RoleRightObject> allRightRoleMap = new HashMap<String,RoleRightObject>();
public void initRoleRight(String roleId){
- try{
- //鍏堟竻闄ゆ墍鏈夊睍寮�鐨勮妭鐐�
- /*for(int i=rootNode.getChildCount(); i>0; i--){
- VCIBaseTreeNode childNode = (VCIBaseTreeNode)rootNode.getChildAt(i-1);
- for(int j=childNode.getChildCount();j>0;j--){
- VCIBaseTreeNode cchildNode = (VCIBaseTreeNode)childNode.getChildAt(j-1);
- treeModel.removeNodeFromParent(cchildNode);
- }
- }*/
- initTreeNode();
- //allRightRoleMap = new HashMap<String,RoleRightObject>();
- funMap.clear();
- //寮�濮嬪睍绀烘垜鐨勬潈闄愬唴瀹�
- long s = System.currentTimeMillis();
+ try {
+ allRightRoleMap = new HashMap<String,RoleRightObject>();
RoleRightObject[] roleRightObjs = new RoleRightClientDelegate().getRoleRightList(roleId, LogonApplication.getUserEntityObject().getUserName());
-
- long t = System.currentTimeMillis();
- System.out.println("1: " + (t - s));
- s = System.currentTimeMillis();
- BtmItem[] btmItems = BtmProvider.getInstance().getAllBtmItems();
- t = System.currentTimeMillis();
- System.out.println("2: " + (t - s));
-
- s = System.currentTimeMillis();
- Map<String,Long> rightMap = new HashMap<String,Long>();
- for(RoleRightObject obj:roleRightObjs){
- allRightRoleMap.put(obj.getFuncId(), obj);
- rightMap.put(obj.getFuncId(), obj.getRightValue());
- }
- t = System.currentTimeMillis();
- System.out.println("3: " + (t - s));
-
- //娣诲姞type鑺傜偣
- UIDataFetcher uiDataFechter = new UIDataFetcher();
- s = System.currentTimeMillis();
- int ii=0;
- for(BtmItem btmItem: btmItems){
-
- if(rightMap.containsKey(btmItem.name))
- {
- //VCIBaseTreeNode node = new VCIBaseTreeNode(btmItem.label+"("+ btmItem.name+")", btmItem);
- VCIBaseTreeNode node = (VCIBaseTreeNode)rootNode.getChildAt(ii);
- //node.setExpand(true);
- funMap.put(btmItem.name, btmItem.name);
- // treeModel.insertNodeInto(node, rootNode,rootNode.getChildCount());
- // setChildNode(node, btmItem, rightMap);
- setChildNode(node, btmItem, uiDataFechter);
- }
- ii++;
- }
- t = System.currentTimeMillis();
- System.out.println("4: " + (t - s));
-
- s = System.currentTimeMillis();
visitAllTreeNode(rootNode, roleRightObjs);
- //treeManager.getSelectionModel().addSelectionPath(new TreePath(rootNode.getPath()));
- t = System.currentTimeMillis();
- System.out.println("5: " + (t - s));
} catch (VCIException e) {
e.printStackTrace();
VCIOptionPane.showError(LogonApplication.frame, LocaleDisplay.getI18nString(e,"RMIPFramework", getLocale()));
}
}
+
+
private void setChildNode(VCIBaseTreeNode node ,Object funcObj, UIDataFetcher uiDataFechter) {
if (funcObj instanceof BtmItem) {
BtmItem btmItem = (BtmItem) funcObj;
@@ -350,7 +394,7 @@
return;
}
for(PLUILayout context : contexts){
- VCIBaseTreeNode curNode = new VCIBaseTreeNode(context.plName+"("+context.plCode+")", context);
+ VCIBaseTreeNode curNode = new VCIBaseTreeNode(getNodeText(context), context);// context.plName+"("+context.plCode+")", context);
treeModel.insertNodeInto(curNode, node,node.getChildCount());
funMap.put(context.plOId, context.plCode);
setChildNode(curNode, context, uiDataFechter);
@@ -362,7 +406,7 @@
return;
}
for(PLTabPage tab : tabs){
- VCIBaseTreeNode curNode = new VCIBaseTreeNode(tab.plName, tab);
+ VCIBaseTreeNode curNode = new VCIBaseTreeNode(getNodeText(tab), tab);//tab.plName, tab);
treeModel.insertNodeInto(curNode, node,node.getChildCount());
funMap.put(tab.plOId, tab.plName);
setChildNode(curNode, tab, uiDataFechter);
@@ -374,7 +418,7 @@
return;
}
for (PLPageDefination pageDefination : pageDefinations) {
- VCIBaseTreeNode curNode = new VCIBaseTreeNode(pageDefination.name, pageDefination);
+ VCIBaseTreeNode curNode = new VCIBaseTreeNode(getNodeText(pageDefination), pageDefination);//pageDefination.name, pageDefination);
treeModel.insertNodeInto(curNode, node,node.getChildCount());
funMap.put(pageDefination.plOId, pageDefination.name);
setChildNode(curNode, pageDefination, uiDataFechter);
@@ -389,7 +433,7 @@
if(!button.show.equals("0")){
continue;
}
- VCIBaseTreeNode curNode = new VCIBaseTreeNode(button.plLabel, button);
+ VCIBaseTreeNode curNode = new VCIBaseTreeNode(getNodeText(button), button);//button.plLabel, button);
treeModel.insertNodeInto(curNode, node,node.getChildCount());
funMap.put(button.plTableOId, button.plLabel);
setChildNode(curNode, button, uiDataFechter);
@@ -563,13 +607,13 @@
}
});
- reAddButton.setText(LocaleDisplay.getI18nString("rmip.framework.rightdistribution.moduleRight.reAddButton.file","RMIPFramework", getLocale()));
- reAddButton.setIcon(new BundleImage().createImageIcon("create.gif"));
- reAddButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- reAdd_actionPerform();
- }
- });
+// reAddButton.setText(LocaleDisplay.getI18nString("rmip.framework.rightdistribution.moduleRight.reAddButton.file","RMIPFramework", getLocale()));
+// reAddButton.setIcon(new BundleImage().createImageIcon("create.gif"));
+// reAddButton.addActionListener(new ActionListener() {
+// public void actionPerformed(ActionEvent e) {
+// reAdd_actionPerform();
+// }
+// });
delButton.setText(LocaleDisplay.getI18nString("rmip.framework.rightdistribution.moduleRight.delButton.file","RMIPFramework", getLocale()));
@@ -581,21 +625,21 @@
}
});
- removeButton.setText(LocaleDisplay.getI18nString("rmip.framework.rightdistribution.moduleRight.removeButton.file","RMIPFramework", getLocale()));
- removeButton.setIcon(new BundleImage().createImageIcon("remove.gif"));
- removeButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- remove_actionPerform();
- }
- });
+// removeButton.setText(LocaleDisplay.getI18nString("rmip.framework.rightdistribution.moduleRight.removeButton.file","RMIPFramework", getLocale()));
+// removeButton.setIcon(new BundleImage().createImageIcon("remove.gif"));
+// removeButton.addActionListener(new ActionListener() {
+// public void actionPerformed(ActionEvent e) {
+// remove_actionPerform();
+// }
+// });
- clearButton.setText(LocaleDisplay.getI18nString("rmip.framework.rightdistribution.moduleRight.clearButton.file","RMIPFramework", getLocale()));
- clearButton.setIcon(new BundleImage().createImageIcon("clear.gif"));
- clearButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- clear_actionPerform();
- }
- });
+// clearButton.setText(LocaleDisplay.getI18nString("rmip.framework.rightdistribution.moduleRight.clearButton.file","RMIPFramework", getLocale()));
+// clearButton.setIcon(new BundleImage().createImageIcon("clear.gif"));
+// clearButton.addActionListener(new ActionListener() {
+// public void actionPerformed(ActionEvent e) {
+// clear_actionPerform();
+// }
+// });
sBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -675,100 +719,100 @@
// p.add(contextText);
// p.add(sBtn);
p.add(addButton);
- p.add(reAddButton);
+// p.add(reAddButton);
p.add(delButton);
- p.add(removeButton);
- p.add(clearButton);
+// p.add(removeButton);
+// p.add(clearButton);
}
- private void remove_actionPerform(){
- if (!checkItem()) {
- return;
- }
- final QANProcessBarFrame frame = new QANProcessBarFrame();
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- if (treePath == null || treePath.length == 0) {
- VCIOptionPane.showMessage(LogonApplication.frame, "璇烽�夋嫨瑕佸垹闄ょ殑鏉冮檺");
- return ;
- }
- QANProcessBar bar = null;
- Thread t = new Thread(){
- public void run() {
- frame.setContent("姝e湪鎺堟潈,璇风◢绛�......");
- try {
- rightMap.clear();
- boolean refresh = true;
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- //褰撴病鏈夐�変腑妯″潡鐨勬椂鍊�
- if (treePath == null && treePath.length == 0){
- refresh = false;
- }else{
- RoleRightObject[] roleRightObjs = getRemoveedSelectedRoleRightObjs(treePath);
- boolean res = new RoleRightClientDelegate(LogonApplication.getUserEntityObject()).removeRoleRight(roleRightObjs,curRole.getId(),currentUserName);
- frame.setProcessBarCancel(true);
- if(res){
- VCIOptionPane.showMessage(LogonApplication.frame, "绉婚櫎UI鎿嶄綔鏉冮檺鎴愬姛锛�");
- }
- }
- if(refresh){
- treeManager.getSelectionModel().clearSelection();
- initRoleRight(curRole.getId());
- }
- } catch (VCIException e1) {
- e1.printStackTrace();
- VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e1);
- } finally {
- frame.setProcessBarCancel(true);
- }
- }
- };
- bar = new QANProcessBar(t, frame, frame,"UI鎿嶄綔鎺堟潈",false);
- bar.setVisible(true);
- }
-
- private void clear_actionPerform(){
- if (!checkItem()) {
- return;
- }
- final QANProcessBarFrame frame = new QANProcessBarFrame();
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- if (treePath == null || treePath.length == 0) {
- int result = VCIOptionPane.showConfirmDialog(LogonApplication.frame, this, "鎮ㄧ‘瀹氳娓呴櫎鎵�鏈夌殑UI鎿嶄綔鏉冮檺鍚楋紵", "娉ㄦ剰锛屾偍纭畾瑕佹竻闄ゆ墍鏈夌殑UI鏉冮檺鍚�?", VCIOptionPane.YES_NO_OPTION, VCIOptionPane.WARNING_MESSAGE);
- if(result != VCIOptionPane.YES_OPTION){
- return;
- }
- }
- QANProcessBar bar = null;
- Thread t = new Thread(){
- public void run() {
- frame.setContent("姝e湪娓呴櫎鎺堟潈,璇风◢绛�......");
- try {
- rightMap.clear();
- boolean refresh = true;
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- //褰撴病鏈夐�変腑妯″潡鐨勬椂鍊�
- RoleRightObject[] roleRightObjs = new RoleRightObject[0];
- boolean res = new RoleRightClientDelegate(LogonApplication.getUserEntityObject()).clearRight(curRole.getId(),currentUserName, RightType.UI);
- frame.setProcessBarCancel(true);
- if(res){
- VCIOptionPane.showMessage(LogonApplication.frame, "UI鎿嶄綔鏉冮檺娓呯┖鎴愬姛锛�");
- }
-
- if(refresh){
- treeManager.getSelectionModel().clearSelection();
- initRoleRight(curRole.getId());
- }
- } catch (VCIException e1) {
- e1.printStackTrace();
- VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e1);
- } finally {
- frame.setProcessBarCancel(true);
- }
- }
- };
- bar = new QANProcessBar(t, frame, frame,"UI鎿嶄綔鎺堟潈",false);
- bar.setVisible(true);
- }
+// private void remove_actionPerform(){
+// if (!checkItem()) {
+// return;
+// }
+// final QANProcessBarFrame frame = new QANProcessBarFrame();
+// TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
+// if (treePath == null || treePath.length == 0) {
+// VCIOptionPane.showMessage(LogonApplication.frame, "璇烽�夋嫨瑕佸垹闄ょ殑鏉冮檺");
+// return ;
+// }
+// QANProcessBar bar = null;
+// Thread t = new Thread(){
+// public void run() {
+// frame.setContent("姝e湪鎺堟潈,璇风◢绛�......");
+// try {
+// rightMap.clear();
+// boolean refresh = true;
+// TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
+// //褰撴病鏈夐�変腑妯″潡鐨勬椂鍊�
+// if (treePath == null && treePath.length == 0){
+// refresh = false;
+// }else{
+// RoleRightObject[] roleRightObjs = getRemoveedSelectedRoleRightObjs(treePath);
+// boolean res = new RoleRightClientDelegate(LogonApplication.getUserEntityObject()).removeRoleRight(roleRightObjs,curRole.getId(),currentUserName);
+// frame.setProcessBarCancel(true);
+// if(res){
+// VCIOptionPane.showMessage(LogonApplication.frame, "绉婚櫎UI鎿嶄綔鏉冮檺鎴愬姛锛�");
+// }
+// }
+// if(refresh){
+// treeManager.getSelectionModel().clearSelection();
+// initRoleRight(curRole.getId());
+// }
+// } catch (VCIException e1) {
+// e1.printStackTrace();
+// VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e1);
+// } finally {
+// frame.setProcessBarCancel(true);
+// }
+// }
+// };
+// bar = new QANProcessBar(t, frame, frame,"UI鎿嶄綔鎺堟潈",false);
+// bar.setVisible(true);
+// }
+//
+// private void clear_actionPerform(){
+// if (!checkItem()) {
+// return;
+// }
+// final QANProcessBarFrame frame = new QANProcessBarFrame();
+// TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
+// if (treePath == null || treePath.length == 0) {
+// int result = VCIOptionPane.showConfirmDialog(LogonApplication.frame, this, "鎮ㄧ‘瀹氳娓呴櫎鎵�鏈夌殑UI鎿嶄綔鏉冮檺鍚楋紵", "娉ㄦ剰锛屾偍纭畾瑕佹竻闄ゆ墍鏈夌殑UI鏉冮檺鍚�?", VCIOptionPane.YES_NO_OPTION, VCIOptionPane.WARNING_MESSAGE);
+// if(result != VCIOptionPane.YES_OPTION){
+// return;
+// }
+// }
+// QANProcessBar bar = null;
+// Thread t = new Thread(){
+// public void run() {
+// frame.setContent("姝e湪娓呴櫎鎺堟潈,璇风◢绛�......");
+// try {
+// rightMap.clear();
+// boolean refresh = true;
+// TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
+// //褰撴病鏈夐�変腑妯″潡鐨勬椂鍊�
+// RoleRightObject[] roleRightObjs = new RoleRightObject[0];
+// boolean res = new RoleRightClientDelegate(LogonApplication.getUserEntityObject()).clearRight(curRole.getId(),currentUserName, RightType.UI);
+// frame.setProcessBarCancel(true);
+// if(res){
+// VCIOptionPane.showMessage(LogonApplication.frame, "UI鎿嶄綔鏉冮檺娓呯┖鎴愬姛锛�");
+// }
+//
+// if(refresh){
+// treeManager.getSelectionModel().clearSelection();
+// initRoleRight(curRole.getId());
+// }
+// } catch (VCIException e1) {
+// e1.printStackTrace();
+// VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e1);
+// } finally {
+// frame.setProcessBarCancel(true);
+// }
+// }
+// };
+// bar = new QANProcessBar(t, frame, frame,"UI鎿嶄綔鎺堟潈",false);
+// bar.setVisible(true);
+// }
public void initTreeNode(){
rootNode = new VCIBaseTreeNode(LocaleDisplay.getI18nString("rmip.framework.rightdistribution.moduleRight.moduleTree","RMIPFramework", getLocale()), "root");
@@ -780,46 +824,47 @@
comboType.addItem(new BizTypeEx(null));
for(int k = 0;k < btmItems.length;k++) {
- funMap.put(btmItems[k].name, btmItems[k].name);
-
comboType.addItem(new BizTypeEx(btmItems[k]));
}
for (int i = 0; i < btmItems.length; i++) {
- VCIBaseTreeNode node = new VCIBaseTreeNode(btmItems[i].label+"("+ btmItems[i].name+")", btmItems[i]);
+ VCIBaseTreeNode node = new VCIBaseTreeNode(btmItems[i].label+" ["+ btmItems[i].name+"]", btmItems[i]);
treeModel.insertNodeInto(node, rootNode,rootNode.getChildCount());
+ funMap.put(btmItems[i].name, btmItems[i].name);
+ setChildNode(node, btmItems[i]);
}
+
treeManager = new CheckBoxTreeManager(tree);
scrollTree.getViewport().removeAll();
scrollTree.getViewport().add(tree);
scrollTree.repaint();
- tree.addTreeExpansionListener(new TreeExpansionListener() {
-
- @Override
- public void treeExpanded(TreeExpansionEvent event) {
- TreePath path = event.getPath();
- VCIBaseTreeNode selNode = (VCIBaseTreeNode)path.getLastPathComponent();
- if(!selNode.isLeaf() && selNode.getChildCount() == 0 && !selNode.isExpand()){
- setChildNode(selNode, selNode.getObj());
- }
- }
-
- @Override
- public void treeCollapsed(TreeExpansionEvent event) {
-
- }
- });
+// tree.addTreeExpansionListener(new TreeExpansionListener() {
+//
+// @Override
+// public void treeExpanded(TreeExpansionEvent event) {
+// TreePath path = event.getPath();
+// VCIBaseTreeNode selNode = (VCIBaseTreeNode)path.getLastPathComponent();
+// if(!selNode.isLeaf() && selNode.getChildCount() == 0 && !selNode.isExpand()){
+// setChildNode(selNode, selNode.getObj());
+// }
+// }
+//
+// @Override
+// public void treeCollapsed(TreeExpansionEvent event) {
+//
+// }
+// });
}
private void refreshRole() {
- roleList("");
+ initRoleList("");
treeManager.getSelectionModel().clearSelection();
}
/**鏌ヨ婊¤冻鏉′欢鐨勮鑹蹭俊鎭�**/
private void searchRoleList() {
String search = this.searchTxt.getText().trim();
- roleList(search);
+ initRoleList(search);
treeManager.getSelectionModel().clearSelection();
}
@@ -878,141 +923,54 @@
bar.setVisible(true);
}
-/* private void remove_actionPerform(){
- if (!checkItem()) {
- return;
- }
- final QANProcessBarFrame frame = new QANProcessBarFrame();
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- if (treePath == null || treePath.length == 0) {
- VCIOptionPane.showMessage(LogonApplication.frame, "璇烽�夋嫨瑕佸垹闄ょ殑鏉冮檺");
- return ;
- }
- QANProcessBar bar = null;
- Thread t = new Thread(){
- public void run() {
- frame.setContent("姝e湪鎺堟潈,璇风◢绛�......");
- try {
- rightMap.clear();
- boolean refresh = true;
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- //褰撴病鏈夐�変腑妯″潡鐨勬椂鍊�
- if (treePath == null && treePath.length == 0){
- refresh = false;
- }else{
- RoleRightObject[] roleRightObjs = getRemoveedSelectedRoleRightObjs(treePath);
- boolean res = new RoleRightClientDelegate(LogonApplication.getUserEntityObject()).removeRoleRight(roleRightObjs,curRole.getId(),currentUserName);
- frame.setProcessBarCancel(true);
- if(res){
- VCIOptionPane.showMessage(LogonApplication.frame, "绉婚櫎UI鎿嶄綔鏉冮檺鎴愬姛锛�");
- }
- }
- if(refresh){
- treeManager.getSelectionModel().clearSelection();
- initRoleRight(curRole.getId());
- }
- } catch (VCIException e1) {
- e1.printStackTrace();
- VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e1);
- } finally {
- frame.setProcessBarCancel(true);
- }
- }
- };
- bar = new QANProcessBar(t, frame, frame,"UI鎿嶄綔鎺堟潈",false);
- bar.setVisible(true);
- }*/
-
-/* private void clear_actionPerform(){
- if (!checkItem()) {
- return;
- }
- final QANProcessBarFrame frame = new QANProcessBarFrame();
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- if (treePath == null || treePath.length == 0) {
- int result = VCIOptionPane.showConfirmDialog(LogonApplication.frame, this, "鎮ㄧ‘瀹氳娓呴櫎鎵�鏈夌殑UI鎿嶄綔鏉冮檺鍚楋紵", "娉ㄦ剰锛屾偍纭畾瑕佹竻闄ゆ墍鏈夌殑UI鏉冮檺鍚�?", VCIOptionPane.YES_NO_OPTION, VCIOptionPane.WARNING_MESSAGE);
- if(result != VCIOptionPane.YES_OPTION){
- return;
- }
- }
- QANProcessBar bar = null;
- Thread t = new Thread(){
- public void run() {
- frame.setContent("姝e湪娓呴櫎鎺堟潈,璇风◢绛�......");
- try {
- rightMap.clear();
- boolean refresh = true;
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- //褰撴病鏈夐�変腑妯″潡鐨勬椂鍊�
- RoleRightObject[] roleRightObjs = new RoleRightObject[0];
- boolean res = new RoleRightClientDelegate(LogonApplication.getUserEntityObject()).clearRight(curRole.getId(),currentUserName,1);
- frame.setProcessBarCancel(true);
- if(res){
- VCIOptionPane.showMessage(LogonApplication.frame, "UI鎿嶄綔鏉冮檺娓呯┖鎴愬姛锛�");
- }
-
- if(refresh){
- treeManager.getSelectionModel().clearSelection();
- initRoleRight(curRole.getId());
- }
- } catch (VCIException e1) {
- e1.printStackTrace();
- VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e1);
- } finally {
- frame.setProcessBarCancel(true);
- }
- }
- };
- bar = new QANProcessBar(t, frame, frame,"UI鎿嶄綔鎺堟潈",false);
- bar.setVisible(true);
- }*/
+
/*
* 璇ユ柟娉曚綔涓鸿ˉ鍏呮坊鍔犳巿鏉冨姛鑳藉簲鐢�
*/
- private void reAdd_actionPerform(){
- if (!checkItem()) {
- return;
- }
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- if (treePath == null || treePath.length == 0) {
- VCIOptionPane.showMessage(LogonApplication.frame, "鎮ㄦ病鏈夊湪褰撳墠椤甸潰閫夋嫨浠讳綍鐨勬潈闄愶紝鎵�浠ュ皢涓嶆墽琛岃拷鍔犳潈闄�");
- return ;
- }
- final QANProcessBarFrame frame = new QANProcessBarFrame();
- Thread t = new Thread(){
- public void run() {
- frame.setContent("姝e湪鎺堟潈,璇风◢绛�......");
- try {
- rightMap.clear();
- boolean refresh = true;
- TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
- //褰撴病鏈夐�変腑妯″潡鐨勬椂鍊�
- if (treePath == null) {
- refresh = false;
- }
- RoleRightObject[] roleRightObjs = getSelectedRoleRightObjs(treePath);
- boolean res = new RoleRightClientDelegate(LogonApplication.getUserEntityObject()).addRoleRight(roleRightObjs,curRole.getId(),currentUserName);
- frame.setProcessBarCancel(true);
- if(res){
- VCIOptionPane.showMessage(LogonApplication.frame, "鍔熻兘妯″潡鎺堟潈鎴愬姛锛�");
- }
- if(refresh){
- treeManager.getSelectionModel().clearSelection();
- initRoleRight(curRole.getId());
- }
- } catch (VCIException e1) {
- e1.printStackTrace();
- VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e1);
- } finally {
- if (frame.isActive()) {
- frame.setProcessBarCancel(true);
- }
- }
- }
- };
- QANProcessBar bar = new QANProcessBar(t, frame, frame,"鍔熻兘妯″潡鎺堟潈",false);
- bar.setVisible(true);
- }
+// private void reAdd_actionPerform(){
+// if (!checkItem()) {
+// return;
+// }
+// TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
+// if (treePath == null || treePath.length == 0) {
+// VCIOptionPane.showMessage(LogonApplication.frame, "鎮ㄦ病鏈夊湪褰撳墠椤甸潰閫夋嫨浠讳綍鐨勬潈闄愶紝鎵�浠ュ皢涓嶆墽琛岃拷鍔犳潈闄�");
+// return ;
+// }
+// final QANProcessBarFrame frame = new QANProcessBarFrame();
+// Thread t = new Thread(){
+// public void run() {
+// frame.setContent("姝e湪鎺堟潈,璇风◢绛�......");
+// try {
+// rightMap.clear();
+// boolean refresh = true;
+// TreePath[] treePath = treeManager.getSelectionModel().getSelectionPaths();
+// //褰撴病鏈夐�変腑妯″潡鐨勬椂鍊�
+// if (treePath == null) {
+// refresh = false;
+// }
+// RoleRightObject[] roleRightObjs = getSelectedRoleRightObjs(treePath);
+// boolean res = new RoleRightClientDelegate(LogonApplication.getUserEntityObject()).addRoleRight(roleRightObjs,curRole.getId(),currentUserName);
+// frame.setProcessBarCancel(true);
+// if(res){
+// VCIOptionPane.showMessage(LogonApplication.frame, "鍔熻兘妯″潡鎺堟潈鎴愬姛锛�");
+// }
+// if(refresh){
+// treeManager.getSelectionModel().clearSelection();
+// initRoleRight(curRole.getId());
+// }
+// } catch (VCIException e1) {
+// e1.printStackTrace();
+// VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e1);
+// } finally {
+// if (frame.isActive()) {
+// frame.setProcessBarCancel(true);
+// }
+// }
+// }
+// };
+// QANProcessBar bar = new QANProcessBar(t, frame, frame,"鍔熻兘妯″潡鎺堟潈",false);
+// bar.setVisible(true);
+// }
private RoleRightObject[] getSelectedRoleRightObjs(TreePath[] treePath){
rightMap.clear();
--
Gitblit v1.9.3