public void setCurrentSelection() {
List toSelect = JaWEManager.getInstance().getJaWEController().getSelectionManager().getSelectedElements();
for (int i = 0; i < toSelect.size(); i++) {
XMLElement toSel = (XMLElement) toSelect.get(i);
if (toSel instanceof Package || toSel instanceof WorkflowProcess || toSel instanceof ActivitySet || toSel instanceof Activity) {
XPDLTreeNode n = treeModel.findNode(toSel);
TreePath tp = null;
if (n != null) {
tp = new TreePath(n.getPath());
tree.addSelectionPath(tp);
}
if (tp != null) {
tree.scrollPathToVisible(tp);
}