??xml version="1.0" encoding="utf-8" standalone="yes"?>91精品国产91久久久久久最新,国产日韩成人精品,欧美.comhttp://www.aygfsteel.com/vip01/category/16738.html单实?---逻辑清楚zh-cnThu, 27 Dec 2007 09:15:52 GMTThu, 27 Dec 2007 09:15:52 GMT60Myeclipse 6.0.1高速下载,支持eclipse3.3.1http://www.aygfsteel.com/vip01/archive/2007/10/19/154092.html交U赞交U赞Fri, 19 Oct 2007 01:53:00 GMThttp://www.aygfsteel.com/vip01/archive/2007/10/19/154092.htmlhttp://www.aygfsteel.com/vip01/comments/154092.htmlhttp://www.aygfsteel.com/vip01/archive/2007/10/19/154092.html#Feedback8http://www.aygfsteel.com/vip01/comments/commentRss/154092.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/154092.html阅读全文

交U赞 2007-10-19 09:53 发表评论
]]>
FormatSqlResult2.0 增加对中文和和空列的识别http://www.aygfsteel.com/vip01/archive/2007/08/10/135725.html交U赞交口U赞Fri, 10 Aug 2007 01:55:00 GMThttp://www.aygfsteel.com/vip01/archive/2007/08/10/135725.htmlhttp://www.aygfsteel.com/vip01/comments/135725.htmlhttp://www.aygfsteel.com/vip01/archive/2007/08/10/135725.html#Feedback1http://www.aygfsteel.com/vip01/comments/commentRss/135725.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/135725.htmlFormatSqlResult.jpg
  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(631414);
 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(00);
 70         fd_text.top = new FormAttachment(00);
 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(0286);
 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(0180);
104         fd_formatsqlresult10Label.bottom = new FormAttachment(100-4);
105         fd_formatsqlresult10Label.left = new FormAttachment(05);
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(0239);
119         fd_button.right = new FormAttachment(0275);
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



交U赞 2007-08-10 09:55 发表评论
]]>
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 GMThttp://www.aygfsteel.com/vip01/archive/2007/08/09/135420.htmlhttp://www.aygfsteel.com/vip01/comments/135420.htmlhttp://www.aygfsteel.com/vip01/archive/2007/08/09/135420.html#Feedback2http://www.aygfsteel.com/vip01/comments/commentRss/135420.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/135420.html阅读全文

交U赞 2007-08-09 11:02 发表评论
]]>
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 GMThttp://www.aygfsteel.com/vip01/archive/2007/07/16/130586.htmlhttp://www.aygfsteel.com/vip01/comments/130586.htmlhttp://www.aygfsteel.com/vip01/archive/2007/07/16/130586.html#Feedback5http://www.aygfsteel.com/vip01/comments/commentRss/130586.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/130586.html阅读全文

交U赞 2007-07-16 15:22 发表评论
]]>
d解决SWTq行出错(2)修改pȝ环境变量http://www.aygfsteel.com/vip01/archive/2007/04/19/111856.html交口U赞交口U赞Thu, 19 Apr 2007 02:20:00 GMThttp://www.aygfsteel.com/vip01/archive/2007/04/19/111856.htmlhttp://www.aygfsteel.com/vip01/comments/111856.htmlhttp://www.aygfsteel.com/vip01/archive/2007/04/19/111856.html#Feedback6http://www.aygfsteel.com/vip01/comments/commentRss/111856.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/111856.html
okQ正常运行了Q不用那么长的命令行?nbsp; 阅读全文

