Example usage for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL

List of usage examples for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL.

Prototype

String NEXT_LABEL

To view the source code for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL.

Click Source Link

Document

The label for next buttons.

Usage

From source file:org.bonitasoft.expressions.test.TestPatternExpressionViewer.java

License:Open Source License

private void addDBConnectorWithPatternExpression(String connectorLabel, String connectorVersion,
        String[] dbCategoryLabel, String connectorName) {
    SWTBotTestUtil.selectTabbedPropertyView(bot, "Connectors");
    bot.button("Add...").click();
    bot.text().setText(connectorLabel);/*from  ww w.j  av a2 s . c om*/
    bot.table().select(0);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    //SWTBotConnectorTestUtil.addConnectorToPool(bot, connectorLabel,connectorVersion,dbCategoryLabel, connectorName);
    bot.textWithLabel("Name *").setText(connectorName);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button(IDialogConstants.NEXT_LABEL).click();
}

From source file:org.bonitasoft.expressions.test.TestPatternExpressionViewer.java

License:Open Source License

private void fillPatternExpression() {
    bot.styledText().setText(QUERY);/* w  ww  . jav a2 s. c  om*/
    bot.sleep(1000);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    if (bot.button(IDialogConstants.NEXT_LABEL).isEnabled()) {
        bot.button(IDialogConstants.NEXT_LABEL).click();
    }
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 5000);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    bot.sleep(1000);
    bot.activeEditor().save();
}

From source file:org.bonitasoft.expressions.test.TestPatternExpressionViewer.java

License:Open Source License

private void fillGroovyExpression() {
    bot.link(Messages.switchEditor).click("Switch editor");
    bot.button(IDialogConstants.YES_LABEL).click();
    editGroovyEditor(0, "Request", String.class.getName(), "sqlQuery", GROOVY_SQL_QUERY);
    bot.sleep(1000);//from w  w  w  . j a v a2 s .  co  m
    bot.button(IDialogConstants.NEXT_LABEL).click();
    if (bot.button(IDialogConstants.NEXT_LABEL).isEnabled()) {
        bot.button(IDialogConstants.NEXT_LABEL).click();
    }
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 5000);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    bot.sleep(1000);
    bot.activeEditor().save();
}

From source file:org.bonitasoft.studio.actors.tests.organization.OrganizationCreationTest.java

License:Open Source License

