??xml version="1.0" encoding="utf-8" standalone="yes"?>91精品国产91久久久久久最新,国产日韩成人精品,欧美.com http://www.aygfsteel.com/vip01/category/16738.html单实?---逻辑清楚 zh-cn Thu, 27 Dec 2007 09:15:52 GMT Thu, 27 Dec 2007 09:15:52 GMT 60 Myeclipse 6.0.1高速下载,支持eclipse3.3.1 http://www.aygfsteel.com/vip01/archive/2007/10/19/154092.html交U赞 交U赞 Fri, 19 Oct 2007 01:53:00 GMT http://www.aygfsteel.com/vip01/archive/2007/10/19/154092.html http://www.aygfsteel.com/vip01/comments/154092.html http://www.aygfsteel.com/vip01/archive/2007/10/19/154092.html#Feedback 8 http://www.aygfsteel.com/vip01/comments/commentRss/154092.html http://www.aygfsteel.com/vip01/services/trackbacks/154092.html 阅读全文 ]]> FormatSqlResult2.0 增加对中文和和空列的识别 http://www.aygfsteel.com/vip01/archive/2007/08/10/135725.html交U赞 交口U赞 Fri, 10 Aug 2007 01:55:00 GMT http://www.aygfsteel.com/vip01/archive/2007/08/10/135725.html http://www.aygfsteel.com/vip01/comments/135725.html http://www.aygfsteel.com/vip01/archive/2007/08/10/135725.html#Feedback 1 http://www.aygfsteel.com/vip01/comments/commentRss/135725.html http://www.aygfsteel.com/vip01/services/trackbacks/135725.html 1 import java.util.LinkedList; 2 3 import org.eclipse.swt.SWT; 4 import org.eclipse.swt.events.KeyAdapter; 5 import org.eclipse.swt.events.KeyEvent; 6 import org.eclipse.swt.events.SelectionAdapter; 7 import org.eclipse.swt.events.SelectionEvent; 8 import org.eclipse.swt.layout.FormAttachment; 9 import org.eclipse.swt.layout.FormData; 10 import org.eclipse.swt.layout.FormLayout; 11 import org.eclipse.swt.widgets.Button; 12 import org.eclipse.swt.widgets.Display; 13 import org.eclipse.swt.widgets.Label; 14 import org.eclipse.swt.widgets.Shell; 15 import org.eclipse.swt.widgets.Text; 16 17 public class FormatSqlResult { 18 19 private Text text; 20 21 protected Shell shell; 22 23 /** 24 * Launch the application 25 * 26 * @param args 27 */ 28 public static void main(String[] args) { 29 try { 30 FormatSqlResult window = new FormatSqlResult(); 31 window.open(); 32 } catch (Exception e) { 33 e.printStackTrace(); 34 } 35 } 36 37 /** 38 * Open the window 39 */ 40 public void open() { 41 final Display display = Display.getDefault(); 42 createContents(); 43 shell.open(); 44 shell.layout(); 45 while ( ! shell.isDisposed()) { 46 if ( ! display.readAndDispatch()) 47 display.sleep(); 48 } 49 } 50 51 /** 52 * Create contents of the window 53 */ 54 protected void createContents() { 55 shell = new Shell(); 56 shell.setLayout( new FormLayout()); 57 shell.setSize( 631 , 414 ); 58 shell.setText( " FormatSqlResult " ); 59 60 text = new Text(shell, SWT.V_SCROLL | SWT.MULTI | SWT.H_SCROLL | SWT.BORDER); 61 text.addKeyListener( new KeyAdapter() { 62 public void keyPressed(KeyEvent e) { 63 System.out.println(e.keyCode); 64 } 65 }); 66 final FormData fd_text = new FormData(); 67 fd_text.bottom = new FormAttachment( 100 , - 34 ); 68 fd_text.right = new FormAttachment( 100 , - 5 ); 69 fd_text.left = new FormAttachment( 0 , 0 ); 70 fd_text.top = new FormAttachment( 0 , 0 ); 71 text.setLayoutData(fd_text); 72 final Button formatButton = new Button(shell, SWT.NONE); 73 formatButton.addSelectionListener( new SelectionAdapter() { 74 public void widgetSelected(SelectionEvent e) { 75 String str = text.getText(); 76 if (str != null && str.length() > 0 ) { 77 text.setText(getSpaceText(str.replaceAll( " \r " , "" ))); 78 text.selectAll(); 79 } 80 81 } 82 }); 83 final FormData fd_formatButton = new FormData(); 84 fd_formatButton.left = new FormAttachment( 0 , 286 ); 85 fd_formatButton.right = new FormAttachment( 100 , - 287 ); 86 fd_formatButton.top = new FormAttachment( 100 , - 26 ); 87 fd_formatButton.bottom = new FormAttachment( 100 , - 4 ); 88 formatButton.setLayoutData(fd_formatButton); 89 formatButton.setText( " Format " ); 90 91 final Label label = new Label(shell, SWT.NONE); 92 final FormData fd_label = new FormData(); 93 fd_label.top = new FormAttachment( 100 , - 19 ); 94 fd_label.left = new FormAttachment( 100 , - 130 ); 95 fd_label.bottom = new FormAttachment( 100 , - 4 ); 96 fd_label.right = new FormAttachment( 100 , - 5 ); 97 label.setLayoutData(fd_label); 98 label.setText( " 版权所有:交U赞 " ); 99 100 final Label formatsqlresult10Label = new Label(shell, SWT.NONE); 101 final FormData fd_formatsqlresult10Label = new FormData(); 102 fd_formatsqlresult10Label.top = new FormAttachment( 100 , - 19 ); 103 fd_formatsqlresult10Label.right = new FormAttachment( 0 , 180 ); 104 fd_formatsqlresult10Label.bottom = new FormAttachment( 100 , - 4 ); 105 fd_formatsqlresult10Label.left = new FormAttachment( 0 , 5 ); 106 formatsqlresult10Label.setLayoutData(fd_formatsqlresult10Label); 107 formatsqlresult10Label.setText( " FormatSqlResult version 2.0 " ); 108 109 final Button button = new Button(shell, SWT.NONE); 110 button.addSelectionListener( new SelectionAdapter() { 111 public void widgetSelected(SelectionEvent e) { 112 text.selectAll(); 113 } 114 }); 115 final FormData fd_button = new FormData(); 116 fd_button.top = new FormAttachment(formatButton, - 22 , SWT.BOTTOM); 117 fd_button.bottom = new FormAttachment(formatButton, 0 , SWT.BOTTOM); 118 fd_button.left = new FormAttachment( 0 , 239 ); 119 fd_button.right = new FormAttachment( 0 , 275 ); 120 button.setLayoutData(fd_button); 121 button.setText( " 全?/span>" ); 122 123 final Button button_1 = new Button(shell, SWT.NONE); 124 button_1.addSelectionListener( new SelectionAdapter() { 125 public void widgetSelected(SelectionEvent e) { 126 text.setText( "" ); 127 } 128 }); 129 final FormData fd_button_1 = new FormData(); 130 fd_button_1.left = new FormAttachment(formatButton, 9 , SWT.DEFAULT); 131 fd_button_1.right = new FormAttachment( 100 , - 242 ); 132 fd_button_1.bottom = new FormAttachment( 100 , - 4 ); 133 fd_button_1.top = new FormAttachment( 100 , - 26 ); 134 button_1.setLayoutData(fd_button_1); 135 button_1.setText( " 清空 " ); 136 } 137 138 public String getSpaceText(String allStr) { 139 String[] strs = allStr.split( " \n " ); 140 String lineStr; 141 int row = - 1 ; 142 if (strs != null && strs.length > 0 ) { 143 lineStr = strs[ 0 ]; 144 String[] lineStrs = lineStr.split( " \t " ); 145 row = lineStrs.length; 146 } 147 int [] max = new int [row]; 148 for ( int i = 0 ; i < max.length; i ++ ) { 149 max[i] = - 1 ; 150 } 151 LinkedList all = new LinkedList(); 152 for ( int i = 0 ; i < row; i ++ ) { 153 LinkedList list = new LinkedList(); 154 all.add(list); 155 } 156 for ( int i = 0 ; i < strs.length; i ++ ) { 157 lineStr = strs[i]; 158 String[] lineStrs = lineStr.split( " \t " ); 159 int length = - 1 ; 160 for ( int j = 0 ; j < row; j ++ ) { 161 if (j < lineStrs.length) { 162 length = lineStrs[j].getBytes().length; 163 if (length > max[j]) { 164 max[j] = length; 165 } 166 ((LinkedList) all.get(j)).add(lineStrs[j]); 167 } else { 168 ((LinkedList) all.get(j)).add( "" ); 169 } 170 171 } 172 } 173 174 StringBuffer sb = new StringBuffer(); 175 int line = ((LinkedList) all.get( 0 )).size(); 176 for ( int i = 0 ; i < line; i ++ ) { 177 for ( int j = 0 ; j < all.size(); j ++ ) { 178 String str = (String) ((LinkedList) all.get(j)).get(i); 179 int length = max[j] - str.getBytes().length + 1 ; 180 sb.append(str); 181 for ( int k = 0 ; k < length; k ++ ) { 182 sb.append( " " ); 183 } 184 } 185 sb.append( " \n " ); 186 } 187 return sb.toString(); 188 } 189 190 } 191
已制作成exeQ可以双L行,只支持WindowsQؓ了兼容jdk版本Q没敢用泛型?
下蝲Q?a href="/Files/vip01/FormatSqlResult2.rar">FormatSqlResult2.rar
]]>FormatSqlResult--SQL查询l果Q格式化工具Q已作成exeQ付源码 http://www.aygfsteel.com/vip01/archive/2007/08/09/135420.html交U赞 交U赞 Thu, 09 Aug 2007 03:02:00 GMT http://www.aygfsteel.com/vip01/archive/2007/08/09/135420.html http://www.aygfsteel.com/vip01/comments/135420.html http://www.aygfsteel.com/vip01/archive/2007/08/09/135420.html#Feedback 2 http://www.aygfsteel.com/vip01/comments/commentRss/135420.html http://www.aygfsteel.com/vip01/services/trackbacks/135420.html 阅读全文 ]]> eclipse插geasytools3.1.0新增获取选择文g相对路径列表 http://www.aygfsteel.com/vip01/archive/2007/07/16/130586.html交口U赞 交U赞 Mon, 16 Jul 2007 07:22:00 GMT http://www.aygfsteel.com/vip01/archive/2007/07/16/130586.html http://www.aygfsteel.com/vip01/comments/130586.html http://www.aygfsteel.com/vip01/archive/2007/07/16/130586.html#Feedback 5 http://www.aygfsteel.com/vip01/comments/commentRss/130586.html http://www.aygfsteel.com/vip01/services/trackbacks/130586.html 阅读全文 ]]> d解决SWTq行出错(2)修改pȝ环境变量 http://www.aygfsteel.com/vip01/archive/2007/04/19/111856.html交口U赞 交口U赞 Thu, 19 Apr 2007 02:20:00 GMT http://www.aygfsteel.com/vip01/archive/2007/04/19/111856.html http://www.aygfsteel.com/vip01/comments/111856.html http://www.aygfsteel.com/vip01/archive/2007/04/19/111856.html#Feedback 6 http://www.aygfsteel.com/vip01/comments/commentRss/111856.html http://www.aygfsteel.com/vip01/services/trackbacks/111856.html
okQ正常运行了Q不用那么长的命令行?nbsp; 阅读全文 ]]> d解决SWTq行出错(1)命o行方?/title> http://www.aygfsteel.com/vip01/archive/2007/04/19/111853.html交U赞 交U赞 Thu, 19 Apr 2007 02:07:00 GMT http://www.aygfsteel.com/vip01/archive/2007/04/19/111853.html http://www.aygfsteel.com/vip01/comments/111853.html http://www.aygfsteel.com/vip01/archive/2007/04/19/111853.html#Feedback 2 http://www.aygfsteel.com/vip01/comments/commentRss/111853.html http://www.aygfsteel.com/vip01/services/trackbacks/111853.html 阅读全文 ]]> SWT Designer全版本注册文件生成器Q注册机 http://www.aygfsteel.com/vip01/archive/2007/04/18/111476.html交口U赞 交口U赞 Wed, 18 Apr 2007 00:55:00 GMT http://www.aygfsteel.com/vip01/archive/2007/04/18/111476.html http://www.aygfsteel.com/vip01/comments/111476.html http://www.aygfsteel.com/vip01/archive/2007/04/18/111476.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/111476.html http://www.aygfsteel.com/vip01/services/trackbacks/111476.html 执行Qipconfig /all
扑ֈQ? 物理地址. . . . . . . . . . . . . : 00-00-00-00-00-00
q行Q记住你的?
然后执行keygeno.jar
填入你的名字
填入你的MAC地址
点击generate
看到License file "Instantiations.license" created
q且在当前目录下已经生成了Instantiations.license文g
把这个文件Documents and Settings\you rname下面
VISTA下拷贝到Users\you rname下面
OK了?nbsp; 阅读全文 ]]> eclipse插gQopencmd(直接开命o行工具到选择文g、文件夹、JAR?跨^?/title> http://www.aygfsteel.com/vip01/archive/2007/02/01/97171.html交U赞 交U赞 Thu, 01 Feb 2007 03:35:00 GMT http://www.aygfsteel.com/vip01/archive/2007/02/01/97171.html http://www.aygfsteel.com/vip01/comments/97171.html http://www.aygfsteel.com/vip01/archive/2007/02/01/97171.html#Feedback 18 http://www.aygfsteel.com/vip01/comments/commentRss/97171.html http://www.aygfsteel.com/vip01/services/trackbacks/97171.html
选中文gQ点几Zopen cmd? 会打开命o行工Pq定位\径到选择的文件、文件夹、JAR? 跨^台经试windows、FC6下可? 其它q_应该都没问题
您可以根据自qq_和桌面在ECLIPSE讄里面修改命o?
eclipse3.2.1
wtp1.5.2
myeclipse5.1
试通过
下蝲地址
阅读全文 ]]> eclipse插gQopenexplorer(直接用资源管理器打开选择文g、文件夹、JAR?跨^?/title> http://www.aygfsteel.com/vip01/archive/2007/01/31/97000.html交口U赞 交口U赞 Wed, 31 Jan 2007 08:18:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/31/97000.html http://www.aygfsteel.com/vip01/comments/97000.html http://www.aygfsteel.com/vip01/archive/2007/01/31/97000.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/97000.html http://www.aygfsteel.com/vip01/services/trackbacks/97000.html 会直接调用系l默认资源浏览器打开选择的文件、文件夹、JAR? 跨^台经试windows、linux下可? 阅读全文 ]]> CheckStyle、JDepend的eclipse插g下蝲Q包含原版) http://www.aygfsteel.com/vip01/archive/2007/01/30/96708.html交U赞 交U赞 Tue, 30 Jan 2007 05:26:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/30/96708.html http://www.aygfsteel.com/vip01/comments/96708.html http://www.aygfsteel.com/vip01/archive/2007/01/30/96708.html#Feedback 4 http://www.aygfsteel.com/vip01/comments/commentRss/96708.html http://www.aygfsteel.com/vip01/services/trackbacks/96708.html 阅读全文 ]]> 反射妙用Q超强通用q月日树 http://www.aygfsteel.com/vip01/archive/2007/01/09/92520.html交口U赞 交口U赞 Tue, 09 Jan 2007 02:04:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/09/92520.html http://www.aygfsteel.com/vip01/comments/92520.html http://www.aygfsteel.com/vip01/archive/2007/01/09/92520.html#Feedback 2 http://www.aygfsteel.com/vip01/comments/commentRss/92520.html http://www.aygfsteel.com/vip01/services/trackbacks/92520.html 于是我就利用JAVA的反机Ӟ写了一个通用q月日树?nbsp; 阅读全文 ]]> 07q第一_eclipsepȝ托盘插gEaseTray2.0.0 http://www.aygfsteel.com/vip01/archive/2006/12/31/91219.html交U赞 交U赞 Sun, 31 Dec 2006 12:01:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/31/91219.html http://www.aygfsteel.com/vip01/comments/91219.html http://www.aygfsteel.com/vip01/archive/2006/12/31/91219.html#Feedback 6 http://www.aygfsteel.com/vip01/comments/commentRss/91219.html http://www.aygfsteel.com/vip01/services/trackbacks/91219.html 工具栏按钮切换状态? 支持中英文? 最重要的是l于实现了启动时自动加蝲?nbsp; 阅读全文 ]]> 让eclipse启动时执行指定的E序 http://www.aygfsteel.com/vip01/archive/2006/12/31/91156.html交U赞 交U赞 Sun, 31 Dec 2006 06:38:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/31/91156.html http://www.aygfsteel.com/vip01/comments/91156.html http://www.aygfsteel.com/vip01/archive/2006/12/31/91156.html#Feedback 20 http://www.aygfsteel.com/vip01/comments/commentRss/91156.html http://www.aygfsteel.com/vip01/services/trackbacks/91156.html eclipsepȝ托盘插gEaseTray1.0 插g能在eclipse启动时加载,泡了半天书店Q在于找C怎么让eclipse启动时执行指定的E序Q离解决问题又近了一步。现在和大家分n下收莗?br /> 新徏一个插仉目,增加一个org.eclipse.ui.startup扩展点, 指向直接写的test.EasyStartupc?br />EasyStartupQ?br /> 1 package test; 2 3 import org.eclipse.swt.widgets.Display; 4 import org.eclipse.ui.IStartup; 5 6 public class EasyStartup implements IStartup { 7 public void earlyStartup() { 8 Display.getDefault().syncExec( new Runnable() { 9 public void run() { 10 System.out.println( " hello start " ); 11 } 12 }); 13 } 14 15 }
作ؓ插gq行Q控制台会输出: hello start 呵呵Q小的成功?br />但是我还是无法获取IWorkbenchWindow对象。。。。。。。?br />q样我的插gq是不能启动时强制加载ƈ初始化。。。。。。。?br />谁知道怎么获取IWorkbenchWindowQ? ]]>打造完SWT日期选择控gQ(七)日期 http://www.aygfsteel.com/vip01/archive/2006/12/29/90688.html交U赞 交U赞 Fri, 29 Dec 2006 03:26:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/29/90688.html http://www.aygfsteel.com/vip01/comments/90688.html http://www.aygfsteel.com/vip01/archive/2006/12/29/90688.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/90688.html http://www.aygfsteel.com/vip01/services/trackbacks/90688.html 1Q支持动态布局?br />2Q支持Q意星期开始,不同的星期开始g影响日期开始的行列位置?br />整体效果L上一文?br />打造完SWT日期选择控gQ(六)星期 的截图?br />3Q能监听到用户双M件。ƈ处理?br />关键代码如下 private void setDays() { clearDays(); Calendar cal = (Calendar) basicCalendar.clone(); int today = cal.get(Calendar.DAY_OF_MONTH); int thisMonth = cal.get(Calendar.MONTH); cal.set(Calendar.DAY_OF_MONTH, 1 ); int week = cal.get(Calendar.DAY_OF_WEEK); week -= this .firstDayOfWeek; for ( int i = week; i < days.length; cal.add(Calendar.DAY_OF_MONTH, 1 )) { Label label = days[i ++ ]; int day = cal.get(Calendar.DAY_OF_MONTH); int month = cal.get(Calendar.MONTH); if (month == thisMonth) { if (day == today) { label.setForeground(getDisplay().getSystemColor(SWT.COLOR_DARK_RED)); } label.setText(Integer.toString(cal.get(Calendar.DAY_OF_MONTH))); label.setData(label.getText()); label.addListener(SWT.MouseDoubleClick, this ); } else { return ; } } }
]]> 打造完SWT日期选择控gQ(六)星期 http://www.aygfsteel.com/vip01/archive/2006/12/29/90687.html交口U赞 交U赞 Fri, 29 Dec 2006 03:25:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/29/90687.html http://www.aygfsteel.com/vip01/comments/90687.html http://www.aygfsteel.com/vip01/archive/2006/12/29/90687.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/90687.html http://www.aygfsteel.com/vip01/services/trackbacks/90687.html 1Q支持多语言?br />2Q支持动态布局?br />3Q支持Q意星期开始。这个解释一下,比如有的国家一个星期的开始是星期一有的是星期日Q也有可能是星期X?br />老规矩上图,看图说话Q?br /> 中文环境Q星期日为星期开始?br /> 中文环境Q星期二为星期开始?br /> 英文环境Q星期日为星期开始?br /> 日文环境Q星期日为星期开始?br /> 自动适应布局的效果。M思想是用GridLayout布局。一行七列。ؓ了看得清楚,Ҏ加了BORDER效果?br /> 以下是关键代码:private void initDayTitle() { dayTitles = new Label[ 7 ]; for ( int i = 0 ; i < dayTitles.length; i ++ ) { final Label label = new Label(dayTitle, SWT.CENTER); label.setLayoutData( new GridData(SWT.FILL, SWT.CENTER, true , true )); dayTitles[i] = label; } DateFormatSymbols dateFormatSymbols = new DateFormatSymbols(locale); String[] dayNames = dateFormatSymbols.getShortWeekdays(); int minLength = Integer.MAX_VALUE; for ( int i = 0 ; i < dayNames.length; i ++ ) { int len = dayNames[i].length(); if (len > 0 && len < minLength) { minLength = len; } } if (minLength > 2 ) { for ( int i = 0 ; i < dayNames.length; i ++ ) { if (dayNames[i].length() > 0 ) { if (locale.equals(Locale.CHINA)) { if (dayNames[i].length() > 2 ) { dayNames[i] = dayNames[i].substring( 2 , 3 ); } } else { if (dayNames[i].length() > 0 ) { dayNames[i] = dayNames[i].substring( 0 , 3 ); } } } } } firstDayOfWeek = basicCalendar.getFirstDayOfWeek(); int d = firstDayOfWeek; for ( int i = 0 ; i < dayTitles.length; i ++ ) { Label labelt = dayTitles[i]; labelt.setText(dayNames[d]); labelt.setBackground(getBackground()); if (d == Calendar.SUNDAY) { labelt.setForeground(getDisplay().getSystemColor(SWT.COLOR_RED)); } else if (d == Calendar.SATURDAY) { labelt.setForeground(getDisplay().getSystemColor(SWT.COLOR_GREEN)); } else { labelt.setForeground(getForeground()); } d ++ ; if (d > dayTitles.length) { d -= dayTitles.length; } } }
]]> eclipsepȝ托盘插gEaseTray1.0Q最化eclipse到托盘,关闭eclipse到托?/title> http://www.aygfsteel.com/vip01/archive/2006/12/28/90524.html交U赞 交口U赞 Thu, 28 Dec 2006 08:40:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/28/90524.html http://www.aygfsteel.com/vip01/comments/90524.html http://www.aygfsteel.com/vip01/archive/2006/12/28/90524.html#Feedback 9 http://www.aygfsteel.com/vip01/comments/commentRss/90524.html http://www.aygfsteel.com/vip01/services/trackbacks/90524.html 安装成功后会在工h出现一个按?img height="30" alt="snap200604.jpg" src="http://www.aygfsteel.com/images/blogjava_net/vip01/snap200604.jpg" width="98" border="0" />Q每ơ点M在生效、失效之间切?img height="34" alt="snap200605.jpg" src="http://www.aygfsteel.com/images/blogjava_net/vip01/snap200605.jpg" width="89" border="0" />切换到生效状态以后,会在pȝ托盘出现eclipse的图标, 。此时最化eclipse会最化的系l托盘,d栏不昄。关闭时Q最化到系l托盘?br /> 插g生效后可以通过托盘图标的菜单退?img height="72" alt="snap200607.jpg" src="http://www.aygfsteel.com/images/blogjava_net/vip01/snap200607.jpg" width="420" border="0" />Q失效后可以直接点关闭按钮退出?br />EaseTray_1.0.0.200612281626.zip ]]> 打造完SWT日期选择控gQ(四)下拉列表的整体设? http://www.aygfsteel.com/vip01/archive/2006/12/27/90384.html交口U赞 交U赞 Wed, 27 Dec 2006 13:52:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/27/90384.html http://www.aygfsteel.com/vip01/comments/90384.html http://www.aygfsteel.com/vip01/archive/2006/12/27/90384.html#Feedback 1 http://www.aygfsteel.com/vip01/comments/commentRss/90384.html http://www.aygfsteel.com/vip01/services/trackbacks/90384.html q月控制?
星期?
日期栏?/li> 整个界面层次l构如图Q?br /> ]]>打造完SWT日期选择控gQ(五)控制q月 http://www.aygfsteel.com/vip01/archive/2006/12/27/90385.html交U赞 交口U赞 Wed, 27 Dec 2006 13:52:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/27/90385.html http://www.aygfsteel.com/vip01/comments/90385.html http://www.aygfsteel.com/vip01/archive/2006/12/27/90385.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/90385.html http://www.aygfsteel.com/vip01/services/trackbacks/90385.html q月控制q部分分为控制按钮,月下拉列表和qSpinnerQ翻译ؓ微调控制器。。。。。。。)。控制按钮没什么好说的Q无非就是控制加一减一Q注意边界@环就可以了?br />Spinner的用法很单,看下代码Q?br /> yearChooser = new Spinner(yearMonthChooser, SWT.READ_ONLY | SWT.BORDER); //初始化,只读Q带Ҏ yearChooser.addSelectionListener( new SelectionAdapter() ... { public void widgetSelected(SelectionEvent e) ... { int n = yearChooser.getSelection(); basicCalendar.set(Calendar.YEAR, n); yearChooser.setSelection(n); setDays(); } }); //加上选择事g监听 yearChooser.setMaximum( 3000 );//讄上限 yearChooser.setMinimum( 1899 );//讄下限 yearChooser.setIncrement( 1 );//步进?br /> yearChooser.setPageIncrement( 10 );//q个是按下pageup和pagedown时的步进?br /> yearChooser.setSelection(basicCalendar.get(Calendar.YEAR));//选择当前q?/span> 月的下拉列表看似单实则不Ӟ因ؓ我们要考虑国际化的问题?br /> 以上是中文环境和英文环境下的试效果。关键点是:月的信息从Locale中取。以下是关键代码Q?br />private void initMonth() { DateFormatSymbols dateFormatSymbols = new DateFormatSymbols(locale); String[] monthNames = dateFormatSymbols.getMonths(); int month = monthChooser.getSelectionIndex(); if (monthChooser.getItemCount() > 0 ) { monthChooser.removeAll(); } for ( int i = 0 ; i < monthNames.length; i ++ ) { String name = monthNames[i]; if (name.length() > 0 ) { monthChooser.add(name); } } if (month < 0 ) { month = 0 ; } else if (month >= monthChooser.getItemCount()) { month = monthChooser.getItemCount() - 1 ; } monthChooser.select(month); }
]]>强!z!SWT实现d栏图标(pȝ托盘Q,带菜单和ToolTip http://www.aygfsteel.com/vip01/archive/2006/12/26/90127.html交口U赞 交U赞 Tue, 26 Dec 2006 07:47:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/26/90127.html http://www.aygfsteel.com/vip01/comments/90127.html http://www.aygfsteel.com/vip01/archive/2006/12/26/90127.html#Feedback 6 http://www.aygfsteel.com/vip01/comments/commentRss/90127.html http://www.aygfsteel.com/vip01/services/trackbacks/90127.html 看到有位朋友在偶?a class="singleposttitle" id="viewpost1_TitleUrl" href="/vip01/archive/2006/12/25/89875.html">为RCPE序增加关闭提示和关闭到pȝ托盘”的文章里面的留aQ忍不住把自׃前N老的一帖子扒出来了?br />此文可能是当初最早最完善的SWT实现d栏图标,带菜单、带ToolTip的完整的例子?br />期间q有CSDN会员GhostValley;pdvv的指教?br />
1 import org.eclipse.swt.SWT; 2 import org.eclipse.swt.events.ShellListener; 3 import org.eclipse.swt.graphics.Image; 4 import org.eclipse.swt.internal.win32.OS; 5 import org.eclipse.swt.widgets.Display; 6 import org.eclipse.swt.widgets.Event; 7 import org.eclipse.swt.widgets.Listener; 8 import org.eclipse.swt.widgets.Menu; 9 import org.eclipse.swt.widgets.MenuItem; 10 import org.eclipse.swt.widgets.Shell; 11 import org.eclipse.swt.widgets.Tray; 12 import org.eclipse.swt.widgets.TrayItem; 13 14 public class MyTray { 15 public static void main(String[] args) { 16 Display display = new Display(); 17 Shell shell = new Shell(display); 18 // 下面两句的效果是Q在d栏不昄 19 // 感谢CSDN会员QGhostValley(D) 20 final int hWnd = shell.handle; 21 OS.SetWindowLong(hWnd, OS.GWL_EXSTYLE, OS.WS_EX_CAPTIONOKBTN); 22 Image image = new Image(display, 16 , 16 ); 23 final Tray tray = display.getSystemTray(); 24 if (tray == null ) { 25 System.out.println( " The system tray is not available " ); 26 } else { 27 final TrayItem item = new TrayItem(tray, SWT.NONE); 28 item.setToolTipText( " SWT TrayItem " ); 29 item.addListener(SWT.Show, new Listener() { 30 public void handleEvent(Event event) { 31 System.out.println( " show " ); 32 } 33 }); 34 item.addListener(SWT.Hide, new Listener() { 35 public void handleEvent(Event event) { 36 System.out.println( " hide " ); 37 } 38 }); 39 item.addListener(SWT.Selection, new Listener() { 40 public void handleEvent(Event event) { 41 System.out.println( " selection " ); 42 } 43 }); 44 item.addListener(SWT.DefaultSelection, new Listener() { 45 public void handleEvent(Event event) { 46 System.out.println( " default selection " ); 47 // show main 48 Shell s = event.display.getShells()[ 0 ]; 49 s.setVisible( true ); 50 s.setMinimized( false ); 51 } 52 }); 53 final Menu menu = new Menu(shell, SWT.POP_UP); 54 for ( int i = 0 ; i < 8 ; i ++ ) { 55 MenuItem mi = new MenuItem(menu, SWT.PUSH); 56 mi.setText( " Item " + i); 57 } 58 item.addListener(SWT.MenuDetect, new Listener() { 59 public void handleEvent(Event event) { 60 menu.setVisible( true ); 61 } 62 }); 63 item.setImage(image); 64 } 65 shell.addShellListener( new ShellListener() { 66 public void shellDeactivated(org.eclipse.swt.events.ShellEvent e) { 67 } 68 69 public void shellActivated(org.eclipse.swt.events.ShellEvent e) { 70 } 71 72 public void shellClosed(org.eclipse.swt.events.ShellEvent e) { 73 } 74 75 public void shellDeiconified(org.eclipse.swt.events.ShellEvent e) { 76 } 77 78 public void shellIconified(org.eclipse.swt.events.ShellEvent e) { 79 // 最化时不昄在Q务栏 80 // 感谢CSDN会员Qpdvv(我爱q) 81 ((Shell) e.getSource()).setVisible( false ); 82 } 83 }); 84 shell.setBounds( 50 , 50 , 300 , 200 ); 85 shell.open(); 86 while ( ! shell.isDisposed()) { 87 if ( ! display.readAndDispatch()) 88 display.sleep(); 89 } 90 image.dispose(); 91 display.dispose(); 92 } 93 }
]]>获取当前l对路径 http://www.aygfsteel.com/vip01/archive/2006/12/26/90094.html交口U赞 交U赞 Tue, 26 Dec 2006 06:00:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/26/90094.html http://www.aygfsteel.com/vip01/comments/90094.html http://www.aygfsteel.com/vip01/archive/2006/12/26/90094.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/90094.html http://www.aygfsteel.com/vip01/services/trackbacks/90094.html q个也是以前写的一点东西,今天要用Q又扒出来了。希望能l大家带来帮助:
1 2 public class GetPath { 3 public static void main(String[] args) { 4 GetPath test = new GetPath(); 5 System.out.println(test.getPath()); 6 } 7 8 public String getPath() { 9 return this .getClass().getResource( " / " ).getPath(); 10 } 11 } 12
]]> 打造完SWT日期选择控gQ(三)看上d下拉列表 http://www.aygfsteel.com/vip01/archive/2006/12/26/90023.html交U赞 交U赞 Tue, 26 Dec 2006 01:13:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/26/90023.html http://www.aygfsteel.com/vip01/comments/90023.html http://www.aygfsteel.com/vip01/archive/2006/12/26/90023.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/90023.html http://www.aygfsteel.com/vip01/services/trackbacks/90023.html
Z能像个下拉列表我们我们要让控制下拉的按钮使用本地下拉列表的样式?br />int arrowStyle = SWT.ARROW | SWT.DOWN; arrow = new Button( this , arrowStyle); q样我们自己的下拉列表就能和本地的主题分g持一致了?img src ="http://www.aygfsteel.com/vip01/aggbug/90023.html" width = "1" height = "1" /> ]]> 打造完SWT日期选择控gQ(二)实现自适应大小 http://www.aygfsteel.com/vip01/archive/2006/12/25/89880.html交口U赞 交U赞 Mon, 25 Dec 2006 05:26:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/25/89880.html http://www.aygfsteel.com/vip01/comments/89880.html http://www.aygfsteel.com/vip01/archive/2006/12/25/89880.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/89880.html http://www.aygfsteel.com/vip01/services/trackbacks/89880.html 要做成通用控gQ控件主体必要能自适应大小?br />老规矩,上图Q?br /> 设计界面Q?br /> 在其它容器中自由使用的效果图Q?br /> 那么怎么才能做到自写的控件能自适应大小呢?Composite Q?span lang="EN-US">FormLayout 是实现这U效果的完美l合。通俗的说Composite 是一个容器,里面能放各种其它控gQ当?span lang="EN-US">Composite本n也能攑ֈ其它容器里面?span lang="EN-US">FormLayout是一U布局方式Q精髓是“相对位|”。( 跟我学之用FormLayout打造自适应H体大小的控件布局 Q?br />?/span>Composite我们攄一个文本框和一个按钮?/span> q里我们讄 文本框上边相?/span>Composite上边Q偏U量0?br /> 文本框左边相?/span>Composite左边Q偏U量0?br /> 文本框右边相?/span>按钮Q偏U量0?br /> 文本框下边相?/span>Composite下边Q偏U量0?/span> 按钮 上边相对 Composite上边Q偏U量0?br /> 按钮 左边相对 Composite双边,偏移?7?br /> 按钮 双相对 Composite双 Q偏U量0?br /> 按钮 下边相对 Composite下边Q偏U量0?/span> q样我们整体实现文本框。按钮的高度跟随Composite变化?br />按钮宽度固定。文本框宽度 跟随Composite变化?br />代码片段Q?br /> arrow = new Button( this , arrowStyle); arrow.addSelectionListener(arrowListener); final FormData formData = new FormData(); formData.left = new FormAttachment( 100 , - 17 ); formData.right = new FormAttachment( 100 , - 0 ); formData.top = new FormAttachment( 0 , 0 ); formData.bottom = new FormAttachment( 100 , - 0 ); arrow.setLayoutData(formData); text = new Text( this , SWT.READ_ONLY); final FormData formData_1 = new FormData(); formData_1.right = new FormAttachment(arrow, 0 , SWT.LEFT); formData_1.top = new FormAttachment( 0 , 0 ); formData_1.bottom = new FormAttachment( 100 , - 0 ); formData_1.left = new FormAttachment( 0 , 0 ); text.setLayoutData(formData_1);
]]> 打造完SWT日期选择控gQ(一Q寻找、比较轮?/title> http://www.aygfsteel.com/vip01/archive/2006/12/25/89879.html交口U赞 交U赞 Mon, 25 Dec 2006 05:24:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/25/89879.html http://www.aygfsteel.com/vip01/comments/89879.html http://www.aygfsteel.com/vip01/archive/2006/12/25/89879.html#Feedback 1 http://www.aygfsteel.com/vip01/comments/commentRss/89879.html http://www.aygfsteel.com/vip01/services/trackbacks/89879.html 当然发明轮子之前先找扄有没有别人写好的轮子。经q一番寻找还真有不少。ȝ一下,现在SWT下的日期控g有以下三UŞ式:1嵌入式:
点评Q嵌入式作用不大 Q而且我们能看到这个控件对中文支持不好Q星期全部都昄为“星”?br />
2弹出式:
点评Q对中文支持较好Q经q看源代码。是一位中国同胞修改的Q对中文q行了特D处理(致敬Q。但是弹出式用户体验不好Q而且该控件对星期的字W串全部截取一C个字W,在某些语a环境下,会出现星期全是相同字母的情况Q容易造成h。比如越南文环境下:
3下拉列表式:
点评Q中文支持基本没有,而且q有严重BUGQ?br />Q十月只?9PQ? 优点是下拉列表方式,用户体验好,而且在SWT DESIGNER中可以Q意拖放,支持L位置L大小Q方便设计界面?br /> lg我心目中的完SWT日期控g有如下需求: 1Q下拉列表方式?br />2Q在SWT DESIGNER中能预览Q能拖放Q调整大?br />3Q支持多语言?br />4Q支持Q意星期开始(不是所有国安是星期日是一周开始)?br />当然q要有基本日期功能?img src ="http://www.aygfsteel.com/vip01/aggbug/89879.html" width = "1" height = "1" /> ]]> 用FormLayout打造自适应H体大小的控件布局 http://www.aygfsteel.com/vip01/archive/2006/12/25/89878.html交U赞 交口U赞 Mon, 25 Dec 2006 05:23:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/25/89878.html http://www.aygfsteel.com/vip01/comments/89878.html http://www.aygfsteel.com/vip01/archive/2006/12/25/89878.html#Feedback 3 http://www.aygfsteel.com/vip01/comments/commentRss/89878.html http://www.aygfsteel.com/vip01/services/trackbacks/89878.html 我胖 我瘦 我标?br /> 以上是一个窗体在不同大小下的效果Q控仉着H体的大改变大和位置Q这是FormLayout的布局方式的的功劳?br />FormLayout的布局方式的精髓就两个字“相对”?br />下面先看看设计界面: 在设计器里面点击文本框[name_text]可以看到上下左右各出C个小头Q这四个头是用来讄该控件在四个方向上的相对位置?br />先看看上Q?br />点击上箭头会出现五个按?img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/snap1003.jpg" _fcksavedurl="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/snap1003.jpg" />Q?br />W一个是讄控g[上边 ]相对容器 [上边 ] Q偏U量为具体数字?br />W二个是 |控?/span> [上边 ] 相对容器 [底边 ] Q偏U量为具体数字?br /> W三个是讄控g[上边 ]相对容器 [上边 ] Q偏U量为百分比?br /> W四个是讄控g[上边 ]相对容器内某控g的位|?/span> Q?/span> 偏移量ؓ具体数字?br />W五个是取消讄?br /> ?span style="COLOR: rgb(255,0,0)">头?/span> ?span style="COLOR: rgb(255,0,0)">头 和下头点击以后 与此cM?br /> 举例说明Q?br />对于文本框[name_text],我们q样讄Q?br /> [上边 ] 相对容器[上边 ] Q偏U量为具体数字?/span> [左边 ]相对容器 [左边 ] Q偏U量为具体数字?/span> [双 ] 相对容器 [ 双 ]Q偏U量为具体数字。(当容器改变宽度的时候,控g宽度跟着改变Q?br /> [下边 ] 相对容器 [上边 ] Q偏U量为具体数字。(当容器高度变化时Q高度不变) 对于 文本框[name_remark],我们q样讄Q?br /> [上边 ] 相对容器[上边 ] Q偏U量为具体数字?/span> [左边 ]相对容器 [左边 ] Q偏U量为具体数字?/span> [双 ] 相对容器 [ 双 ]Q偏U量为具体数字。(当容器改变宽度的时候,控g宽度跟着改变Q?br /> [下边 ] 相对容器 [ 下边 ]Q偏U量为具体数字。(当容器高度变化时Q?/span> 控g 高度 跟着改变 Q?br /> 通过A相对Bq种方式。我们能制作出非常实用美观的界面?br />以下是代码:import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; public class TestFormLayout { private Text text_remark; private Text text_name; protected Shell shell; /** * Launch the application * @param args */ public static void main(String[] args) { try { TestFormLayout window = new TestFormLayout(); window.open(); } catch (Exception e) { e.printStackTrace(); } } /** * Open the window */ public void open() { final Display display = Display.getDefault(); createContents(); shell.open(); shell.layout(); while ( ! shell.isDisposed()) { if ( ! display.readAndDispatch()) display.sleep(); } } /** * Create contents of the window */ protected void createContents() { shell = new Shell(); shell.setLayout( new FillLayout()); shell.setSize( 500 , 375 ); shell.setText( " SWT Application " ); Label label_remark; final Composite composite = new Composite(shell, SWT.NONE); composite.setLayout( new FormLayout()); final Label label_name = new Label(composite, SWT.NONE); final FormData formData = new FormData(); formData.top = new FormAttachment( 0 , 25 ); formData.left = new FormAttachment( 0 , 30 ); formData.right = new FormAttachment( 0 , 60 ); label_name.setLayoutData(formData); label_name.setText( " 姓名 " ); text_name = new Text(composite, SWT.BORDER); formData.bottom = new FormAttachment(text_name, 0 , SWT.BOTTOM); final FormData formData_1 = new FormData(); formData_1.top = new FormAttachment( 0 , 25 ); formData_1.right = new FormAttachment( 100 , - 32 ); formData_1.bottom = new FormAttachment( 0 , 43 ); formData_1.left = new FormAttachment(label_name, 5 , SWT.DEFAULT); text_name.setLayoutData(formData_1); text_remark = new Text(composite, SWT.BORDER); final FormData formData_2 = new FormData(); formData_2.bottom = new FormAttachment( 100 , - 16 ); formData_2.right = new FormAttachment( 100 , - 32 ); formData_2.top = new FormAttachment( 0 , 62 ); formData_2.left = new FormAttachment( 0 , 65 ); text_remark.setLayoutData(formData_2); label_remark = new Label(composite, SWT.NONE); final FormData formData_3 = new FormData(); formData_3.top = new FormAttachment( 44 , 0 ); formData_3.bottom = new FormAttachment( 51 , 0 ); formData_3.right = new FormAttachment( 0 , 60 ); formData_3.left = new FormAttachment( 0 , 30 ); label_remark.setLayoutData(formData_3); label_remark.setText( " 说明 " );
]]> 为RCPE序增加关闭提示和关闭到pȝ托盘 http://www.aygfsteel.com/vip01/archive/2006/12/25/89875.html交U赞 交口U赞 Mon, 25 Dec 2006 05:16:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/25/89875.html http://www.aygfsteel.com/vip01/comments/89875.html http://www.aygfsteel.com/vip01/archive/2006/12/25/89875.html#Feedback 7 http://www.aygfsteel.com/vip01/comments/commentRss/89875.html http://www.aygfsteel.com/vip01/services/trackbacks/89875.html 加入 @Override public void postWindowClose() { //退出提C或者最化到托盘代码写在这?br /> super.postWindowClose();//关闭RCPQ不惛_闭就不要写这?br /> } ]]>像WEB一L树ŞDRCP http://www.aygfsteel.com/vip01/archive/2006/12/22/89464.html交U赞 交U赞 Fri, 22 Dec 2006 03:10:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/22/89464.html http://www.aygfsteel.com/vip01/comments/89464.html http://www.aygfsteel.com/vip01/archive/2006/12/22/89464.html#Feedback 5 http://www.aygfsteel.com/vip01/comments/commentRss/89464.html http://www.aygfsteel.com/vip01/services/trackbacks/89464.html 阅读全文 ]]> RCPE序怎样实现自适应分辩率最大化 http://www.aygfsteel.com/vip01/archive/2006/10/30/78180.html交口U赞 交U赞 Mon, 30 Oct 2006 15:50:00 GMT http://www.aygfsteel.com/vip01/archive/2006/10/30/78180.html http://www.aygfsteel.com/vip01/comments/78180.html http://www.aygfsteel.com/vip01/archive/2006/10/30/78180.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/78180.html http://www.aygfsteel.com/vip01/services/trackbacks/78180.html 在ApplicationWorkbenchWindowAdvisorcȝpublic void preWindowOpen() { }
Ҏ里面加入如下代码卛_
Dimension srcd = Toolkit.getDefaultToolkit().getScreenSize(); configurer.setInitialSize( new Point(srcd.width,srcd.height));
]]>
վ֩ģ壺
|
|
|
֦ |
|
Ͷ |
|
ɽ |
|
|
|
|
|
|
|
|
ϴ |
|
|
|
ƺ |
Ȩ |
|
¹Ȫ |
|
|
Ԫ |
Զ |
|
α |
ֳ |
|
|
|
» |
|
|
|
ɽ |
ɽ |
|