交U赞 2007-04-19 10:20 发表评论
]]>
d解决SWTq行出错(1)命o行方?/title><link>http://www.aygfsteel.com/vip01/archive/2007/04/19/111853.html</link><dc:creator>交U赞</dc:creator><author>交U赞</author><pubDate>Thu, 19 Apr 2007 02:07:00 GMT</pubDate><guid>http://www.aygfsteel.com/vip01/archive/2007/04/19/111853.html</guid><wfw:comment>http://www.aygfsteel.com/vip01/comments/111853.html</wfw:comment><comments>http://www.aygfsteel.com/vip01/archive/2007/04/19/111853.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/vip01/comments/commentRss/111853.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/vip01/services/trackbacks/111853.html</trackback:ping><description><![CDATA[     摘要: okQ正常啦。。。。。。。。。。。。。。。。。。。。?nbsp; <a href='http://www.aygfsteel.com/vip01/archive/2007/04/19/111853.html'>阅读全文</a><img src ="http://www.aygfsteel.com/vip01/aggbug/111853.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/vip01/" target="_blank">交U赞</a> 2007-04-19 10:07 <a href="http://www.aygfsteel.com/vip01/archive/2007/04/19/111853.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SWT Designer全版本注册文件生成器Q注册机http://www.aygfsteel.com/vip01/archive/2007/04/18/111476.html交口U赞交口U赞Wed, 18 Apr 2007 00:55:00 GMThttp://www.aygfsteel.com/vip01/archive/2007/04/18/111476.htmlhttp://www.aygfsteel.com/vip01/comments/111476.htmlhttp://www.aygfsteel.com/vip01/archive/2007/04/18/111476.html#Feedback0http://www.aygfsteel.com/vip01/comments/commentRss/111476.htmlhttp://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; 阅读全文

交U赞 2007-04-18 08:55 发表评论
]]>
eclipse插gQopencmd(直接开命o行工具到选择文g、文件夹、JAR?跨^?/title><link>http://www.aygfsteel.com/vip01/archive/2007/02/01/97171.html</link><dc:creator>交U赞</dc:creator><author>交U赞</author><pubDate>Thu, 01 Feb 2007 03:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/vip01/archive/2007/02/01/97171.html</guid><wfw:comment>http://www.aygfsteel.com/vip01/comments/97171.html</wfw:comment><comments>http://www.aygfsteel.com/vip01/archive/2007/02/01/97171.html#Feedback</comments><slash:comments>18</slash:comments><wfw:commentRss>http://www.aygfsteel.com/vip01/comments/commentRss/97171.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/vip01/services/trackbacks/97171.html</trackback:ping><description><![CDATA[     摘要: eclipse插gQopenecmd <br> <br>选中文gQ点几Zopen cmd?<br>会打开命o行工Pq定位\径到选择的文件、文件夹、JAR?<br>跨^台经试windows、FC6下可?<br>其它q_应该都没问题 <br> <br>您可以根据自qq_和桌面在ECLIPSE讄里面修改命o?<br> <br> <br>eclipse3.2.1 <br>wtp1.5.2 <br>myeclipse5.1 <br>试通过 <br>下蝲地址 <br>  <a href='http://www.aygfsteel.com/vip01/archive/2007/02/01/97171.html'>阅读全文</a><img src ="http://www.aygfsteel.com/vip01/aggbug/97171.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/vip01/" target="_blank">交口U赞</a> 2007-02-01 11:35 <a href="http://www.aygfsteel.com/vip01/archive/2007/02/01/97171.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>eclipse插gQopenexplorer(直接用资源管理器打开选择文g、文件夹、JAR?跨^?/title><link>http://www.aygfsteel.com/vip01/archive/2007/01/31/97000.html</link><dc:creator>交口U赞</dc:creator><author>交口U赞</author><pubDate>Wed, 31 Jan 2007 08:18:00 GMT</pubDate><guid>http://www.aygfsteel.com/vip01/archive/2007/01/31/97000.html</guid><wfw:comment>http://www.aygfsteel.com/vip01/comments/97000.html</wfw:comment><comments>http://www.aygfsteel.com/vip01/archive/2007/01/31/97000.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/vip01/comments/commentRss/97000.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/vip01/services/trackbacks/97000.html</trackback:ping><description><![CDATA[     摘要: 选中文gQ点几Zopen folder?<br>会直接调用系l默认资源浏览器打开选择的文件、文件夹、JAR?<br>跨^台经试windows、linux下可?<br>  <a href='http://www.aygfsteel.com/vip01/archive/2007/01/31/97000.html'>阅读全文</a><img src ="http://www.aygfsteel.com/vip01/aggbug/97000.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/vip01/" target="_blank">交U赞</a> 2007-01-31 16:18 <a href="http://www.aygfsteel.com/vip01/archive/2007/01/31/97000.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>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 GMThttp://www.aygfsteel.com/vip01/archive/2007/01/30/96708.htmlhttp://www.aygfsteel.com/vip01/comments/96708.htmlhttp://www.aygfsteel.com/vip01/archive/2007/01/30/96708.html#Feedback4http://www.aygfsteel.com/vip01/comments/commentRss/96708.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/96708.html阅读全文

交U赞 2007-01-30 13:26 发表评论
]]>
反射妙用Q超强通用q月日树http://www.aygfsteel.com/vip01/archive/2007/01/09/92520.html交口U赞交口U赞Tue, 09 Jan 2007 02:04:00 GMThttp://www.aygfsteel.com/vip01/archive/2007/01/09/92520.htmlhttp://www.aygfsteel.com/vip01/comments/92520.htmlhttp://www.aygfsteel.com/vip01/archive/2007/01/09/92520.html#Feedback2http://www.aygfsteel.com/vip01/comments/commentRss/92520.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/92520.html 于是我就利用JAVA的反机Ӟ写了一个通用q月日树?nbsp; 阅读全文

