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

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

Introduction

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

Prototype

String FINISH_LABEL

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

Click Source Link

Document

The label for finish buttons.

Usage

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorEditionTest.java

License:Open Source License

@Test
public void testVersionEdit() throws Exception {
    final String id = "testEdit3";
    final String version = "1.0.0";
    final String version2 = "1.0.1";
    SWTBotConnectorTestUtil.activateConnectorDefinitionShell(bot);
    SWTBotConnectorTestUtil.createConnectorDefinition(bot, id, version);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    SWTBotConnectorTestUtil.activateConnectorDefEditionShell(bot);
    bot.tree().setFocus();/*  ww w . j a  va2  s  . c  o  m*/
    bot.waitUntil(Conditions.widgetIsEnabled(
            bot.tree().select("Uncategorized").expandNode("Uncategorized").select(id + " (" + version + ")")),
            10000);
    bot.tree().select("Uncategorized").expandNode("Uncategorized").select(id + " (" + version + ")");
    bot.button(Messages.Edit).click();
    bot.textWithLabel("Version *").setText(version2);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    ConnectorDefRepositoryStore store = (ConnectorDefRepositoryStore) RepositoryManager.getInstance()
            .getRepositoryStore(ConnectorDefRepositoryStore.class);
    ConnectorDefinition connectorDef = store.getDefinition(id, version);
    ConnectorDefinition connectorDef2 = store.getDefinition(id, version2);
    assertNull("the connectorDef with previous version shouldn't exist anymore", connectorDef);
    assertNotNull("the connectorDef with new version does not exist", connectorDef2);
    removeConnectorDefinition(id, version2);
}

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorEditionTest.java

License:Open Source License

@Test
public void testAddCategory() throws Exception {
    final String id = "testEdit4";
    final String version = "1.0.0";

    SWTBotConnectorTestUtil.activateConnectorDefinitionShell(bot);
    SWTBotConnectorTestUtil.createConnectorDefinition(bot, id, version);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    SWTBotConnectorTestUtil.activateConnectorDefEditionShell(bot);
    bot.tree().setFocus();/*from w  w w.j  a  v  a2  s . c om*/
    bot.waitUntil(Conditions
            .widgetIsEnabled(bot.tree().expandNode("Uncategorized").select(id + " (" + version + ")")), 10000);
    bot.tree().select("Uncategorized").expandNode("Uncategorized").select(id + " (" + version + ")");
    bot.button(Messages.Edit).click();
    bot.treeWithLabel(Messages.categoryLabel).select(0);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    ConnectorDefRepositoryStore store = (ConnectorDefRepositoryStore) RepositoryManager.getInstance()
            .getRepositoryStore(ConnectorDefRepositoryStore.class);
    ConnectorDefinition connectorDef = store.getDefinition(id, version);
    assertEquals("category size should be equal to 1", 1, connectorDef.getCategory().size());
    DefinitionResourceProvider messageProvider = DefinitionResourceProvider.getInstance(store,
            ConnectorPlugin.getDefault().getBundle());
    SWTBotConnectorTestUtil.activateConnectorDefEditionShell(bot);
    final Category category = connectorDef.getCategory().get(0);
    String categoryLabel = messageProvider.getCategoryLabel(category);
    if (categoryLabel == null) {
        categoryLabel = category.getId();
    }
    final String connectorLabel = new ConnectorDefinitionTreeLabelProvider(messageProvider)
            .getText(connectorDef);
    assertNotNull("could not find " + connectorLabel,
            bot.tree().getTreeItem(categoryLabel).expand().getNode(connectorLabel));
    bot.button(IDialogConstants.CANCEL_LABEL).click();
}

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorImplementationTest.java

License:Open Source License

@Test
public void createConnectorImplementation() throws Exception {
    // TODO add dependancies test
    final int nbEditorsBefore = bot.editors().size();
    final String id = "testImplementation";
    final String definition = "testEdit";
    final String className = "MyConnectorImpl";
    final String packageName = "org.bonita.connector.test";
    SWTBotConnectorTestUtil.activateConnectorImplementationShell(bot);

    assertFalse("Finish button should be disabled", bot.button(IDialogConstants.FINISH_LABEL).isEnabled());

    selectDefinition(definition);//from   w w  w.  ja  v a 2s . c o  m

    bot.textWithLabel("Implementation id *").setText(id);

    bot.textWithLabel("Class name *").setText(className);
    bot.textWithLabel("Package *").setText(packageName);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    ConnectorImplRepositoryStore store = (ConnectorImplRepositoryStore) RepositoryManager.getInstance()
            .getRepositoryStore(ConnectorImplRepositoryStore.class);
    ConnectorImplementation connectorImpl = store.getImplementation(id, "1.0.0");
    assertNotNull("connectorImplementation" + id + " was not created", connectorImpl);
    assertEquals("connectorImplementation id should be " + id, connectorImpl.getImplementationId(), id);

    bot.waitUntil(new ICondition() {

        public boolean test() throws Exception {
            return nbEditorsBefore + 1 == bot.editors().size();
        }

        public void init(SWTBot bot) {
        }

        public String getFailureMessage() {
            return "Editor for implementation has not been opened.";
        }
    }, 30000);
    int length = bot.activeEditor().toTextEditor().getText().length();
    Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, Repository.NULL_PROGRESS_MONITOR);
    Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, Repository.NULL_PROGRESS_MONITOR);
    bot.sleep(1000);
    StyleRange[] styles = bot.activeEditor().toTextEditor().getStyles(0, 0, length);
    containsError(styles);
    removeImplementation(id);
}

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorImplementationTest.java

