|
Lines 36-43
Link Here
|
| 36 |
import org.eclipse.swt.SWT; |
36 |
import org.eclipse.swt.SWT; |
| 37 |
import org.eclipse.swt.events.DisposeEvent; |
37 |
import org.eclipse.swt.events.DisposeEvent; |
| 38 |
import org.eclipse.swt.events.DisposeListener; |
38 |
import org.eclipse.swt.events.DisposeListener; |
|
|
39 |
import org.eclipse.swt.events.ModifyEvent; |
| 40 |
import org.eclipse.swt.events.ModifyListener; |
| 39 |
import org.eclipse.swt.events.SelectionAdapter; |
41 |
import org.eclipse.swt.events.SelectionAdapter; |
| 40 |
import org.eclipse.swt.events.SelectionEvent; |
42 |
import org.eclipse.swt.events.SelectionEvent; |
|
|
43 |
import org.eclipse.swt.events.VerifyEvent; |
| 44 |
import org.eclipse.swt.events.VerifyListener; |
| 41 |
import org.eclipse.swt.layout.FillLayout; |
45 |
import org.eclipse.swt.layout.FillLayout; |
| 42 |
import org.eclipse.swt.layout.GridData; |
46 |
import org.eclipse.swt.layout.GridData; |
| 43 |
import org.eclipse.swt.layout.GridLayout; |
47 |
import org.eclipse.swt.layout.GridLayout; |
|
Lines 47-53
Link Here
|
| 47 |
import org.eclipse.swt.widgets.Group; |
51 |
import org.eclipse.swt.widgets.Group; |
| 48 |
import org.eclipse.swt.widgets.Label; |
52 |
import org.eclipse.swt.widgets.Label; |
| 49 |
import org.eclipse.swt.widgets.Shell; |
53 |
import org.eclipse.swt.widgets.Shell; |
| 50 |
import org.eclipse.swt.widgets.Spinner; |
54 |
import org.eclipse.swt.widgets.Text; |
| 51 |
import org.eclipse.ui.forms.events.ExpansionAdapter; |
55 |
import org.eclipse.ui.forms.events.ExpansionAdapter; |
| 52 |
import org.eclipse.ui.forms.events.ExpansionEvent; |
56 |
import org.eclipse.ui.forms.events.ExpansionEvent; |
| 53 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
57 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
|
Lines 87-93
Link Here
|
| 87 |
private Button orButton; |
91 |
private Button orButton; |
| 88 |
|
92 |
|
| 89 |
private Button limitButton; |
93 |
private Button limitButton; |
| 90 |
private Spinner limitSpinner; |
94 |
private Text limitText; |
| 91 |
|
95 |
|
| 92 |
private GroupFilterConfigurationArea scopeArea = new ScopeArea(); |
96 |
private GroupFilterConfigurationArea scopeArea = new ScopeArea(); |
| 93 |
private ScrolledForm form; |
97 |
private ScrolledForm form; |
|
Lines 205-212
Link Here
|
| 205 |
boolean limitsEnabled = generator.isMarkerLimitsEnabled(); |
209 |
boolean limitsEnabled = generator.isMarkerLimitsEnabled(); |
| 206 |
limitButton.setSelection(limitsEnabled); |
210 |
limitButton.setSelection(limitsEnabled); |
| 207 |
limitsLabel.setEnabled(limitsEnabled); |
211 |
limitsLabel.setEnabled(limitsEnabled); |
| 208 |
limitSpinner.setEnabled(limitsEnabled); |
212 |
limitText.setEnabled(limitsEnabled); |
| 209 |
limitSpinner.setSelection(limits); |
213 |
limitText.setText(Integer.toString(limits)); |
| 210 |
configsTable.getTable().setFocus(); |
214 |
configsTable.getTable().setFocus(); |
| 211 |
|
215 |
|
| 212 |
} |
216 |
} |
|
Lines 250-256
Link Here
|
| 250 |
|
254 |
|
| 251 |
public void widgetSelected(SelectionEvent e) { |
255 |
public void widgetSelected(SelectionEvent e) { |
| 252 |
limitsLabel.setEnabled(limitButton.getSelection()); |
256 |
limitsLabel.setEnabled(limitButton.getSelection()); |
| 253 |
limitSpinner.setEnabled(limitButton.getSelection()); |
257 |
limitText.setEnabled(limitButton.getSelection()); |
| 254 |
} |
258 |
} |
| 255 |
}); |
259 |
}); |
| 256 |
|
260 |
|
|
Lines 263-276
Link Here
|
| 263 |
limitsLabel = new Label(composite, SWT.NONE); |
267 |
limitsLabel = new Label(composite, SWT.NONE); |
| 264 |
limitsLabel.setText(MarkerMessages.MarkerPreferences_VisibleItems); |
268 |
limitsLabel.setText(MarkerMessages.MarkerPreferences_VisibleItems); |
| 265 |
|
269 |
|
| 266 |
limitSpinner = new Spinner(composite, SWT.BORDER); |
270 |
limitText = new Text(composite, SWT.BORDER); |
| 267 |
limitSpinner.setMinimum(1); |
271 |
GridData textData = new GridData(); |
| 268 |
limitSpinner.setMaximum(Integer.MAX_VALUE); |
272 |
textData.widthHint = convertWidthInCharsToPixels(10); |
| 269 |
limitSpinner.setIncrement(1); |
273 |
limitText.setLayoutData(textData); |
| 270 |
limitSpinner.setPageIncrement(100); |
274 |
limitText.addVerifyListener(new VerifyListener() { |
| 271 |
GridData spinnerData = new GridData(); |
275 |
|
| 272 |
spinnerData.minimumWidth = convertWidthInCharsToPixels(6); |
276 |
public void verifyText(VerifyEvent e) { |
| 273 |
limitSpinner.setLayoutData(spinnerData); |
277 |
if (e.character != 0 && e.keyCode != SWT.BS |
|
|
278 |
&& e.keyCode != SWT.DEL |
| 279 |
&& !Character.isDigit(e.character)) { |
| 280 |
e.doit = false; |
| 281 |
} |
| 282 |
} |
| 283 |
}); |
| 284 |
|
| 285 |
limitText.addModifyListener(new ModifyListener() { |
| 286 |
|
| 287 |
public void modifyText(ModifyEvent e) { |
| 288 |
try { |
| 289 |
Integer.parseInt(limitText.getText()); |
| 290 |
} catch (NumberFormatException ex) { |
| 291 |
// ignore |
| 292 |
} |
| 293 |
} |
| 294 |
}); |
| 274 |
|
295 |
|
| 275 |
} |
296 |
} |
| 276 |
|
297 |
|
|
Lines 422-428
Link Here
|
| 422 |
}); |
443 |
}); |
| 423 |
|
444 |
|
| 424 |
Composite sectionClient = toolkit.createComposite(expandable); |
445 |
Composite sectionClient = toolkit.createComposite(expandable); |
| 425 |
sectionClient.setLayout(new GridLayout()); |
446 |
GridLayout gridLayout = new GridLayout(); |
|
|
447 |
gridLayout.verticalSpacing = 3; |
| 448 |
sectionClient.setLayout(gridLayout); |
| 426 |
sectionClient.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, |
449 |
sectionClient.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, |
| 427 |
false)); |
450 |
false)); |
| 428 |
sectionClient.setBackground(form.getBackground()); |
451 |
sectionClient.setBackground(form.getBackground()); |
|
Lines 669-675
Link Here
|
| 669 |
protected void okPressed() { |
692 |
protected void okPressed() { |
| 670 |
|
693 |
|
| 671 |
generator.setMarkerLimitsEnabled(limitButton.getSelection()); |
694 |
generator.setMarkerLimitsEnabled(limitButton.getSelection()); |
| 672 |
generator.setMarkerLimits(limitSpinner.getSelection()); |
695 |
generator.setMarkerLimits(Integer.parseInt(limitText.getText().trim())); |
| 673 |
|
696 |
|
| 674 |
Iterator filterGroupIterator = filterGroups.iterator(); |
697 |
Iterator filterGroupIterator = filterGroups.iterator(); |
| 675 |
while (filterGroupIterator.hasNext()) { |
698 |
while (filterGroupIterator.hasNext()) { |
|
Lines 707-714
Link Here
|
| 707 |
|
730 |
|
| 708 |
limitButton.setSelection(useMarkerLimits); |
731 |
limitButton.setSelection(useMarkerLimits); |
| 709 |
limitsLabel.setEnabled(useMarkerLimits); |
732 |
limitsLabel.setEnabled(useMarkerLimits); |
| 710 |
limitSpinner.setEnabled(useMarkerLimits); |
733 |
limitText.setEnabled(useMarkerLimits); |
| 711 |
limitSpinner.setSelection(markerLimits); |
734 |
limitText.setText(Integer.toString(markerLimits)); |
| 712 |
|
735 |
|
| 713 |
updateRadioButtonsFromTable(); |
736 |
updateRadioButtonsFromTable(); |
| 714 |
} |
737 |
} |