交U赞 2007-01-09 10:04 发表评论
]]>
07q第一_eclipsepȝ托盘插gEaseTray2.0.0http://www.aygfsteel.com/vip01/archive/2006/12/31/91219.html交U赞交U赞Sun, 31 Dec 2006 12:01:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/31/91219.htmlhttp://www.aygfsteel.com/vip01/comments/91219.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/31/91219.html#Feedback6http://www.aygfsteel.com/vip01/comments/commentRss/91219.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/91219.html工具栏按钮切换状态?
支持中英文?
最重要的是l于实现了启动时自动加蝲?nbsp; 阅读全文

交口U赞 2006-12-31 20:01 发表评论
]]>
让eclipse启动时执行指定的E序http://www.aygfsteel.com/vip01/archive/2006/12/31/91156.html交U赞交U赞Sun, 31 Dec 2006 06:38:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/31/91156.htmlhttp://www.aygfsteel.com/vip01/comments/91156.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/31/91156.html#Feedback20http://www.aygfsteel.com/vip01/comments/commentRss/91156.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/91156.htmleclipsepȝ托盘插gEaseTray1.0插g能在eclipse启动时加载,泡了半天书店Q在于找C怎么让eclipse启动时执行指定的E序Q离解决问题又近了一步。现在和大家分n下收莗?br />
新徏一个插仉目,增加一个org.eclipse.ui.startup扩展点,2006123101.jpg
指向直接写的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?


交U赞 2006-12-31 14:38 发表评论
]]>
打造完SWT日期选择控gQ(七)日期http://www.aygfsteel.com/vip01/archive/2006/12/29/90688.html交U赞交U赞Fri, 29 Dec 2006 03:26:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/29/90688.htmlhttp://www.aygfsteel.com/vip01/comments/90688.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/29/90688.html#Feedback0http://www.aygfsteel.com/vip01/comments/commentRss/90688.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/90688.html1Q支持动态布局?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;
            }

        }
    }



交U赞 2006-12-29 11:26 发表评论
]]>
打造完SWT日期选择控gQ(六)星期http://www.aygfsteel.com/vip01/archive/2006/12/29/90687.html交口U赞交U赞Fri, 29 Dec 2006 03:25:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/29/90687.htmlhttp://www.aygfsteel.com/vip01/comments/90687.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/29/90687.html#Feedback0http://www.aygfsteel.com/vip01/comments/commentRss/90687.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/90687.html1Q支持多语言?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, truetrue));
            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(23);
                        }
                    } 
