DefaultMutableTreeNode node = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
if (node.getUserObject() instanceof ObjectInfo) {
ObjectInfo oj = (ObjectInfo)node.getUserObject();
if (oj.flag.equals("layout")) {
DAO dao = DAO.getInstance();
dao.query(Resources.SELECT_CL_SQL);
dao.setInt(1, getContainer().getCurrentObject().getClsId());
dao.setInt(2, oj.layout);
ResultSet rs = dao.executeQuery();
try {
if (rs.next()) {
if (rs.getBoolean("ISFAVORITE") == !favorite) {
dao.update(Resources.UPDATE_CL_ISFAVORITE_SQL);
dao.setBoolean(1, favorite);
dao.setInt(2, getContainer().getCurrentObject().getClsId());
dao.setInt(3, oj.layout);
dao.executeUpdate();
getContainer().updateTree();
}
}