" }",
"}");
assertTrue(property.isModified());
assertEquals("(1, 2, 3, 4)", getPropertyText(property));
// remove value using editor
new UiContext().executeAndCheck(new UIRunnable() {
public void run(UiContext context) throws Exception {
openPropertyDialog(property);
}
}, new UIRunnable() {
public void run(UiContext context) throws Exception {
context.useShell("margins");
// check existing values
assertEquals(1, getSpinnerValue(context, "Top:"));
assertEquals(2, getSpinnerValue(context, "Right:"));
assertEquals(3, getSpinnerValue(context, "Bottom:"));
assertEquals(4, getSpinnerValue(context, "Left:"));
// reset to default
context.clickButton("Default");
}
private int getSpinnerValue(UiContext context, String text) {
Control control = context.getControlAfterLabel(text);
CSpinner spinner = (CSpinner) control;
return spinner.getSelection();
}
});
assertEditor(
"public class Test extends LayoutContainer {",
" public Test() {",
" FlowLayout flowLayout = new FlowLayout();",
" setLayout(flowLayout);",
" }",
"}");
assertFalse(property.isModified());
assertEquals(null, getPropertyText(property));
// set value using editor
new UiContext().executeAndCheck(new UIRunnable() {
public void run(UiContext context) throws Exception {
openPropertyDialog(property);
}
}, new UIRunnable() {
public void run(UiContext context) throws Exception {
context.useShell("margins");
// check existing values
setSpinnerValue(context, "Top:", 10);
setSpinnerValue(context, "Right:", 20);