else {
                        
if (dayNames[i].length() > 0) {
                            dayNames[i] 
= dayNames[i].substring(03);
                        }
                    }
                }
            }
        }
        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;
            }
        }

    }



交U赞 2006-12-29 11:25 发表评论
]]>
eclipsepȝ托盘插gEaseTray1.0Q最化eclipse到托盘,关闭eclipse到托?/title><link>http://www.aygfsteel.com/vip01/archive/2006/12/28/90524.html</link><dc:creator>交U赞</dc:creator><author>交口U赞</author><pubDate>Thu, 28 Dec 2006 08:40:00 GMT</pubDate><guid>http://www.aygfsteel.com/vip01/archive/2006/12/28/90524.html</guid><wfw:comment>http://www.aygfsteel.com/vip01/comments/90524.html</wfw:comment><comments>http://www.aygfsteel.com/vip01/archive/2006/12/28/90524.html#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://www.aygfsteel.com/vip01/comments/commentRss/90524.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/vip01/services/trackbacks/90524.html</trackback:ping><description><![CDATA[eclipsepȝ托盘插g1.0Q放在eclipse安装目录的plugins下。重启eclipse带clean参数?br />安装成功后会在工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的图标,<img height="36" alt="snap200606.jpg" src="http://www.aygfsteel.com/images/blogjava_net/vip01/snap200606.jpg" width="70" border="0" />。此时最化eclipse会最化的系l托盘,d栏不昄。关闭时Q最化到系l托盘?br /><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 /><br /><img height="245" alt="snap200608.jpg" src="http://www.aygfsteel.com/images/blogjava_net/vip01/snap200608.jpg" width="522" border="0" /><br /><hr /><a href="/Files/vip01/EaseTray_1.0.0.200612281626.zip"><font color="#002c99">EaseTray_1.0.0.200612281626.zip</font></a><img src ="http://www.aygfsteel.com/vip01/aggbug/90524.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/vip01/" target="_blank">交U赞</a> 2006-12-28 16:40 <a href="http://www.aygfsteel.com/vip01/archive/2006/12/28/90524.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>打造完SWT日期选择控gQ(四)下拉列表的整体设?http://www.aygfsteel.com/vip01/archive/2006/12/27/90384.html交口U赞交U赞Wed, 27 Dec 2006 13:52:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/27/90384.htmlhttp://www.aygfsteel.com/vip01/comments/90384.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/27/90384.html#Feedback1http://www.aygfsteel.com/vip01/comments/commentRss/90384.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/90384.html
  1. q月控制?
  2. 星期?
  3. 日期栏?/li>

整个界面层次l构如图Q?br />


交U赞 2006-12-27 21:52 发表评论
]]>
打造完SWT日期选择控gQ(五)控制q月 http://www.aygfsteel.com/vip01/archive/2006/12/27/90385.html交U赞交口U赞Wed, 27 Dec 2006 13:52:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/27/90385.htmlhttp://www.aygfsteel.com/vip01/comments/90385.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/27/90385.html#Feedback0http://www.aygfsteel.com/vip01/comments/commentRss/90385.htmlhttp://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);
    }


 


交U赞 2006-12-27 21:52 发表评论
]]>
强!z!SWT实现d栏图标(pȝ托盘Q,带菜单和ToolTiphttp://www.aygfsteel.com/vip01/archive/2006/12/26/90127.html交口U赞交U赞Tue, 26 Dec 2006 07:47:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/26/90127.htmlhttp://www.aygfsteel.com/vip01/comments/90127.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/26/90127.html#Feedback6http://www.aygfsteel.com/vip01/comments/commentRss/90127.htmlhttp://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, 1616);
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(5050300200);
85         shell.open();
86         while (!shell.isDisposed()) {
87             if (!display.readAndDispatch())
88                 display.sleep();
89         }
90         image.dispose();
91         display.dispose();
92     }
93 }


