private void createDispalyRowLimitGroup(Composite cmpTop) { Group dispalyRowLimitGroup = new Group(cmpTop, SWT.NONE); dispalyRowLimitGroup.setText( Messages.getString( "designer.preview.preference.resultset.groupTitle.DispalyRowLimitsSetting")); GridLayout layout = new GridLayout(); layout.makeColumnsEqualWidth = true; layout.marginWidth = layout.marginHeight = 6; dispalyRowLimitGroup.setLayout(layout); GridData groupData = new GridData(GridData.FILL_HORIZONTAL); groupData.horizontalSpan = 2; dispalyRowLimitGroup.setLayoutData(groupData); Composite container = new Composite(dispalyRowLimitGroup, SWT.NONE); container.setLayoutData(new GridData(GridData.FILL_BOTH)); noLimitBtn = new Button(container, SWT.CHECK); GridData noLimitBtnData = new GridData(GridData.FILL_HORIZONTAL); noLimitBtnData.horizontalSpan = 2; noLimitBtn.setText( Messages.getString("designer.preview.preference.resultset.NoLimitOfDispalyRow")); noLimitBtn.setLayoutData(noLimitBtnData); noLimitBtn.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { txtMaxDataSetRow.setEnabled(!noLimitBtn.getSelection(), noLimitBtn.getParent()); if (!noLimitBtn.getSelection()) { txtMaxDataSetRow.setFocus(); } if (txtMaxDataSetRow.checkState()) {} } }); txtMaxDataSetRow = new DisplayNumberFieldEditor( PREVIEW_MAXROW, Messages.getString( "designer.preview.preference.resultset.maxrow.description"), //$NON-NLS-1$ container); txtMaxDataSetRow.setPage(this); txtMaxDataSetRow.setValidRange(1, Integer.MAX_VALUE); txtMaxDataSetRow.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); txtMaxDataSetRow.setEmptyStringAllowed(false); txtMaxDataSetRow.setPropertyChangeListener( new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) setValid(txtMaxDataSetRow.isValid()); } }); }