@Test
public void testAddOrganization() {
    final String firstName1 = "Coralie";
    final String lastName1 = "Auclair";
    final String firstName2 = "Vincent";
    final String lastName2 = "Gilbert";
    final String firstName3 = "Martin";
    final String lastName3 = "Dupuis";
    final String organizationName = "Organization1";
    final String[] membership1 = { "/Group1", "Role1" };
    final ArrayList<String[]> membershipList1 = new ArrayList<String[]>();
    membershipList1.add(membership1);/*from   w w  w. j  a  v  a  2  s . c  o m*/
    final ArrayList<String[]> membershipList2 = new ArrayList<String[]>();
    final String[] membership2 = { "/Group1/Group3", "Role2" };
    membershipList2.add(membership2);
    final String[] membership3 = { "/Group1/Group2/Group4", "Role3" };
    membershipList2.add(membership3);
    SWTBotActorFilterUtil.activateNewOrganizationWizard(bot);
    final SWTBotShell shell = bot.shell(Messages.manageOrganizationTitle);
    bot.button(Messages.add).click();
    bot.table(0).select(organizationName);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button(Messages.addParentGroup).click();
    bot.tree().select("Group1");
    bot.button(Messages.addSubGroup).click();
    bot.tree().select("Group1");
    bot.button(Messages.addSubGroup).click();
    bot.tree().getTreeItem("Group1").getNode("Group2").select();
    bot.button(Messages.addSubGroup).click();
    bot.button(Messages.addParentGroup).click();
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button(Messages.add).click();
    bot.button(Messages.add).click();
    bot.button(Messages.add).click();
    bot.button(IDialogConstants.NEXT_LABEL).click();
    String user1 = Messages.defaultUserName + 1;
    String user2 = Messages.defaultUserName + 2;
    String user3 = Messages.defaultUserName + 3;
    addNewUSer(user1, firstName1, lastName1, "", membershipList1);
    SWTBotTable table = bot.table();
    assertEquals("First Name " + firstName1 + " in table should be edited", firstName1,
            table.cell(0, Messages.firstName));
    assertEquals("Last Name " + lastName1 + " in table should be edited", lastName1,
            table.cell(0, Messages.lastName));
    addNewUSer(user2, firstName2, lastName2, user1, membershipList2);
    assertEquals("First Name " + firstName2 + " in table should be edited", firstName2,
            table.cell(1, Messages.firstName));
    assertEquals("Last Name " + lastName2 + " in table should be edited", lastName2,
            table.cell(1, Messages.lastName));
    addNewUSer(user3, firstName3, lastName3, user2, membershipList2);
    assertEquals("First Name " + firstName3 + " in table should be edited", firstName3,
            table.cell(2, Messages.firstName));
    assertEquals("Last Name " + lastName3 + " in table should be edited", lastName3,
            table.cell(2, Messages.lastName));

    bot.table().select(0);
    bot.comboBoxWithLabel(Messages.manager).setSelection(user3);
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 10000);
    bot.button(IDialogConstants.FINISH_LABEL).click();

    bot.waitUntil(Conditions.shellIsActive(Messages.organizationValidationFailed), 10000);
    bot.button(IDialogConstants.OK_LABEL).click();

    bot.table().select(0);
    bot.comboBoxWithLabel(Messages.manager).setSelection("");

    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 10000);
    bot.button(IDialogConstants.FINISH_LABEL).click();

    bot.waitUntil(Conditions.shellCloses(shell));

    OrganizationRepositoryStore store = (OrganizationRepositoryStore) RepositoryManager.getInstance()
            .getRepositoryStore(OrganizationRepositoryStore.class);
    OrganizationFileStore fileStore = store
            .getChild(organizationName + "." + OrganizationRepositoryStore.ORGANIZATION_EXT);
    Organization orga = fileStore.getContent();
    assertNotNull(orga);
    int nbRootGroup = 0;
    for (Group g : orga.getGroups().getGroup()) {
        if (g.getParentPath() == null) {
            nbRootGroup++;
        }
    }
    assertEquals("There should be two root groups", 2, nbRootGroup);
    for (User u : orga.getUsers().getUser()) {
        assertNotNull(u.getMetaDatas());
    }

    synchronizeOrganization(organizationName, user1);
    synchronizeOrganization("ACME", "walter.bates");

}

From source file:org.bonitasoft.studio.actors.tests.organization.OrganizationCreationTest.java

License:Open Source License

private void synchronizeOrganization(String organizationName, String username) {
    SWTBotActorFilterUtil.activateSynchronizeOrganizationWizard(bot);
    bot.table().select(organizationName);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    if (username != null) {
        bot.textWithLabel(Messages.userName).setText(username);
    }// w w w.  j  a v a  2 s  .com
    bot.button(Messages.synchronize).click();
    bot.waitUntil(Conditions.shellIsActive(Messages.synchronizeInformationTitle), 1500000);
    bot.button(IDialogConstants.OK_LABEL).click();
}

From source file:org.bonitasoft.studio.actors.tests.organization.OrganizationCreationTest.java

License:Open Source License

/**
 * @author Florine Boudin//  ww  w. j  a va  2 s. c  om
 * @throws InterruptedException
 */
