Java 类org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText 实例源码

项目:gw4e.project    文件:GraphElementProperties.java   
protected void focusOut(SWTBotGefEditPart part,SWTBotStyledText text,String tab ) {
    editor.setFocus();
    selectPart(part);
    selectTab(part, tab);
    try {
        text.setFocus();
    } catch (Throwable e) {
    }
}
项目:gw4e.project    文件:VertexProperties.java   
public void setInit(SWTBotGefEditPart part, String script) {
    selectPart(part);
    selectTab(part, INIT);
    SWTBotStyledText st = bot.styledTextWithId( WIDGET_ID,  WIDGET_SCRIPT);
    st.setText(script);
    UIThreadRunnable.syncExec(Display.getDefault(), new VoidResult() {
        @Override
        public void run() {
            st.widget.notifyListeners(SWT.FocusOut, null);
            editor.setFocus();
        }
    });
}
项目:gw4e.project    文件:EdgeProperties.java   
public void setGuard(SWTBotGefEditPart part, String script) {
    selectPart(part);
    selectTab(part, GUARD);
    SWTBotStyledText st = bot.styledTextWithId(WIDGET_ID, WIDGET_GUARD_SCRIPT);
    st.setText(script);
    UIThreadRunnable.syncExec(Display.getDefault(), new VoidResult() {
        @Override
        public void run() {
            st.widget.notifyListeners(SWT.FocusOut, null);
            editor.setFocus();
        }
    });
}
项目:gw4e.project    文件:EdgeProperties.java   
public String getGuard(SWTBotGefEditPart part) {
    selectPart(part);
    selectTab(part, GUARD);
    SWTBotStyledText st = bot.styledTextWithId(WIDGET_ID, WIDGET_GUARD_SCRIPT);
    String s = st.getText();
    if (s==null) return "";
    return s;
}
项目:gw4e.project    文件:EdgeProperties.java   
public void setAction(SWTBotGefEditPart part, String script) {
    selectPart(part);
    selectTab(part, ACTION);
    SWTBotStyledText st = bot.styledTextWithId(WIDGET_ID, WIDGET_ACTION_SCRIPT);
    st.setText(script);
    UIThreadRunnable.syncExec(Display.getDefault(), new VoidResult() {
        @Override
        public void run() {
            st.widget.notifyListeners(SWT.FocusOut, null);
            editor.setFocus();
        }
    });
}
项目:gw4e.project    文件:EdgeProperties.java   
public String getAction(SWTBotGefEditPart part) {
    selectPart(part);
    selectTab(part, ACTION);
    SWTBotStyledText st = bot.styledTextWithId(WIDGET_ID, WIDGET_ACTION_SCRIPT);
    String s = st.getText();
    if (s==null) return "";
    return s;
}
项目:gw4e.project    文件:RunAsManualWizard.java   
public void assertTexts(SWTBotShell page, String[] texts) {
    SWTBotStyledText styledText = page.bot().styledText();
    for (String text : texts) {
        if (styledText.getText().indexOf(text) == -1) {
            org.junit.Assert.fail("Text does not contain " + text);
        }
    }
}
项目:gw4e.project    文件:RunAsManualWizard.java   
public void assertActionAndResult(SWTBotShell page, String description, String result) {
    SWTBotStyledText styledTextDescription = page.bot().styledTextWithId(
            org.gw4e.eclipse.wizard.runasmanual.StepPage.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,
            org.gw4e.eclipse.wizard.runasmanual.StepPage.GW4E_STEP_PAGE_DESCRIPTION_ID);
    SWTBotStyledText styledTextResult = page.bot().styledTextWithId(
            org.gw4e.eclipse.wizard.runasmanual.StepPage.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,
            org.gw4e.eclipse.wizard.runasmanual.StepPage.GW4E_STEP_PAGE_RESULT_ID);

    org.junit.Assert.assertEquals("Invalid Result", result, styledTextResult.getText());
    org.junit.Assert.assertEquals("Invalid Description", description, styledTextDescription.getText());
}
项目:gw4e.project    文件:RunAsManualWizard.java   
public StepPage setResult(SWTBotShell page, String result) {
    SWTBotStyledText styledTextResult = page.bot().styledTextWithId(
            org.gw4e.eclipse.wizard.runasmanual.StepPage.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,
            org.gw4e.eclipse.wizard.runasmanual.StepPage.GW4E_STEP_PAGE_RESULT_ID);
    styledTextResult.setText(result);
    return this;
}
项目:google-cloud-eclipse    文件:SwtBotTestingUtilities.java   
/**
 * Wait until the given text widget contains the provided string
 */
public static void waitUntilStyledTextContains(SWTBot bot, final String text,
    final SWTBotStyledText widget) {
  bot.waitUntil(new DefaultCondition() {
    @Override
    public boolean test() throws Exception {
      return widget.getText().contains(text);
    }

    @Override
    public String getFailureMessage() {
      return "Text not found!";
    }
  });
}
项目:gwt-eclipse-plugin    文件:ConsoleViewContains.java   
@Override
public boolean test() throws Exception {
  msg = "Could not open Console view";
  SWTBotView consoleView = bot.viewById("org.eclipse.ui.console.ConsoleView");
  msg = "Could not find textWidget in Console view";
  SWTBotStyledText textWidget = consoleView.bot().styledText();
  msg = "Could not get the text from the Console view";
  String text = textWidget.getText();
  msg = "Looking for: '" + searchString + "' but found \n\t------\n\t" + text + "\n\t-----";

  return text.contains(searchString);
}
项目:gw4e.project    文件:AbstractRunner.java   
public   String getConsoleText() {
    SWTBotView console = waitForConsoleBeDisplayed ();

    SWTBotStyledText textWidget = console.bot().styledText();
    return textWidget.getText();
}