diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/GerirRiscosPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/GerirRiscosPanel.java index 5e9135d1..79e22361 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/GerirRiscosPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/GerirRiscosPanel.java @@ -536,9 +536,32 @@ public class GerirRiscosPanel extends JPanel implements LeafUIConstants private void refresh() { + TreePath selPath = tree.getSelectionPath(); + Object selObject = null; + if( selPath != null ) + { + Object selNode = selPath.getLastPathComponent(); + if( selNode != null && (selNode instanceof DefaultMutableTreeNode )) + { + selObject = ((DefaultMutableTreeNode)selNode).getUserObject(); + } + } root.removeAllChildren(); TreeTools.merge( root, HigieneSegurancaLogic.getRiscosTree() ); TreeTools.refreshTree( tree, root, false ); + if( selObject != null ) + { + DefaultMutableTreeNode found = TreeTools.findNodeWithUserObject( selObject, root ); + if( found != null ) + { + TreePath selNew = TreeTools.getPathFor( found ); + if( selNew != null ) + { + tree.setSelectionPath( selNew ); + TreeTools.refreshTree( tree, found, false ); + } + } + } setEnabled(); } diff --git a/trunk/common/src/siprp/database/cayenne/objects/HsNormalizacao.java b/trunk/common/src/siprp/database/cayenne/objects/HsNormalizacao.java index 4d834b82..73a1af1c 100644 --- a/trunk/common/src/siprp/database/cayenne/objects/HsNormalizacao.java +++ b/trunk/common/src/siprp/database/cayenne/objects/HsNormalizacao.java @@ -9,7 +9,7 @@ public class HsNormalizacao extends _HsNormalizacao { private static final int TO_STRING_LENGTH = 58; @Override - public String getCodigo() + public String getCodigo() { return parseFromUnicode( super.getCodigo() ); }