@Test
public void addNewUsersInACMETest() throws InterruptedException {

    //SWTBotTestUtil.createNewDiagram(bot);
    // open shell "Manage organization"
    bot.menu("Organization").menu("Manage...").click();
    bot.waitUntil(Conditions.shellIsActive(Messages.manageOrganizationTitle));

    SWTBotTable table = bot.table();
    Assert.assertNotNull(table);

    System.out.println("Table size = " + table.columnCount() + " x " + table.rowCount());

    // Set Description of the new Organisation
    int idxBonita = table.indexOf("ACME  (active)", 0);
    Assert.assertTrue("Error: No ACME found in the table", idxBonita != -1);

    // go to the next shell
    table.click(idxBonita, 0);

    for (int i = 0; i < 3; i++) {
        Thread.sleep(1000);
        Assert.assertTrue("Error: The NEXT label button is unavailable",
                bot.button(IDialogConstants.NEXT_LABEL).isEnabled());
        bot.button(IDialogConstants.NEXT_LABEL).click();
    }

    // in the user shell, get table of user list
    table = bot.table();
    Assert.assertNotNull("Error: No user table found", table);

    int nbUsers = table.rowCount();

    //add new user Elton John
    SWTBotButton addButton = bot.button("Add");

    addButton.click();

    Assert.assertEquals("Error : wrong number of added users", nbUsers + 1, table.rowCount());

    bot.textWithLabel(Messages.userName).setText("elton.john");
    bot.textWithLabel(Messages.password).setText("bpm");

    bot.comboBoxWithLabel(Messages.manager).setSelection("william.jobs");
    Assert.assertEquals("Error: Manager is not selected", "william.jobs",
            bot.comboBoxWithLabel(Messages.manager).getText());

    bot.tabItem("General").activate();
    bot.textWithLabel(Messages.firstName).setText("Elton");
    bot.textWithLabel(Messages.lastName).setText("John");

    Assert.assertEquals("Error: First name user is not setted", "Elton",
            bot.textWithLabel(Messages.firstName).getText());
    Assert.assertEquals("Error: Last name user is not setted", "John",
            bot.textWithLabel(Messages.lastName).getText());

    bot.tabItem(Messages.membership).activate();
    bot.button(Messages.addMembership).click();
    bot.comboBoxWithLabel("Group").setSelection("/acme");
    bot.comboBoxWithLabel("Role").setSelection("member");

    // Finish the user add
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)));
    bot.button(IDialogConstants.FINISH_LABEL).click();
    bot.button(IDialogConstants.NO_LABEL).click();
}

From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorDefinitionTranslationsTest.java

License:Open Source License

private void openActorFilterDefinitionWizardPage(String id) throws Exception {
    final String packageLang = "java.lang.";
    final String packageUtil = "java.util.";
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    Keyboard key = KeyboardFactory.getSWTKeyboard();
    SWTBotActorFilterUtil.activateActorFilterDefinitionShell(bot);
    bot.textWithLabel("Definition id *").setText(id);
    SWTBotActorFilterUtil.createNewCategory(bot, "categoryAFDWP1");
    bot.button(IDialogConstants.NEXT_LABEL).click();
    SWTBotTable table = bot.table();//ww  w  . j  av a  2 s . c  om
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    table.click(1, 2);
    bot.ccomboBox().setSelection(packageLang + "Boolean");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(2, 2);
    bot.ccomboBox().setSelection(packageLang + "Double");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(3, 2);
    bot.ccomboBox().setSelection(packageLang + "Float");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(4, 2);
    bot.ccomboBox().setSelection(packageLang + "Integer");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(5, 2);
    bot.ccomboBox().setSelection(packageUtil + "List");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(6, 2);
    bot.ccomboBox().setSelection(packageUtil + "Map");
    key.pressShortcut(Keystrokes.CR);
    bot.button(IDialogConstants.NEXT_LABEL).click();

}

From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorDefinitionTranslationsTest.java

License:Open Source License