License:Open Source License

@Test
public void testPackageSyntax() throws Exception {
    final String id = "testImplementation";
    final String definition = "testEdit";
    final String className = "MyConnectorImpl";
    final String packageName = "org.bonita.connector.";
    SWTBotConnectorTestUtil.activateConnectorImplementationShell(bot);

    selectDefinition(definition);//  w w  w  .  j  a v  a  2 s  . c o m

    bot.textWithLabel("Implementation id *").setText(id);
    bot.textWithLabel("Class name *").setText(className);
    bot.textWithLabel("Package *").setText(packageName);
    assertFalse("finish button should be desabled", bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.button(IDialogConstants.CANCEL_LABEL).click();
}

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorImplementationTest.java

License:Open Source License

@Test
public void testClassNameSyntax() throws Exception {
    final String id = "testImplementation";
    final String definition = "testEdit";
    final String packageName = "org.bonita.connector";
    SWTBotConnectorTestUtil.activateConnectorImplementationShell(bot);
    selectDefinition(definition);/*from   w  ww.  j a v  a  2  s . c om*/
    bot.textWithLabel(Messages.implementationId + " *").setText(id);
    bot.textWithLabel("Package *").setText(packageName);
    bot.textWithLabel(Messages.classNameLabel + " *").setText("MyConnector.Implsfgsdf");
    bot.waitUntil(new DefaultCondition() {

        public boolean test() throws Exception {
            return !bot.button(IDialogConstants.FINISH_LABEL).isEnabled();
        }

        public String getFailureMessage() {
            return "finish button should be disabled";
        }
    });
    bot.button(IDialogConstants.CANCEL_LABEL).click();
}

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorImplementationTest.java

License:Open Source License

@Test
public void testConnectorImplementationEdition() {
    final int nbEditorsBefore = bot.editors().size();
    SWTBotConnectorTestUtil.activateConnectorImplementationShell(bot);
    final String id = "testImplementation2";
    final String id2 = "textImplementation3";
    final String definition = "testEdit";
    final String className = "MyConnectorImpl2";
    final String packageName = "org.bonita.connector.test";

    selectDefinition(definition);/*from w w w  . j  a  va 2  s .c  o  m*/

    bot.textWithLabel("Implementation id *").setText(id);
    bot.textWithLabel("Class name *").setText(className);
    bot.textWithLabel("Package *").setText(packageName);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    bot.waitUntil(new ICondition() {

        public boolean test() throws Exception {
            return nbEditorsBefore + 1 == bot.editors().size();
        }

        public void init(SWTBot bot) {
        }

        public String getFailureMessage() {
            return "Editor for implementation has not been opened.";
        }
    }, 30000);
    bot.menu("Development").menu("Connectors").menu("Edit implementation...").click();
    bot.table().unselect();
    assertFalse("Edit button should be disabled", bot.button(Messages.Edit).isEnabled());
    bot.table().select(id + " (1.0.0) -- " + packageName + "." + className);
    bot.button(Messages.Edit).click();
    bot.button(IDialogConstants.NEXT_LABEL).click();
    assertEquals("Implementation id should be " + id, bot.textWithLabel("Implementation id *").getText(), id);
    assertEquals("Version should be 1.0.0", bot.textWithLabel("Version *").getText(), "1.0.0");
    assertEquals("Class name should be " + className, bot.textWithLabel("Class name *").getText(), className);
    assertEquals("Package should be " + packageName, bot.textWithLabel("Package *").getText(), packageName);
    bot.textWithLabel("Implementation id *").setText(id2);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    ConnectorImplRepositoryStore store = (ConnectorImplRepositoryStore) RepositoryManager.getInstance()
            .getRepositoryStore(ConnectorImplRepositoryStore.class);
    ConnectorImplementation connectorImpl = store.getImplementation(id, "1.0.0");
    assertNull("connectorImplementation with id" + id + "should not exist anymore", connectorImpl);
    connectorImpl = store.getImplementation(id2, "1.0.0");
    assertNotNull("connectorImplementation id was not edited correctly", connectorImpl);
    assertEquals("connector id should be " + id2, connectorImpl.getImplementationId(), id2);
    removeImplementation(id2);
}

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorImplementationTest.java

License:Open Source License

@Test
public void testConnectorImplEditionWithSameDefandClassName() {
    final int nbEditorsBefore = bot.editors().size();
    final String id = "testImplementation4";
    final String id2 = "testImplementation5";
    final String definition = "testEdit";
    final String className = "MyactorFilterImpl";
    final String packageName = "org.bonita.actorFilter.test";
    SWTBotConnectorTestUtil.activateConnectorImplementationShell(bot);

    selectDefinition(definition);// w ww. j a v  a  2  s .c om

    bot.textWithLabel("Implementation id *").setText(id);
    bot.textWithLabel("Class name *").setText(className);
    bot.textWithLabel("Package *").setText(packageName);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    bot.waitUntil(new ICondition() {

        public boolean test() throws Exception {
            return nbEditorsBefore + 1 == bot.editors().size();
        }

        public void init(SWTBot bot) {
        }

        public String getFailureMessage() {
            return "Editor for implementation has not been opened.";
        }
    }, 30000);

    SWTBotConnectorTestUtil.activateConnectorImplementationShell(bot);
    selectDefinition(definition);
    bot.textWithLabel("Implementation id *").setText(id2);
    bot.textWithLabel("Class name *").setText(className);
    bot.textWithLabel("Package *").setText(packageName);
    bot.waitUntil(new ICondition() {

        public boolean test() throws Exception {
            return !bot.button(IDialogConstants.FINISH_LABEL).isEnabled();
        }

        public void init(SWTBot bot) {

        }

        public String getFailureMessage() {
            return "Finish button should be disabled";
        }

    });
    bot.button(IDialogConstants.CANCEL_LABEL).click();
    removeImplementation(id);
}

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorPropertyTest.java

License:Open Source License

public void createConnector(String connectorDefinitionId) {
    final String widgetId = "textWidget";
    final String pageId = "connectorDefPageId";
    SWTBotConnectorTestUtil.activateConnectorDefinitionShell(bot);
    bot.textWithLabel("Definition id *").setText(connectorDefinitionId);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button("Add...").click();
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button("Add...").click();
    bot.textWithLabel("Page id *").setText(pageId);
    bot.button("Add...").click();
    bot.textWithLabel("Widget id*").setText(widgetId);
    bot.textWithLabel("Display name").setText("text");
    bot.comboBoxWithLabel("Widget type").setSelection("Text");
    bot.comboBoxWithLabel("Input *").setSelection(0);
    bot.button(IDialogConstants.OK_LABEL).click();
    bot.button("Apply").click();
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button("Add...").click();
    bot.button(IDialogConstants.FINISH_LABEL).click();
}

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorPropertyTest.java

License:Open Source License

private void addConnector(String connectorDefinitionId, String name, String dataName, String version) {
    SWTBotTestUtil.selectTabbedPropertyView(bot, "Connectors");
    bot.button("Add...").click();
    assertFalse(IDialogConstants.NEXT_LABEL + " should be disabled",
            bot.button(IDialogConstants.NEXT_LABEL).isEnabled());
    assertFalse(IDialogConstants.FINISH_LABEL + " should be disabled",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.tree().expandNode("Uncategorized").select(connectorDefinitionId + " (" + version + ")");
    assertTrue(IDialogConstants.NEXT_LABEL + " should be disabled",
            bot.button(IDialogConstants.NEXT_LABEL).isEnabled());
    assertFalse(IDialogConstants.FINISH_LABEL + " should be disabled",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.button(IDialogConstants.NEXT_LABEL).click();
    assertFalse(IDialogConstants.FINISH_LABEL + " should be disabled",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.textWithLabel("Name *").setText(name);
    assertTrue(IDialogConstants.FINISH_LABEL + " should be disabled",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.textWithLabel("text").setText("hello world");
    bot.sleep(1000); // Due to delayed observable on databinding
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.comboBox().setSelection(dataName + " (java.lang.String)");
    bot.button(IDialogConstants.FINISH_LABEL).click();
}

From source file:org.bonitasoft.studio.connectors.test.swtbot.ConnectorPropertyTest.java

License:Open Source License

private void editConnector(String connectorDefinitionId, String name, String version, String dataName) {
    bot.table().select(name + " -- " + connectorDefinitionId + " (" + version + ") -- ON_FINISH");
    bot.button("Edit...").click();
    assertEquals("the name text field is not well completed", bot.textWithLabel("Name *").getText(), name);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    assertEquals("the widget text should be completed with the text hello world", "hello world",
            bot.textWithLabel("text").getText());
    bot.button(IDialogConstants.NEXT_LABEL).click();
    assertEquals(dataName + " (java.lang.String) should be selected in the comboBox",
            dataName + " (java.lang.String)", bot.comboBox().getText());
    assertEquals("the text field should be completed with the ouptut name Ouput1", "Output1",
            bot.text().getText());//from   w w  w .  j  a v  a  2  s.co m
    bot.button(IDialogConstants.FINISH_LABEL).click();
}