交U赞 2006-12-26 15:47 发表评论
]]>
获取当前l对路径http://www.aygfsteel.com/vip01/archive/2006/12/26/90094.html交口U赞交U赞Tue, 26 Dec 2006 06:00:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/26/90094.htmlhttp://www.aygfsteel.com/vip01/comments/90094.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/26/90094.html#Feedback0http://www.aygfsteel.com/vip01/comments/commentRss/90094.htmlhttp://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 


交U赞 2006-12-26 14:00 发表评论
]]>
打造完SWT日期选择控gQ(三)看上d下拉列表http://www.aygfsteel.com/vip01/archive/2006/12/26/90023.html交U赞交U赞Tue, 26 Dec 2006 01:13:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/26/90023.htmlhttp://www.aygfsteel.com/vip01/comments/90023.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/26/90023.html#Feedback0http://www.aygfsteel.com/vip01/comments/commentRss/90023.htmlhttp://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" />

交U赞 2006-12-26 09:13 发表评论
]]>
打造完SWT日期选择控gQ(二)实现自适应大小http://www.aygfsteel.com/vip01/archive/2006/12/25/89880.html交口U赞交U赞Mon, 25 Dec 2006 05:26:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/25/89880.htmlhttp://www.aygfsteel.com/vip01/comments/89880.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/25/89880.html#Feedback0http://www.aygfsteel.com/vip01/comments/commentRss/89880.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/89880.html要做成通用控gQ控件主体必要能自适应大小?br />老规矩,上图Q?br />
设计界面Q?br />


在其它容器中自由使用的效果图Q?br />



那么怎么才能做到自写的控件能自适应大小呢?CompositeQ?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(00);
        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(00);
        formData_1.bottom 
= new FormAttachment(100-0);
        formData_1.left 
= new FormAttachment(00);
        text.setLayoutData(formData_1);



交U赞 2006-12-25 13:26 发表评论
]]>
打造完SWT日期选择控gQ(一Q寻找、比较轮?/title><link>http://www.aygfsteel.com/vip01/archive/2006/12/25/89879.html</link><dc:creator>交口U赞</dc:creator><author>交U赞</author><pubDate>Mon, 25 Dec 2006 05:24:00 GMT</pubDate><guid>http://www.aygfsteel.com/vip01/archive/2006/12/25/89879.html</guid><wfw:comment>http://www.aygfsteel.com/vip01/comments/89879.html</wfw:comment><comments>http://www.aygfsteel.com/vip01/archive/2006/12/25/89879.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/vip01/comments/commentRss/89879.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/vip01/services/trackbacks/89879.html</trackback:ping><description><![CDATA[    日期选择控g可以说是每个目中必用的Q看到WEB上那么多观好用的日期选择控gQ再回头SWT。。。没有一个好用的日期控gQ于是就惌己写一个?br />    当然发明轮子之前先找扄有没有别人写好的轮子。经q一番寻找还真有不少。ȝ一下,现在SWT下的日期控g有以下三UŞ式:<br /><div style="text-align: left;">1嵌入式:<br /><img alt="嵌入? src="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap1.jpg" _fcksavedurl="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap1.jpg" /><br /><br />点评Q嵌入式作用不大 Q而且我们能看到这个控件对中文支持不好Q星期全部都昄为“星”?br /><br />2弹出式:<br /><br /><img alt="弹出? src="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap2.jpg" _fcksavedurl="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap2.jpg" /><br /><br />点评Q对中文支持较好Q经q看源代码。是一位中国同胞修改的Q对中文q行了特D处理(致敬Q。但是弹出式用户体验不好Q而且该控件对星期的字W串全部截取一C个字W,在某些语a环境下,会出现星期全是相同字母的情况Q容易造成h。比如越南文环境下:<br /><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap4.jpg" _fcksavedurl="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap4.jpg" /><br /><br /><br />3下拉列表式:<br /><br /><img alt="下拉列表? src="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap3.jpg" _fcksavedurl="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap3.jpg" /></div>点评Q中文支持基本没有,而且q有严重BUGQ?br />Q十月只?9PQ?<img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap5.jpg" _fcksavedurl="http://p.blog.csdn.net/images/p_blog_csdn_net/vip01/Snap5.jpg" align="left" height="165" width="214" /><br />优点是下拉列表方式,用户体验好,而且在SWT DESIGNER中可以Q意拖放,支持L位置L大小Q方便设计界面?br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />lg我心目中的完SWT日期控g有如下需求:<br />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" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/vip01/" target="_blank">交U赞</a> 2006-12-25 13:24 <a href="http://www.aygfsteel.com/vip01/archive/2006/12/25/89879.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用FormLayout打造自适应H体大小的控件布局http://www.aygfsteel.com/vip01/archive/2006/12/25/89878.html交U赞交口U赞Mon, 25 Dec 2006 05:23:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/25/89878.htmlhttp://www.aygfsteel.com/vip01/comments/89878.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/25/89878.html#Feedback3http://www.aygfsteel.com/vip01/comments/commentRss/89878.htmlhttp://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(
500375);
        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(025);
        formData.left 
