求阿信的动态树的jsp版本的代码

nicolahul 2004-10-13 02:44:38
我的mail:nicolahul@sina.com
...全文
271 点赞 收藏 16
写回复
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
Leadon 2004-10-13
小弟也跟上Leadon_Tan@163.com
回复
sun980346 2004-10-13
能不能也发一份给我sun980346@163.net
回复
nicolahul 2004-10-13
要,你可以发到我的邮箱:nicolahul@sina.com
回复
dropship 2004-10-13
我改了阿信树的access版本和xml版本,要到话说一声。
其实,你也可以自己去修改的
回复
ningIII 2004-10-13
http://blog.csdn.net/laily/

上面的地方有下载和详细的使用说明。
回复
nicolahul 2004-10-13
能把alai_tree.js和control.js也贴出来吗?
var icons=new alai_imagelist();这个看不懂
回复
yinww 2004-10-13
gz
回复
ningIII 2004-10-13
那是我自己写的操作oracle数据库的类,改称你们自己的就可以了~

楼主不是要js的嘛~
回复
airskys 2004-10-13
就是
有没有这个的包啊
com.les.oradbwork.*
回复
am2000 2004-10-13
MyDbWork是什么?
回复
ningIII 2004-10-13
tree1.expand(false);
tree1.onmouseover=function(node)
{
node.label.style.cssText="color:blue;text-decoration:underline;"
}
tree1.onmouseout=function(node)
{
node.label.style.cssText=""
}
function treeonmousedown(group)
{

g1=group;
//alert(g1);
var rightedge=document.body.clientWidth-event.clientX;
var bottomedge=document.body.clientHeight-event.clientY;
if (rightedge<ie5menu2.offsetWidth)
ie5menu2.style.left=document.body.scrollLeft+event.clientX-ie5menu2.offsetWidth;
else
ie5menu2.style.left=document.body.scrollLeft+event.clientX;
if (bottomedge<ie5menu2.offsetHeight)
ie5menu2.style.top=document.body.scrollTop+event.clientY-ie5menu2.offsetHeight;
else
ie5menu2.style.top=document.body.scrollTop+event.clientY;
ie5menu.style.visibility="hidden";
ie5menu2.style.visibility="visible";

}
document.body.onclick=hidemenu;
function quereRecord()
{

var otype=g1;
var oname=ob1;

parent.main.location.href='qureyChoice.jsp?cc=1&otype='+g1+'&oname='+ob1;
}
function quereStruct()
{

var otype=g1;
var oname=ob1;

parent.main.location.href='qureyChoice.jsp?cc=2&otype='+g1+'&oname='+ob1;
}
function createObject()
{
//alert(g1);
var otype=g1;

parent.main.location.href='qureyChoice.jsp?cc=3&otype='+g1;
}

function dropObject()
{

var otname=on1;
var otype=g1;
var oname=ob1;
if(confirm("删除 "+otname+" "+oname))
parent.main.location.href='qureyChoice.jsp?cc=4&otype='+g1+'&oname='+ob1;

}

function obdiv(group,object,groupname)
{
g1=group;
ob1=object;
on1=groupname;
var rightedge=document.body.clientWidth-event.clientX;
var bottomedge=document.body.clientHeight-event.clientY;
if (rightedge<ie5menu.offsetWidth)
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth;
else
ie5menu.style.left=document.body.scrollLeft+event.clientX;
if (bottomedge<ie5menu.offsetHeight)
ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight;
else
ie5menu.style.top=document.body.scrollTop+event.clientY;
ie5menu2.style.visibility="hidden";
ie5menu.style.visibility="visible";

}
</Script>
<DIV class=up id=ie5menu style="text-align: left;position: absolute; visibility: hidden; BACKGROUND-COLOR: BLUE;width: 80px; z-index: 200;padding:1px" onmouseout=lowlightie5() onmouseover=highlightie5()>
<DIV class=menuitems onclick=quereRecord()>查询记录</DIV>
<DIV class=menuitems onclick=quereStruct()>察看结构</DIV>
<DIV class=menuitems onclick=createObject()>创建对象</DIV>
<DIV class=menuitems onclick=dropObject()>删除对象</DIV>
</DIV>

<DIV class=up id=ie5menu2 style="text-align: left;position: absolute; visibility: hidden; BACKGROUND-COLOR: BLUE;width: 80px; z-index: 200;padding:1px" onmouseout=lowlightie5() onmouseover=highlightie5()>
<DIV class=menuitems onclick=createObject()>创建对象</DIV>
<DIV class=menuitems onclick=dropObject()>删除对象</DIV>
</DIV>
</body>
</html>
回复
ningIII 2004-10-13
<body oncontextmenu=return(false)>
<div nowrap="true" id="divTree1"></div>
<Script Language="JavaScript">
//定义图标
var icons=new alai_imagelist();
icons.add("../images/plus.gif","expand");
icons.add("../images/minus.gif","collapse");
icons.add("../images/prodbig.gif","group");
icons.add("../images/icon-page.gif","object");
//定义数
var tree1=new alai_tree(icons,18,divTree1);
var root=tree1.root;
var gp1;
var ob1;
var on1;

