//數據庫中對于時間的查詢操作
public static String getDateSql(Date sDate, String dateType) {
?? ??? ?String start = sDate.getYear() + 1900 + "-" + (sDate.getMonth() + 1)
?? ??? ??? ??? ?+ "-" + sDate.getDate() + " 00:00:00";
?? ??? ?String end = sDate.getYear() + 1900 + "-" + (sDate.getMonth() + 1)
?? ??? ??? ??? ?+ "-" + sDate.getDate() + " 23:59:59";
?? ??? ?String sql = " and " + dateType + " >= TO_DATE('" + start
?? ??? ??? ??? ?+ "','YYYY-MM-DD HH24:MI:SS') and " + dateType
?? ??? ??? ??? ?+ " <= TO_DATE('" + end
?? ??? ??? ??? ?+ "','YYYY-MM-DD HH24:MI:SS') order by " + dateType;
?? ??? ?return sql;
?? ?}
//Java SWT中對于文本框只能輸入數字的限制
/**
??? ?* 數字校驗
??? ?*
??? ?* @param text
??? ?*/
??? private void checkNumber(Text text) {
??? ??? text.addVerifyListener(new VerifyListener() {
??? ??? ??? public void verifyText(VerifyEvent e) {
??? ??? ??? ??? e.doit = ("0123456789.".indexOf(e.text) >= 0);
??? ??? ??? ??? if (e.keyCode == SWT.BS || e.keyCode == SWT.DEL
??? ??? ??? ??? ??? ??? || e.keyCode == SWT.HOME || e.keyCode == SWT.END)
??? ??? ??? ??? ??? e.doit = true;
??? ??? ??? }
??? ??? });
??? }
//對于一些復雜的查詢時可以用HashMap來處理
private String getHql(List<Long> respList,List<Long> customerList, Map<String, Object> map){
??? ??? String hql = " from CrmFeedBack t where 1=1";
??? ??? Object key, value;
??? ??? if (respList != null && respList.size() > 0) {
??? ??? ??? hql += " and t.resp_Idx in (";
??? ??? ??? for (Long id : respList) {
??? ??? ??? ??? hql += id + ",".trim();
??? ??? ??? }
??? ??? ??? hql += ")";
??? ??? ??? hql = hql.replace(",)", ")");
??? ??? }
??? ??? if (customerList != null && customerList.size() > 0) {
??? ??? ??? hql += " and t.client_Name in (";
??? ??? ??? for (Long id : customerList) {
??? ??? ??? ??? hql += id + ",".trim();
??? ??? ??? }
??? ??? ??? hql += ")";
??? ??? ??? hql = hql.replace(",)", ")");
??? ??? }
??? ??? if (map != null && map.size() > 0) {
??? ??? ??? Iterator it = map.entrySet().iterator();
??? ??? ??? while (it.hasNext()) {
??? ??? ??? ??? Map.Entry entry = (Map.Entry) it.next();
??? ??? ??? ??? key = entry.getKey();
??? ??? ??? ??? value = entry.getValue();
??? ??? ??? ??? if (key.equals("resp_Idx") || key.equals("priority")) {
??? ??? ??? ??? ??? hql += " and t." + key + "= " + value;
??? ??? ??? ??? } else {
??? ??? ??? ??? ??? hql += " and t." + key + " like '%" + value + "%'";
??? ??? ??? ??? }
??? ??? ??? }
??? ??? }
??? ??? return hql;
}
///////////////
?? /**
??? ?* Creates the initial layout for a page.
??? ?*/
??? public void createInitialLayout(IPageLayout layout) {
??? ??? String editorArea = layout.getEditorArea();
??? ??? layout.setEditorAreaVisible(false);
??? ??? IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
??? ??? ??? ??? 0.2f, editorArea);
??? ??? left.addView(MyTreeView.ID);
??? ??? left.addView(NavigationView.ID);
??? ??? IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT,
??? ??? ??? ??? 0.8f, editorArea);
??? ??? right.addView(MyTableView.ID);
??? ??? addFastViews(layout);
??? ??? addViewShortcuts(layout);
??? ??? addPerspectiveShortcuts(layout);
??? }
//得到系統文件夾的方法
??? Image image=PlatformUI.getWorkbench().getSharedImages().getImage(
??? ??? ??? ??? ISharedImages.IMG_OBJ_FOLDER);
private?bool IsNumeric(string str)?
{??
?? System.Text.RegularExpressions.Regex reg
?????? = new System.Text.RegularExpressions.Regex(@"^[-]?\d+[.]?\d*$");??
?? return reg.IsMatch(str);?
}
MarQuee的用法
基本語法
<marquee> ... </marquee>
移動屬性的設置 ,這種移動不僅僅局限于文字,也可以應用于圖片,表格等等
方向
<direction=#> #=left, right ,up ,down <marquee
direction=left>從右向左移!</marquee>
方式
<bihavior=#> #=scroll, slide, alternate <marquee
behavior=scroll>一圈一圈繞著走!</marquee>
<marquee behavior=slide>只走一次就歇了!</marquee>
<marquee behavior=alternate>來回走</marquee>
循環
<loop=#> #=次數;若未指定則循環不止(infinite) <marquee loop=3 width=50%
behavior=scroll>只走 3 趟</marquee> <P>
<marquee loop=3 width=50% behavior=slide>只走 3 趟</marquee>
<marquee loop=3 width=50% behavior=alternate>只走 3 趟!</marquee>
速度
<scrollamount=#> <marquee scrollamount=20>啦啦啦,我走得好快喲!</marquee>
延時
<scrolldelay=#> <marquee scrolldelay=500
scrollamount=100>啦啦啦,我走一步,停一停!</marquee>
外觀(Layout)設置
對齊方式(Align)
<align=#> #=top, middle, bottom <font size=6>
<marquee align=# width=400>啦啦啦,我會移動耶!</marquee>
</font>
底色
<bgcolor=#> #=rrggbb 16 進制數碼,或者是下列預定義色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua <marquee
bgcolor=aaaaee>顏色!</marquee>
面積
<height=# width=#> <marquee height=40 width=50%
bgcolor=aaeeaa>面積!</marquee>
空白
(Margins)<hspace=# vspace=#>
<marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa
align=middle>面積!</marquee>