= new FormAttachment(030);
        formData.right 
= new FormAttachment(060);
        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(025);
        formData_1.right 
= new FormAttachment(100-32);
        formData_1.bottom 
= new FormAttachment(043);
        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(062);
        formData_2.left 
= new FormAttachment(065);
        text_remark.setLayoutData(formData_2);
        label_remark 
= new Label(composite, SWT.NONE);
        
final FormData formData_3 = new FormData();
        formData_3.top 
= new FormAttachment(440);
        formData_3.bottom 
= new FormAttachment(510);
        formData_3.right 
= new FormAttachment(060);
        formData_3.left 
= new FormAttachment(030);
        label_remark.setLayoutData(formData_3);
        label_remark.setText(
"说明");
        


交口U赞 2006-12-25 13:23 发表评论
]]>
为RCPE序增加关闭提示和关闭到pȝ托盘http://www.aygfsteel.com/vip01/archive/2006/12/25/89875.html交U赞交口U赞Mon, 25 Dec 2006 05:16:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/25/89875.htmlhttp://www.aygfsteel.com/vip01/comments/89875.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/25/89875.html#Feedback7http://www.aygfsteel.com/vip01/comments/commentRss/89875.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/89875.html
加入
    @Override
    public void postWindowClose() {
//退出提C或者最化到托盘代码写在这?br />        super.postWindowClose();//关闭RCPQ不惛_闭就不要写这?br />    }

交口U赞 2006-12-25 13:16 发表评论
]]>
像WEB一L树ŞDRCPhttp://www.aygfsteel.com/vip01/archive/2006/12/22/89464.html交U赞交U赞Fri, 22 Dec 2006 03:10:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/12/22/89464.htmlhttp://www.aygfsteel.com/vip01/comments/89464.htmlhttp://www.aygfsteel.com/vip01/archive/2006/12/22/89464.html#Feedback5http://www.aygfsteel.com/vip01/comments/commentRss/89464.htmlhttp://www.aygfsteel.com/vip01/services/trackbacks/89464.html阅读全文

交U赞 2006-12-22 11:10 发表评论
]]>
RCPE序怎样实现自适应分辩率最大化http://www.aygfsteel.com/vip01/archive/2006/10/30/78180.html交口U赞交U赞Mon, 30 Oct 2006 15:50:00 GMThttp://www.aygfsteel.com/vip01/archive/2006/10/30/78180.htmlhttp://www.aygfsteel.com/vip01/comments/78180.htmlhttp://www.aygfsteel.com/vip01/archive/2006/10/30/78180.html#Feedback0http://www.aygfsteel.com/vip01/comments/commentRss/78180.htmlhttp://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));


交U赞 2006-10-30 23:50 发表评论
]]>
վ֩ģ壺 | | | ֦| | Ͷ| | ɽ| | | | | | | | | ϴ| | | | ƺ| Ȩ| | ¹Ȫ| | | Ԫ| Զ| | α| ֳ| | | | »| | | | ɽ| ɽ| |