g1=root.add("表","group");

g1.onmousedown=function()
{
if(window.event.button==2)
treeonmousedown('TABLE');
}
g2=root.add("视图","group");
g2.onmousedown=function()
{
if(window.event.button==2)
treeonmousedown('VIEW');
}

g3=root.add("存储过程","group");
g3.onmousedown=function()
{
if(window.event.button==2)
treeonmousedown('PROCEDURE');
}

g4=root.add("函数","group");
g4.onmousedown=function()
{
if(window.event.button==2)
treeonmousedown('FUNCTION');
}
g5=root.add("序列","group");
g5.onmousedown=function()
{
if(window.event.button==2)
treeonmousedown('SEQUENCE');
}
g6=root.add("触发器","group");
g6.onmousedown=function()
{
if(window.event.button==2)
treeonmousedown('TRIGGER');
}
g7=root.add("类型","group");
g7.onmousedown=function()
{
if(window.event.button==2)
treeonmousedown('TYPE');
}
g8=root.add("同义词","group");
g8.onmousedown=function()
{
if(window.event.button==2)
treeonmousedown('SYNONYM');
}
g9=root.add("数据库链接","group");
g9.onmousedown=function()
{
if(window.event.button==2)
treeonmousedown('DBLINK');
}
<%
String ip=(String)session.getAttribute("ip");
String dbName=(String)session.getAttribute("dbName");
String dbPot=(String)session.getAttribute("dbPot");
String userName=(String)session.getAttribute("userName");
String userPw=(String)session.getAttribute("userPw");


String object="";