@Test
public void testActorFilterDefinitionTranslation() throws Exception {
    final String language = "en";
    bot.button(IDialogConstants.NEXT_LABEL).click();
    int line = bot.table().indexOf(language, "Locale");
    bot.table().getTableItem(line).check();
    bot.button(IDialogConstants.FINISH_LABEL).click();
    ActorFilterDefRepositoryStore store = (ActorFilterDefRepositoryStore) RepositoryManager.getInstance()
            .getRepositoryStore(ActorFilterDefRepositoryStore.class);
    DefinitionResourceProvider resourceProvider = DefinitionResourceProvider.getInstance(store,
            ActorsPlugin.getDefault().getBundle());
    List<File> resources = resourceProvider
            .getExistingLocalesResource(store.getDefinition("testTranslationWizardPage", "1.0.0"));
    assertEquals("resources list should contain 2 resources", resources.size(), 2);
    for (File file : resources) {
        if (file.getName().contains("_en")) {
            Properties properties = new Properties();
            InputStream stream = new FileInputStream(file);
            properties.load(stream);/*  w w w . java 2  s .  c o  m*/
            assertTrue("properties file doesn't contain key widgetTest4.description",
                    properties.containsKey("widgetTest4.description"));
            assertTrue("properties file doesn't contain key widgetTest2.description",
                    properties.containsKey("widgetTest2.description"));
            assertTrue("properties file doesn't contain key widgetTest0.description",
                    properties.containsKey("widgetTest0.description"));
            assertTrue("properties file doesn't contain key widgetTest5.description",
                    properties.containsKey("widgetTest5.description"));
            assertTrue("properties file doesn't contain key widgetTest3.description",
                    properties.containsKey("widgetTest3.description"));
            assertTrue("properties file doesn't contain key widgetTest1.description",
                    properties.containsKey("widgetTest1.description"));
            assertTrue("properties file doesn't contain key widgetTest4.label",
                    properties.containsKey("widgetTest4.label"));
            assertTrue("properties file doesn't contain key widgetTest2.label",
                    properties.containsKey("widgetTest2.label"));
            assertTrue("properties file doesn't contain key widgetTest0.label",
                    properties.containsKey("widgetTest0.label"));
            assertTrue("properties file doesn't contain key widgetTest5.label",
                    properties.containsKey("widgetTest5.label"));
            assertTrue("properties file doesn't contain key widgetTest3.label",
                    properties.containsKey("widgetTest3.label"));
            assertTrue("properties file doesn't contain key widgetTest1.label",
                    properties.containsKey("widgetTest1.label"));
            assertTrue("properties file doesn't contain key category1.category",
                    properties.containsKey("categoryAFDWP1.category"));
            assertTrue("properties file doesn't contain key pageTest.pageDescription",
                    properties.containsKey("pageTest.pageDescription"));
            assertTrue("properties file doesn't contain key pageTest.pageTitle",
                    properties.containsKey("pageTest.pageTitle"));
            stream.close();
        }

    }

}

From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterDefinitionTest.java

License:Open Source License

@Test
public void testCreateActorFilterDefinition() {
    final String id = "test0";
    final String version = "1.0.0";
    bot.textWithLabel("Definition id *").setText(id);
    assertTrue(IDialogConstants.NEXT_LABEL + " should be enabled",
            bot.button(IDialogConstants.NEXT_LABEL).isEnabled());
    assertTrue(IDialogConstants.FINISH_LABEL + " should be enabled",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.button(IDialogConstants.FINISH_LABEL).click();
    ActorFilterDefRepositoryStore store = (ActorFilterDefRepositoryStore) RepositoryManager.getInstance()
            .getRepositoryStore(ActorFilterDefRepositoryStore.class);
    ConnectorDefinition actorDefinition = store.getDefinition(id, version);
    assertNotNull("the actorDef file was not created", actorDefinition);
}

From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterDefinitionTest.java

License:Open Source License

@Test
public void testAddInputs() throws Exception {
    final String id = "test5";
    final String textLabel = "Definition id *";
    final String version = "1.0.0";
    final String inputName = "testInput";
    final String mandatory = "Mandatory";
    final String value = "hello";
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    bot.textWithLabel(textLabel).setText(id);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button("Remove")), 5000);
    bot.button("Remove").click();
    SWTBotTable table = bot.table();//from  w  ww  . j  a  v  a  2 s  .  c  om
    table.click(0, 0);
    bot.sleep(500);
    bot.text(0).setText(inputName);
    table.click(0, 1);
    bot.ccomboBox().setSelection(mandatory);
    Keyboard key = KeyboardFactory.getSWTKeyboard();
    key.pressShortcut(Keystrokes.CR);
    bot.waitUntil(Conditions.widgetIsEnabled(table));
    table.click(0, 3);
    bot.text().setText("hello");
    bot.button(IDialogConstants.FINISH_LABEL).click();
    ActorFilterDefRepositoryStore store = (ActorFilterDefRepositoryStore) RepositoryManager.getInstance()
            .getRepositoryStore(ActorFilterDefRepositoryStore.class);
    ConnectorDefinition actorDefinition = store.getDefinition(id, version);
    assertEquals("wrong number of inputs", actorDefinition.getInput().size(), 2);
    Input input = actorDefinition.getInput().get(0);
    assertEquals("wrong input name", input.getName(), inputName);
    assertEquals("wrong input value", input.getDefaultValue(), value);
    assertTrue("input should be mandatory", input.isMandatory());
}