|
Lines 14-19
Link Here
|
| 14 |
import org.eclipse.core.runtime.IStatus; |
14 |
import org.eclipse.core.runtime.IStatus; |
| 15 |
import org.eclipse.core.runtime.ListenerList; |
15 |
import org.eclipse.core.runtime.ListenerList; |
| 16 |
import org.eclipse.jface.action.LegacyActionTools; |
16 |
import org.eclipse.jface.action.LegacyActionTools; |
|
|
17 |
import org.eclipse.swt.SWT; |
| 18 |
import org.eclipse.swt.graphics.Image; |
| 19 |
import org.eclipse.swt.layout.GridData; |
| 20 |
import org.eclipse.swt.widgets.Button; |
| 17 |
import org.eclipse.swt.widgets.Composite; |
21 |
import org.eclipse.swt.widgets.Composite; |
| 18 |
import org.eclipse.swt.widgets.Control; |
22 |
import org.eclipse.swt.widgets.Control; |
| 19 |
import org.eclipse.ui.IPropertyListener; |
23 |
import org.eclipse.ui.IPropertyListener; |
|
Lines 32-37
Link Here
|
| 32 |
private boolean fSuppressPropertyChanges = false; |
36 |
private boolean fSuppressPropertyChanges = false; |
| 33 |
|
37 |
|
| 34 |
/** |
38 |
/** |
|
|
39 |
* Avoids the SWT Factory that sets the font to be the dialog font. Does not set dimension hints. |
| 40 |
* |
| 41 |
* @param parent the parent to add the button to |
| 42 |
* @param label the label for the button |
| 43 |
* @param image the image for the button |
| 44 |
* @param checked the initial checked state of the button |
| 45 |
* @param hspan the horizontal span to take up in the parent composite |
| 46 |
* @return a new checked button set to the initial checked state |
| 47 |
* @since 3.3 |
| 48 |
*/ |
| 49 |
public static Button createCheckButton(Composite parent, String label, Image image, boolean checked, int hspan) { |
| 50 |
Button button = new Button(parent, SWT.CHECK); |
| 51 |
button.setFont(parent.getFont()); |
| 52 |
button.setSelection(checked); |
| 53 |
if(image != null) { |
| 54 |
button.setImage(image); |
| 55 |
} |
| 56 |
if(label != null) { |
| 57 |
button.setText(label); |
| 58 |
} |
| 59 |
GridData gd = new GridData(); |
| 60 |
gd.horizontalSpan = hspan; |
| 61 |
button.setLayoutData(gd); |
| 62 |
return button; |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* Avoids SWT Factory that set the font to be the dialog font. Does not set dimension hints. |
| 67 |
* |
| 68 |
* @param parent parent control |
| 69 |
* @param label button label or <code>null</code> |
| 70 |
* @param hspan the number of columns to span in the parent composite |
| 71 |
* |
| 72 |
* @return a new radio button |
| 73 |
* @since 3.6 |
| 74 |
*/ |
| 75 |
public static Button createRadioButton(Composite parent, String label, int hspan) { |
| 76 |
Button button = new Button(parent, SWT.RADIO); |
| 77 |
button.setFont(parent.getFont()); |
| 78 |
if (label != null) { |
| 79 |
button.setText(label); |
| 80 |
} |
| 81 |
GridData gd = new GridData(GridData.BEGINNING); |
| 82 |
gd.horizontalSpan = hspan; |
| 83 |
button.setLayoutData(gd); |
| 84 |
return button; |
| 85 |
} |
| 86 |
|
| 87 |
/** |
| 35 |
* Adds the given property listener to this editor. Property changes |
88 |
* Adds the given property listener to this editor. Property changes |
| 36 |
* are reported on the breakpoint being edited. Property identifiers |
89 |
* are reported on the breakpoint being edited. Property identifiers |
| 37 |
* are breakpoint attribute keys. |
90 |
* are breakpoint attribute keys. |