Package org.eclipse.wb.core.editor

Examples of org.eclipse.wb.core.editor.IDesignPageSite


    assertEquals("<comparator>", property.getValue());
    assertEquals("<comparator>", getPropertyText(property));
    // open Comparator
    {
      // set mock for DesignPageSite
      IDesignPageSite pageSite;
      Capture<Integer> openSourcePosition = new Capture<Integer>();
      {
        pageSite = EasyMock.createStrictMock(IDesignPageSite.class);
        pageSite.openSourcePosition(capture(openSourcePosition));
        EasyMock.replay(pageSite);
        // do set
        DesignPageSite.Helper.setSite(column, pageSite);
      }
      // ask open
View Full Code Here


      BindingInfo binding = (BindingInfo) ibinding;
      String source = binding.getDefinitionSource();
      //
      if (source != null) {
        int position = m_javaInfoRoot.getEditor().getEnclosingNode(source).getStartPosition();
        IDesignPageSite site = IDesignPageSite.Helper.getSite(m_javaInfoRoot);
        site.openSourcePosition(position);
      }
    } catch (Throwable e) {
    }
  }
View Full Code Here

            "  }",
            "}");
    dialog.refresh();
    DialogButton_Info button = dialog.getDialogButtons().get(0);
    // set mock for DesignPageSite
    IDesignPageSite pageSite;
    Capture<Integer> openSourcePosition = new Capture<Integer>();
    {
      pageSite = EasyMock.createStrictMock(IDesignPageSite.class);
      DesignPageSite.Helper.setSite(dialog, pageSite);
      pageSite.openSourcePosition(org.easymock.EasyMock.capture(openSourcePosition));
      EasyMock.replay(pageSite);
    }
    // open
    button.open();
    waitEventLoop(0);
    assertEditor(
        "// filler filler filler",
        "public class Test extends Dialog {",
        "  public Test() {",
        "  }",
        "  protected void onButtonPressed(Button button) {",
        "    if (button == getButtonBar().getItemByItemId(OK)) {",
        "      // TODO",
        "    }",
        "    super.onButtonPressed(button);",
        "  }",
        "}");
    EasyMock.verify(pageSite);
    // check captured position
    {
      assertTrue(openSourcePosition.hasCaptured());
      int position = openSourcePosition.getValue();
      assertThat(position).isPositive();
      assertThat(m_lastEditor.getSource().substring(position)).startsWith(
          "if (button == getButtonBar().getItemByItemId(OK)) {");
    }
    // open it again, same position expected
    {
      String expectedsource = m_lastEditor.getSource();
      // reset mock
      {
        EasyMock.reset(pageSite);
        pageSite.openSourcePosition(openSourcePosition.getValue());
        EasyMock.replay(pageSite);
      }
      // open
      button.open();
      assertEquals(expectedsource, m_lastEditor.getSource());
View Full Code Here

            "  }",
            "}");
    dialog.refresh();
    DialogButton_Info button = dialog.getDialogButtons().get(0);
    // set mock for DesignPageSite
    IDesignPageSite pageSite;
    {
      pageSite = EasyMock.createStrictMock(IDesignPageSite.class);
      DesignPageSite.Helper.setSite(dialog, pageSite);
      pageSite.openSourcePosition(org.easymock.EasyMock.anyInt());
      EasyMock.replay(pageSite);
    }
    // open
    button.open();
    waitEventLoop(0);
View Full Code Here

      assertNotNull(eventManager);
      action = findChildAction(eventManager, "Select");
      assertNotNull(action);
    }
    // set mock for DesignPageSite
    IDesignPageSite pageSite;
    Capture<Integer> openSourcePosition = new Capture<Integer>();
    {
      pageSite = EasyMock.createStrictMock(IDesignPageSite.class);
      pageSite.openSourcePosition(capture(openSourcePosition));
      EasyMock.replay(pageSite);
      // do set
      DesignPageSite.Helper.setSite(button, pageSite);
    }
    // run action
View Full Code Here

      assertNotNull(eventManager);
      action = findChildAction(eventManager, "Select");
      assertNotNull(action);
    }
    // set mock for DesignPageSite
    IDesignPageSite pageSite;
    Capture<Integer> openSourcePosition = new Capture<Integer>();
    {
      pageSite = EasyMock.createStrictMock(IDesignPageSite.class);
      pageSite.openSourcePosition(capture(openSourcePosition));
      EasyMock.replay(pageSite);
      // do set
      DesignPageSite.Helper.setSite(button, pageSite);
    }
    // run action
View Full Code Here

  }

  private void check_menuItem_openCommand0(JavaInfo rootJavaInfo, RunnableEx runnable)
      throws Exception {
    // set mock for DesignPageSite
    IDesignPageSite pageSite;
    Capture<Integer> openSourcePosition = new Capture<Integer>();
    {
      pageSite = EasyMock.createStrictMock(IDesignPageSite.class);
      pageSite.openSourcePosition(capture(openSourcePosition));
      EasyMock.replay(pageSite);
      // do set
      DesignPageSite.Helper.setSite(rootJavaInfo, pageSite);
    }
    // open Command
View Full Code Here

            "}");
    refresh();
    MenuBarInfo bar = getJavaInfoByName("bar");
    MenuItemInfo item = bar.getItems().get(0);
    // set mock for DesignPageSite
    IDesignPageSite pageSite;
    Capture<Integer> openSourcePosition = new Capture<Integer>();
    {
      pageSite = EasyMock.createStrictMock(IDesignPageSite.class);
      pageSite.openSourcePosition(capture(openSourcePosition));
      EasyMock.replay(pageSite);
      // do set
      DesignPageSite.Helper.setSite(frame, pageSite);
    }
    // open Command
View Full Code Here

TOP

Related Classes of org.eclipse.wb.core.editor.IDesignPageSite

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.