Package org.eclipse.wb.core.controls

Examples of org.eclipse.wb.core.controls.CSpinner


    return group;
  }

  private static CSpinner createSpiner(Composite parent, String title) {
    new Label(parent, SWT.NONE).setText(title);
    CSpinner spiner = new CSpinner(parent, SWT.BORDER);
    spiner.setMinimum(Integer.MIN_VALUE);
    spiner.setMaximum(Integer.MAX_VALUE);
    GridDataFactory.create(spiner).hintHC(10);
    return spiner;
  }
View Full Code Here


        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);
        setSpinnerValue(context, "Bottom:", 30);
        setSpinnerValue(context, "Left:", 40);
        // reset to default
        context.clickButton("OK");
      }

      private void setSpinnerValue(UiContext context, String text, int value) {
        CSpinner spinner = getSpinner(context, text);
        spinner.setSelection(value);
        spinner.notifyListeners(SWT.Selection, null);
      }

      private CSpinner getSpinner(UiContext context, String text) {
        return (CSpinner) context.getControlAfterLabel(text);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.core.controls.CSpinner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.