String group="";
String groupName="";
MyDbWork oradb = new MyDbWork();
try
{
Connection con = oradb.ConnectDb(ip,dbName,dbPot,userName,userPw);
if(con!=null)
{
String sqlObj="";
/****************************表*****************************************************************/
//System.out.println("TABLE");
group="TABLE";
groupName="表";
sqlObj="select table_name from user_tables";
ResultSet rs=oradb.ExecQuery(sqlObj);
int j=0;
while(rs.next())
{
j++;
object=rs.getString(1).trim();
%>
ob<%=j%>=g1.add("<%=object%>","object");
//ob<%=j%>.onmousedown =obdiv('<%=group%>','<%=object%>','<%=groupName%>');
ob<%=j%>.onmousedown=function()
{
if(window.event.button==2)
obdiv('<%=group%>','<%=object%>','<%=groupName%>');
}
<%
}
//oradb.closeRs();
/****************************视图*****************************************************************/
//System.out.println("VIEW");
group="VIEW";
groupName="视图";
sqlObj="select view_name from user_views";
rs=oradb.ExecQuery(sqlObj);
while(rs.next())
{
j++;
object=rs.getString(1).trim();
%>
ob<%=j%>=g2.add("<%=object%>","object");

ob<%=j%>.onmousedown=function()
{
if(window.event.button==2)
obdiv('<%=group%>','<%=object%>','<%=groupName%>');
}
<%
}
//oradb.closeRs();

/****************************存储过程*****************************************************************/
//System.out.println("PROCEDURE");
group="PROCEDURE";
groupName="存储过程";
sqlObj="select distinct name from user_source where type='PROCEDURE'";
rs=oradb.ExecQuery(sqlObj);
while(rs.next())
{
j++;
object=rs.getString(1).trim();
%>
ob<%=j%>=g3.add("<%=object%>","object");
ob<%=j%>.onmousedown=function()
{
if(window.event.button==2)
obdiv('<%=group%>','<%=object%>','<%=groupName%>');
}
<%
}
//oradb.closeRs();

/****************************函数*****************************************************************/
//System.out.println("FUNCTION");
group="FUNCTION";
groupName="函数";
sqlObj="select distinct name from user_source where type='FUNCTION'";
rs=oradb.ExecQuery(sqlObj);
while(rs.next())
{
j++;
object=rs.getString(1).trim();
%>
ob<%=j%>=g4.add("<%=object%>","object");
ob<%=j%>.onmousedown=function()
{
if(window.event.button==2)
obdiv('<%=group%>','<%=object%>','<%=groupName%>');
}
<%
}
//oradb.closeRs();

/****************************序列*****************************************************************/
//System.out.println("SEQUENCE");
group="SEQUENCE";
groupName="序列";
sqlObj="select sequence_name from user_sequences";
rs=oradb.ExecQuery(sqlObj);
while(rs.next())
{
j++;
object=rs.getString(1).trim();
%>
ob<%=j%>=g5.add("<%=object%>","object");
ob<%=j%>.onmousedown=function()
{
if(window.event.button==2)
obdiv('<%=group%>','<%=object%>','<%=groupName%>');
}
<%
}
//oradb.closeRs();
/****************************触发器*****************************************************************/
//System.out.println("TRIGGER");
group="TRIGGER";
groupName="触发器";
sqlObj="select distinct trigger_name from user_triggers";
rs=oradb.ExecQuery(sqlObj);
while(rs.next())
{
j++;
object=rs.getString(1).trim();
%>
ob<%=j%>=g6.add("<%=object%>","object");
ob<%=j%>.onmousedown=function()
{
if(window.event.button==2)
obdiv('<%=group%>','<%=object%>','<%=groupName%>');
}
<%
}
//oradb.closeRs();
/****************************类型*****************************************************************/
//System.out.println("TYPE");
group="TYPE";
groupName="类型";
sqlObj="select distinct name from user_source where type='TYPE'";
rs=oradb.ExecQuery(sqlObj);
while(rs.next())
{
j++;
object=rs.getString(1).trim();
%>
ob<%=j%>=g7.add("<%=object%>","object");
ob<%=j%>.onmousedown=function()
{
if(window.event.button==2)
obdiv('<%=group%>','<%=object%>','<%=groupName%>');
}
<%
}
//oradb.closeRs();
/****************************同义词*****************************************************************/
//System.out.println("SYNONYM");
group="SYNONYM";
groupName="同义词";
sqlObj="select distinct synonym_name from user_synonyms";
rs=oradb.ExecQuery(sqlObj);
while(rs.next())
{
j++;
object=rs.getString(1).trim();
%>
ob<%=j%>=g8.add("<%=object%>","object");
ob<%=j%>.onmousedown=function()
{
if(window.event.button==2)
obdiv('<%=group%>','<%=object%>','<%=groupName%>');
}
<%
}
//oradb.closeRs();
/****************************数据库链接*************************************************************/
//System.out.println("DBLINK");
group="DBLINK";
groupName="数据库链接";
sqlObj="select distinct db_link from user_db_links";
rs=oradb.ExecQuery(sqlObj);
while(rs.next())
{
j++;
object=rs.getString(1).trim();
%>
ob<%=j%>=g9.add("<%=object%>","object");
ob<%=j%>.onmousedown=function()
{
if(window.event.button==2)
obdiv('<%=group%>','<%=object%>','<%=groupName%>');
}
<%
}

}
oradb.CloseAll();
}catch(SQLException ex)
{
System.out.println("Tree Page Exception is "+ex);
}
%>
回复
ningIII 2004-10-13
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" import="java.sql.*,com.les.oradbwork.*"%>
<html>
<head>
<%
request.setCharacterEncoding(response.getCharacterEncoding());
%>
<title>对象目录树</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
.cMenu
{
FILTER: alpha(opacity=0);
BACKGROUND-COLOR: #D6D3CE;
BORDER-BOTTOM: #666666 2px solid;
BORDER-LEFT: #E4E4E4 2px solid;
BORDER-RIGHT: #666666 2px solid;
BORDER-TOP: #E4E4E4 2px solid;
COLOR: #000000;
CURSOR: default;
FONT-SIZE: 9pt;
color:#000000;
FONT-WEIGHT: normal;
LINE-HEIGHT: 20px;
POSITION: absolute;
VISIBILITY: hidden;
WIDTH: 110px
}
.menuitems
{
font-size:9pt;
MARGIN: 2px;
PADDING-BOTTOM: 0px;
PADDING-LEFT: 15px;
PADDING-RIGHT: 3px;
PADDING-TOP: 0px;
}
</STYLE>
<Script Language=JavaScript src="../javascript/control.js"></script>
<Script Language=JavaScript src="../javascript/alai_tree.js"></script>
<script language="JavaScript">
var intInterval=20; //每次更改的透明度
var intDelay=1; //设置菜单显示速度,越大越慢
function hidemenu()
{
ie5menu2.style.visibility="hidden";
ie5menu.style.visibility="hidden";
}

function hidemenuie5(menu)
{
menu.style.visibility="hidden";
}
function highlightie5()
{
if (event.srcElement.className=="menuitems")
{
event.srcElement.style.backgroundColor="highlight"
event.srcElement.style.color="white"
}
}
function lowlightie5()
{
if (event.srcElement.className=="menuitems")
{
event.srcElement.style.backgroundColor=""
event.srcElement.style.color="#000000"
}
}
function GradientShow() //实现淡入的函数
{
ie5menu.filters.alpha.opacity+=intInterval
if (ie5menu.filters.alpha.opacity<100)
setTimeout("GradientShow()",intDelay);
}
function GradientClose() //实现淡出的函数
{
ie5menu.filters.alpha.opacity-=intInterval
if (ie5menu.filters.alpha.opacity>0)
{
setTimeout("GradientClose()",intDelay)
}
else
{
ie5menu.style.visibility="hidden"
}
}
</script>
</head>
回复
nicolahul 2004-10-13
阿赖的也可以
回复
zhonghua2003 2004-10-13
我是阿华,帮你顶.
回复
ningIII 2004-10-13
阿赖的要不要??
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告