* Allow the user to chose to save the patch to the workspace or outside
* of the workspace.
*/
public void createControlDetail(Composite composite) {
RbConfig rbConfig = RbConfigReader.getRbConfig(null);
createPreOrPostInfo(composite);
GridLayout layout= new GridLayout();
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
Group groupSummary = new Group(composite, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 2;
groupSummary.setLayout(layout);
groupSummary.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
groupSummary.setText(RbSubclipseMessages.getString("PAGE_SUMMARY"));
Label lblSummary = new Label(groupSummary, SWT.NONE);
lblSummary.setText(RbSubclipseMessages.getString("PAGE_SUMMARY"));
txtSummary = new Text(groupSummary, SWT.BORDER);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
gridData.widthHint= 0;
gridData.heightHint= SWT.DEFAULT;
gridData.horizontalSpan= 1;
txtSummary.setLayoutData(gridData);
Group groupAttribute = new Group(composite, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 4;
groupAttribute.setLayout(layout);
gridData = new GridData(GridData.FILL_HORIZONTAL);
groupAttribute.setLayoutData( gridData );
groupAttribute.setText(RbSubclipseMessages.getString("PAGE_ATTRIBUTES"));
Label lblRepository = new Label(groupAttribute, SWT.NONE);
lblRepository.setText(RbSubclipseMessages.getString("PAGE_REPOSITORIES"));
Label lblRepositoryValue = new Label(groupAttribute, SWT.NONE);
ModelRepository repository = this.getSelectedRepository();
if( null == repository ){
lblRepositoryValue.setText("");
}else{
lblRepositoryValue.setText(repository.getName());
}
if( rbConfig.isAllowOptionBugClosed() ){
Label lblTmp = new Label(groupAttribute, SWT.NONE);
lblTmp.setText("");
lblTmp = new Label(groupAttribute, SWT.NONE);
lblTmp.setText("");
}
Label lblGroup = new Label(groupAttribute, SWT.NONE);
lblGroup.setText(RbSubclipseMessages.getString("PAGE_GROUPS"));
txtGroup = new Text(groupAttribute, SWT.BORDER);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
gridData.widthHint= 0;
gridData.heightHint= SWT.DEFAULT;
gridData.horizontalSpan= 1;
txtGroup.setLayoutData(gridData);
txtGroupCompleteField = new AutoCompleteField(txtGroup, new TextContentAdapter(), new String[] {});
txtGroupCompleteField.setProposals( reviewGroupNameList.toArray(new String[reviewGroupNameList.size()]) );
txtGroup.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
List<String> proposalTmp = getNewListForProposal( reviewGroupNameList, txtGroup.getText() );
txtGroupCompleteField.setProposals( proposalTmp.toArray(new String[proposalTmp.size()]) );
}
});
Label lblBranch = new Label(groupAttribute, SWT.NONE);
lblBranch.setText(RbSubclipseMessages.getString("PAGE_BRANCHES"));
textBranch = new Text(groupAttribute, SWT.BORDER);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
gridData.widthHint= 0;
gridData.heightHint= SWT.DEFAULT;
gridData.horizontalSpan= 1;
textBranch.setLayoutData(gridData);
textBranch.setEnabled(false);
Label lblPeople = new Label(groupAttribute, SWT.NONE);
lblPeople.setText(RbSubclipseMessages.getString("PAGE_REVIEWPEOPLES"));
txtPeople = new Text(groupAttribute, SWT.BORDER);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
gridData.widthHint= 0;
gridData.heightHint= SWT.DEFAULT;
gridData.horizontalSpan= 1;
txtPeople.setLayoutData(gridData);
txtPeopleCompleteField = new AutoCompleteField(txtPeople, new TextContentAdapter(), new String[] {});
txtPeopleCompleteField.setProposals( userNameList.toArray(new String[userNameList.size()]) );
txtPeople.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
List<String> proposalTmp = getNewListForProposal( userNameList, txtPeople.getText() );
txtPeopleCompleteField.setProposals( proposalTmp.toArray(new String[proposalTmp.size()]) );
}
});
if( rbConfig.isAllowOptionBugClosed() ){
Label lblBugsClosed = new Label(groupAttribute, SWT.NONE);
lblBugsClosed.setText(RbSubclipseMessages.getString("PAGE_BUGCLOSED"));
textBugsClosed = new Text(groupAttribute, SWT.BORDER);
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,则允许输入,否则不允许
}
});
textRequestId.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
//validatePage();
}
});
//将本次提交保存草稿
btnIsDraft = new Button(groupRequsetInfo, SWT.CHECK);
btnIsDraft.setText(RbSubclipseMessages.getString("PAGE_SAVE_AS_DRAFT"));
btnIsDraft.setVisible( rbConfig.isAllowDraft() );
}