Examples of UIRunnable


Examples of org.eclipse.wb.tests.gef.UIRunnable

  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  @DisposeProjectAfter
  public void test_0() throws Exception {
    new UiContext().executeAndCheck(new UIRunnable() {
      public void run(UiContext context) throws Exception {
        TestUtils.runWizard(new PopupPanelWizard(), new StructuredSelection(m_packageFragment));
      }
    }, new UIRunnable() {
      public void run(UiContext context) throws Exception {
        context.useShell("New UiBinder PopupPanel");
        context.getTextByLabel("Name:").setText("MyPopupPanel");
        context.clickButton("Finish");
      }
View Full Code Here

Examples of org.eclipse.wb.tests.gef.UIRunnable

  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  @DisposeProjectAfter
  public void test_0() throws Exception {
    new UiContext().executeAndCheck(new UIRunnable() {
      public void run(UiContext context) throws Exception {
        TestUtils.runWizard(new DialogBoxWizard(), new StructuredSelection(m_packageFragment));
      }
    }, new UIRunnable() {
      public void run(UiContext context) throws Exception {
        context.useShell("New UiBinder DialogBox");
        context.getTextByLabel("Name:").setText("MyDialogBox");
        context.clickButton("Finish");
      }
View Full Code Here

Examples of org.eclipse.wb.tests.gef.UIRunnable

    //
    final Property property = PropertyUtils.getByPath(button, "Events/onClick");
    assertTrue(property.isModified());
    assertEquals("someMethod", getPropertyText(property));
    // do remove
    new UiContext().executeAndCheck(new UIRunnable() {
      public void run(UiContext context) throws Exception {
        property.setValue(Property.UNKNOWN_VALUE);
      }
    }, new UIRunnable() {
      public void run(UiContext context) throws Exception {
        context.useShell("Confirm");
        context.clickButton("OK");
      }
    });
View Full Code Here

Examples of org.eclipse.wb.tests.gef.UIRunnable

    // create dialog
    final AlignStringPropertyEditor.AlignDialog dialog =
        new AlignStringPropertyEditor.AlignDialog(new Shell());
    dialog.setValue("tl?-br");
    // check state
    new UiContext().executeAndCheck(new UIRunnable() {
      public void run(UiContext context) throws Exception {
        dialog.open();
      }
    }, new UIRunnable() {
      public void run(UiContext context) throws Exception {
        context.useShell("Align chooser");
        // check element anchor
        assertGroup(
            (Group) ReflectionUtils.getFieldObject(dialog, "m_elementAnchorGroup"),
View Full Code Here

Examples of org.eclipse.wb.tests.gef.UIRunnable

    animateDialog(property);
    assertEquals("2.png", result[0]);
  }

  private static void animateDialog(final Property property) throws Exception {
    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("url");
        {
          Text text = context.findFirstWidget(Text.class);
          text.setText("2.png");
View Full Code Here

Examples of org.eclipse.wb.tests.gef.UIRunnable

    WidgetInfo button = getObjectByName("button");
    assertNotNull(button);
    // prepare action
    final IAction action = getExposeAction(button, "text");
    // animate
    new UiContext().executeAndCheck(new UIRunnable() {
      public void run(UiContext context) throws Exception {
        action.run();
      }
    }, new UIRunnable() {
      public void run(UiContext context) throws Exception {
        context.useShell("Expose property");
        // prepare widgets
        Text textWidget = context.getTextByLabel("Property name:");
        StyledText previewWidget = (StyledText) context.getControlAfterLabel("Preview:");
View Full Code Here

Examples of org.eclipse.wb.tests.gef.UIRunnable

      // activate
      propertyTable.setInput(new Property[]{property});
      propertyTable.setActiveProperty(property);
      propertyTable.activateEditor(property, null);
      // open dialog and use "Cancel"
      new UiContext().executeAndCheck(new UIRunnable() {
        public void run(UiContext context) throws Exception {
          openCssStyleEditorDialog(propertyTable, property, propertyEditor);
        }
      }, new UIRunnable() {
        public void run(UiContext context) throws Exception {
          context.useShell("CSS Style Editor");
          context.clickButton("Cancel");
        }
      });
      // open dialog and use "OK"
      new UiContext().executeAndCheck(new UIRunnable() {
        public void run(UiContext context) throws Exception {
          openCssStyleEditorDialog(propertyTable, property, propertyEditor);
        }
      }, new UIRunnable() {
        public void run(UiContext context) throws Exception {
          context.useShell("CSS Style Editor");
          context.clickButton("OK");
        }
      });
      assertEditor(getStyleSource(null));
      // open dialog and use "Apply"
      new UiContext().executeAndCheck(new UIRunnable() {
        public void run(UiContext context) throws Exception {
          openCssStyleEditorDialog(propertyTable, property, propertyEditor);
        }
      }, new UIRunnable() {
        public void run(UiContext context) throws Exception {
          context.useShell("CSS Style Editor");
          // make selection in rules
          org.eclipse.swt.widgets.List rulesList =
              context.findWidgets(org.eclipse.swt.widgets.List.class).get(1);
View Full Code Here

Examples of org.eclipse.wb.tests.gef.UIRunnable

    property.setValue("red");
    assertEquals("red", getPropertyText(property));
    callPaint(property);
    assertEquals(getSource(".style {", "  color: red;", "}"), getFileContent(styleFile));
    // animate dialog
    new UiContext().executeAndCheck(new UIRunnable() {
      public void run(UiContext context) throws Exception {
        PropertyEditorPresentation presentation = property.getEditor().getPresentation();
        ReflectionUtils.invokeMethod(
            presentation,
            "onClick(org.eclipse.wb.internal.core.model.property.table.PropertyTable,"
                + "org.eclipse.wb.internal.core.model.property.Property)",
            null,
            property);
      }
    }, new UIRunnable() {
      public void run(UiContext context) throws Exception {
        context.useShell("Color chooser");
        {
          List<ColorsGridComposite> grids = context.findWidgets(ColorsGridComposite.class);
          ColorsGridComposite colorsComposite = grids.get(1);
View Full Code Here

Examples of org.eclipse.wb.tests.gef.UIRunnable

        "  }",
        "}");
    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);
View Full Code Here

Examples of org.eclipse.wb.tests.gef.UIRunnable

    animateDialog(property);
    assertEquals("2.png", result[0]);
  }

  private static void animateDialog(final Property property) throws Exception {
    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("url");
        {
          Text text = context.findFirstWidget(Text.class);
          text.setText("2.png");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.