ClientSettings.getInstance().getResources().getResource("new level"),
JOptionPane.QUESTION_MESSAGE
);
if (value!=null) {
try {
CompanyHierarchyLevelVO newVO = (CompanyHierarchyLevelVO)((CompanyHierarchyLevelVO)selNode.getUserObject()).clone();
newVO.setProgressiveHie01HIE01(newVO.getProgressiveHIE01());
newVO.setLevelHIE01(newVO.getLevelHIE01().add(new BigDecimal(1)));
newVO.setDescriptionSYS10(value);
DefaultMutableTreeNode newNode = new OpenSwingTreeNode(newVO);
Response response = ClientUtils.getData("companyInsertLevel",newVO);
if (!response.isError()) {
newNode.setUserObject(((VOResponse)response).getVo());
selNode.add(newNode);
repaintTree();
}
else
JOptionPane.showMessageDialog(
ClientUtils.getParentFrame(HierarTreePanel.this),
response.getErrorMessage(),
ClientSettings.getInstance().getResources().getResource("Error"),
JOptionPane.ERROR_MESSAGE
);
} catch (CloneNotSupportedException ex) {
ex.printStackTrace();
}
}
else
JOptionPane.showMessageDialog(
ClientUtils.getParentFrame(HierarTreePanel.this),
ClientSettings.getInstance().getResources().getResource("You must specify a description for the new level."),
ClientSettings.getInstance().getResources().getResource("new level"),
JOptionPane.WARNING_MESSAGE
);
}
}
}
);
if (functionId==null ||
(companyCode==null && applet.getAuthorizations().getBa().isEditEnabled(functionId)) ||
(companyCode!=null && applet.getAuthorizations().getCompanyBa().isEditEnabled(functionId,companyCode))
)
super.addPopupMenuItem(
"updatelevel.text",
ClientSettings.getInstance().getResources().getResource("updatelevel.mnemonic").charAt(0),
true,
new ActionListener() {
public void actionPerformed(ActionEvent e) {
DefaultMutableTreeNode selNode = getSelectedNode();
if (selNode != null) {
CompanyHierarchyLevelVO newVO = (CompanyHierarchyLevelVO)selNode.getUserObject();
String value = JOptionPane.showInputDialog(
ClientUtils.getParentFrame(HierarTreePanel.this),
ClientSettings.getInstance().getResources().getResource("level description: "),
newVO.getDescriptionSYS10()
);
if (value!=null) {
try {
CompanyHierarchyLevelVO oldVO = (CompanyHierarchyLevelVO)((CompanyHierarchyLevelVO)selNode.getUserObject()).clone();
newVO.setDescriptionSYS10(value);
Response response = ClientUtils.getData("updateCompanyLevel",new CompanyHierarchyLevelVO[] {oldVO,newVO});
if (!response.isError()) {
selNode.setUserObject(newVO);
repaintTree();