gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
gridData.widthHint= 0;
gridData.heightHint= SWT.DEFAULT;
gridData.horizontalSpan= 1;
textBugsClosed.setLayoutData(gridData);
textBugsClosed.addVerifyListener(new VerifyListener() {
public void verifyText(VerifyEvent e) {
//检查输入的字符是否为数字0123456789,不在则返回-1
boolean b=("0123456789,".indexOf(e.text)>=0);
e.doit=b;//其含义是如果doit==true,则允许输入,否则不允许
}
});
}
Group groupRequestDescrible = new Group(composite, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 1;
groupRequestDescrible.setLayout(layout);
GridData gdGroupRequestDescrible = new GridData(GridData.FILL_HORIZONTAL);
gdGroupRequestDescrible.horizontalSpan = 1;
groupRequestDescrible.setLayoutData(gdGroupRequestDescrible);
groupRequestDescrible.setText(RbSubclipseMessages.getString("PAGE_DESCRIPTION"));
txtDescription = new Text(groupRequestDescrible, SWT.BORDER | SWT.MULTI);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
gridData.widthHint= 0;
gridData.heightHint= 50;
gridData.horizontalSpan= 1;
txtDescription.setLayoutData(gridData);
comboDescriptionHistory = new Combo(groupRequestDescrible, SWT.READ_ONLY);
//comboDescriptionHistory.setVisibleItemCount( RecentDescriptionBeanListManager.MAX_SIZE + 1 );
comboDescriptionHistory.setVisibleItemCount( 11 );
gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
gridData.widthHint= 0;
gridData.heightHint= SWT.DEFAULT;
gridData.horizontalSpan= 1;
comboDescriptionHistory.setLayoutData(gridData);
List<RecentDescriptionBean> recentDescriptionBeanList = RecentDescriptionBeansManager.getSingletonInstance().getRecentDescriptionBeanList();
int recentDescriptionBeanIndex = 0;
for( RecentDescriptionBean recentDescriptionBean : recentDescriptionBeanList ){
comboDescriptionHistory.add( recentDescriptionBean.getDescriptionShortContent() );
//comboDescriptionHistory.add( recentDescriptionBean.getDecriptionContent() );
comboDescriptionHistory.setData(String.valueOf(recentDescriptionBeanIndex),recentDescriptionBean);
recentDescriptionBeanIndex++ ;
}
comboDescriptionHistory.select(0);
comboDescriptionHistory.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if( comboDescriptionHistory.getSelectionIndex() == 0 ){
return ;
}
String key=String.valueOf(comboDescriptionHistory.getSelectionIndex());
RecentDescriptionBean recentDescriptionBeanSelected= (RecentDescriptionBean)comboDescriptionHistory.getData(key);
if( null != recentDescriptionBeanSelected && null != recentDescriptionBeanSelected.getDecriptionContent()){
txtDescription.setText( recentDescriptionBeanSelected.getDecriptionContent() );
}
}
});
Group groupRequsetInfo = new Group(composite, SWT.NONE);
layout= new GridLayout();
layout.numColumns = 7;
groupRequsetInfo.setLayout(layout);
gridData = new GridData(GridData.FILL_HORIZONTAL);
groupRequsetInfo.setLayoutData(gridData);
groupRequsetInfo.setText(RbSubclipseMessages.getString("PAGE_UPDATE_REQUEST"));
btnUpdateOrCommit = new Button(groupRequsetInfo, SWT.CHECK);
btnUpdateOrCommit.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
btnUpdateOrCommitChanged();
}
});
btnUpdateOrCommit.setToolTipText(RbSubclipseMessages.getString("PAGE_UPDATE_REQUEST"));
btnUpdateOrCommit.setText(RbSubclipseMessages.getString("PAGE_UPDATE_REQUEST"));
Label lblRequestId = new Label(groupRequsetInfo, SWT.NONE);
lblRequestId.setText(RbSubclipseMessages.getString("PAGE_UPDATE_REQUEST_ID"));
textRequestId = new Text(groupRequsetInfo, SWT.BORDER);
textRequestId.setTextLimit(9);
gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gridData.widthHint = 167;
textRequestId.setLayoutData(gridData);
textRequestId.addVerifyListener(new VerifyListener() {
public void verifyText(VerifyEvent e) {
//检查输入的字符是否为数字0123456789,不在则返回-1
boolean b=("0123456789".indexOf(e.text)>=0);
e.doit=b;//其含义是如果doit==true,则允许输入,否则不允许
}