Package org.springframework.ide.eclipse.config.ui.editors

Examples of org.springframework.ide.eclipse.config.ui.editors.AbstractConfigFormPage


  public void testUnselectedNamespacesForPageExistenceIntegrationFile() throws Exception {
    cEditor = openFileInEditor("src/integration-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    AbstractConfigFormPage page = cEditor.getFormPage(NamespacesFormPage.ID);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load namespaces page.", page.getMasterPart());

    CountDownLatch latch = ((NamespacesMasterPart) page.getMasterPart()).getLazyInitializationLatch();
    assertTrue("Table initialization did not complete before timeout.", latch.await(30, TimeUnit.SECONDS));
    StsTestUtil.waitForDisplay();

    CheckboxTableViewer checkViewer = (CheckboxTableViewer) page.getMasterPart().getViewer();
    for (TableItem item : checkViewer.getTable().getItems()) {
      INamespaceDefinition def = (INamespaceDefinition) item.getData();
      if (!item.getChecked()) {
        assertNull(cEditor.getFormPageForUri(def.getNamespaceURI()));
      }
View Full Code Here


  public void testUnselectedNamespacesForPageExistenceScopedFile() throws Exception {
    cEditor = openFileInEditor("src/scoped-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    AbstractConfigFormPage page = cEditor.getFormPage(NamespacesFormPage.ID);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load namespaces page.", page.getMasterPart());

    CountDownLatch latch = ((NamespacesMasterPart) page.getMasterPart()).getLazyInitializationLatch();
    assertTrue("Table initialization did not complete before timeout.", latch.await(30, TimeUnit.SECONDS));
    StsTestUtil.waitForDisplay();

    CheckboxTableViewer checkViewer = (CheckboxTableViewer) page.getMasterPart().getViewer();
    for (TableItem item : checkViewer.getTable().getItems()) {
      INamespaceDefinition def = (INamespaceDefinition) item.getData();
      if (!item.getChecked()) {
        assertNull(cEditor.getFormPageForUri(def.getNamespaceURI()));
      }
View Full Code Here

    cEditor = openFileInEditor("src/beans-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    ConfigUiPlugin.getDefault().getPreferenceStore()
        .setValue(SpringConfigPreferenceConstants.PREF_DISPLAY_TABS_DIALOG, MessageDialogWithToggle.NEVER);
    AbstractConfigFormPage page = cEditor.getFormPage(NamespacesFormPage.ID);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load namespaces page.", page.getMasterPart());

    CheckboxTableViewer checkViewer = (CheckboxTableViewer) page.getMasterPart().getViewer();
    assertNull(cEditor.getFormPageForUri(UtilSchemaConstants.URI));
    assertNotNull(cEditor.getFormPageForUri(BeansSchemaConstants.URI));

    CountDownLatch latch = ((NamespacesMasterPart) page.getMasterPart()).getLazyInitializationLatch();
    assertTrue("Table initialization did not complete before timeout.", latch.await(30, TimeUnit.SECONDS));
    StsTestUtil.waitForDisplay();

    boolean foundItem = false;
    List<String> uris = new ArrayList<String>();
    for (TableItem item : checkViewer.getTable().getItems()) {
      INamespaceDefinition def = (INamespaceDefinition) item.getData();
      String currentUri = def.getNamespaceURI();
      uris.add(currentUri);
      if (UtilSchemaConstants.URI.equals(currentUri)) {
        foundItem = true;
        assertFalse("Expected table item " + currentUri + "to be unchecked.", item.getChecked());
        item.setChecked(true);
        ((NamespacesMasterPart) page.getMasterPart()).updateDefinitionFromCheckState(def, item.getChecked());
        assertNotNull(cEditor.getFormPageForUri(UtilSchemaConstants.URI));
        assertNotNull(cEditor.getFormPageForUri(BeansSchemaConstants.URI));
        item.setChecked(false);
        ((NamespacesMasterPart) page.getMasterPart()).updateDefinitionFromCheckState(def, item.getChecked());
        assertNull(cEditor.getFormPageForUri(UtilSchemaConstants.URI));
        assertNotNull(cEditor.getFormPageForUri(BeansSchemaConstants.URI));
      }
    }
    assertTrue("Expected to find " + UtilSchemaConstants.URI + " but found " + uris + " instead.", foundItem);
View Full Code Here

    cEditor = openFileInEditor("src/integration-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    ConfigUiPlugin.getDefault().getPreferenceStore()
        .setValue(SpringConfigPreferenceConstants.PREF_DISPLAY_TABS_DIALOG, MessageDialogWithToggle.NEVER);
    AbstractConfigFormPage page = cEditor.getFormPage(NamespacesFormPage.ID);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load namespaces page.", page.getMasterPart());

    // CheckboxTableViewer checkViewer = (CheckboxTableViewer)
    // page.getMasterPart().getViewer();
    assertNull(cEditor.getFormPageForUri(IntFileSchemaConstants.URI));
    assertNotNull(cEditor.getFormPageForAdapterUri(IntFileSchemaConstants.URI));
View Full Code Here

    cEditor = openFileInEditor("src/scoped-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    ConfigUiPlugin.getDefault().getPreferenceStore()
        .setValue(SpringConfigPreferenceConstants.PREF_DISPLAY_TABS_DIALOG, MessageDialogWithToggle.NEVER);
    AbstractConfigFormPage page = cEditor.getFormPage(NamespacesFormPage.ID);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load namespaces page.", page.getMasterPart());

    CheckboxTableViewer checkViewer = (CheckboxTableViewer) page.getMasterPart().getViewer();
    assertNull(cEditor.getFormPageForUri(AopSchemaConstants.URI));
    assertNotNull(cEditor.getFormPageForUri(BatchSchemaConstants.URI));

    CountDownLatch latch = ((NamespacesMasterPart) page.getMasterPart()).getLazyInitializationLatch();
    assertTrue("Table initialization did not complete before timeout.", latch.await(30, TimeUnit.SECONDS));
    StsTestUtil.waitForDisplay();

    boolean foundItem = false;
    List<String> uris = new ArrayList<String>();
    for (TableItem item : checkViewer.getTable().getItems()) {
      INamespaceDefinition def = (INamespaceDefinition) item.getData();
      String currentUri = def.getNamespaceURI();
      uris.add(currentUri);
      if (AopSchemaConstants.URI.equals(currentUri)) {
        foundItem = true;
        assertFalse("Expected table item " + currentUri + "to be unchecked.", item.getChecked());
        item.setChecked(true);
        ((NamespacesMasterPart) page.getMasterPart()).updateDefinitionFromCheckState(def, item.getChecked());
        assertNotNull(cEditor.getFormPageForUri(AopSchemaConstants.URI));
        assertNotNull(cEditor.getFormPageForUri(BatchSchemaConstants.URI));
        item.setChecked(false);
        ((NamespacesMasterPart) page.getMasterPart()).updateDefinitionFromCheckState(def, item.getChecked());
        assertNull(cEditor.getFormPageForUri(AopSchemaConstants.URI));
        assertNotNull(cEditor.getFormPageForUri(BatchSchemaConstants.URI));
      }
    }
    assertTrue("Expected to find " + AopSchemaConstants.URI + " but found " + uris + " instead.", foundItem);
View Full Code Here

  public void testExistingPagesForNamespaceSelectionBeansFile() throws Exception {
    cEditor = openFileInEditor("src/beans-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    AbstractConfigFormPage page = cEditor.getFormPage(NamespacesFormPage.ID);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load namespaces page.", page.getMasterPart());

    CountDownLatch latch = ((NamespacesMasterPart) page.getMasterPart()).getLazyInitializationLatch();
    assertTrue("Table initialization did not complete before timeout.", latch.await(30, TimeUnit.SECONDS));
    StsTestUtil.waitForDisplay();

    CheckboxTableViewer checkViewer = (CheckboxTableViewer) page.getMasterPart().getViewer();
    Set<IConfigurationElement> definitions = ConfigUiExtensionPointReader.getPageDefinitions();
    for (IConfigurationElement def : definitions) {
      String uri = def.getAttribute(FormPagesExtensionPointConstants.ATTR_NAMESPACE_URI);
      AbstractConfigFormPage formPage = cEditor.getFormPageForUri(uri);
      if (formPage != null) {
        boolean foundItem = false;
        List<String> uris = new ArrayList<String>();
        for (TableItem item : checkViewer.getTable().getItems()) {
          INamespaceDefinition nsDef = (INamespaceDefinition) item.getData();
          String currentUri = nsDef.getNamespaceURI();
          uris.add(currentUri);
          if (item.getChecked() && currentUri.equals(formPage.getNamespaceUri())) {
            foundItem = true;
          }
        }
        assertTrue("Expected to find " + uri + " but found " + uris + " instead.", foundItem);
      }
View Full Code Here

  public void testExistingPagesForNamespaceSelectionIntegrationFile() throws Exception {
    cEditor = openFileInEditor("src/integration-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    AbstractConfigFormPage page = cEditor.getFormPage(NamespacesFormPage.ID);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load namespaces page.", page.getMasterPart());

    CountDownLatch latch = ((NamespacesMasterPart) page.getMasterPart()).getLazyInitializationLatch();
    assertTrue("Table initialization did not complete before timeout.", latch.await(30, TimeUnit.SECONDS));
    StsTestUtil.waitForDisplay();

    CheckboxTableViewer checkViewer = (CheckboxTableViewer) page.getMasterPart().getViewer();
    Set<IConfigurationElement> definitions = ConfigUiExtensionPointReader.getPageDefinitions();
    for (IConfigurationElement def : definitions) {
      String uri = def.getAttribute(FormPagesExtensionPointConstants.ATTR_NAMESPACE_URI);
      AbstractConfigFormPage formPage = cEditor.getFormPageForUri(uri);
      if (formPage != null) {
        boolean foundItem = false;
        List<String> uris = new ArrayList<String>();
        for (TableItem item : checkViewer.getTable().getItems()) {
          INamespaceDefinition nsDef = (INamespaceDefinition) item.getData();
          String currentUri = nsDef.getNamespaceURI();
          uris.add(currentUri);
          if (item.getChecked() && currentUri.equals(formPage.getNamespaceUri())) {
            foundItem = true;
          }
        }
        assertTrue("Expected to find " + uri + " but found " + uris + " instead.", foundItem);
      }
View Full Code Here

  public void testExistingPagesForNamespaceSelectionScopedFile() throws Exception {
    cEditor = openFileInEditor("src/scoped-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    AbstractConfigFormPage page = cEditor.getFormPage(NamespacesFormPage.ID);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load namespaces page.", page.getMasterPart());

    CountDownLatch latch = ((NamespacesMasterPart) page.getMasterPart()).getLazyInitializationLatch();
    assertTrue("Table initialization did not complete before timeout.", latch.await(30, TimeUnit.SECONDS));
    StsTestUtil.waitForDisplay();

    CheckboxTableViewer checkViewer = (CheckboxTableViewer) page.getMasterPart().getViewer();
    Set<IConfigurationElement> definitions = ConfigUiExtensionPointReader.getPageDefinitions();
    for (IConfigurationElement def : definitions) {
      String uri = def.getAttribute(FormPagesExtensionPointConstants.ATTR_NAMESPACE_URI);
      AbstractConfigFormPage formPage = cEditor.getFormPageForUri(uri);
      if (formPage != null) {
        boolean foundItem = false;
        List<String> uris = new ArrayList<String>();
        for (TableItem item : checkViewer.getTable().getItems()) {
          INamespaceDefinition nsDef = (INamespaceDefinition) item.getData();
          String currentUri = nsDef.getNamespaceURI();
          uris.add(currentUri);
          if (item.getChecked() && nsDef.getNamespaceURI().equals(formPage.getNamespaceUri())) {
            foundItem = true;
          }
        }
        assertTrue("Expected to find " + uri + " but found " + uris + " instead.", foundItem);
      }
View Full Code Here

    cEditor = openFileInEditor("src/beans-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    ConfigUiPlugin.getDefault().getPreferenceStore()
        .setValue(SpringConfigPreferenceConstants.PREF_DISPLAY_TABS_DIALOG, MessageDialogWithToggle.NEVER);
    AbstractConfigFormPage page = cEditor.getFormPage(NamespacesFormPage.ID);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load namespaces page.", page.getMasterPart());

    CheckboxTableViewer checkViewer = (CheckboxTableViewer) page.getMasterPart().getViewer();
    assertNotNull(cEditor.getFormPageForUri(AopSchemaConstants.URI));
    assertNotNull(cEditor.getFormPageForUri(BeansSchemaConstants.URI));

    CountDownLatch latch = ((NamespacesMasterPart) page.getMasterPart()).getLazyInitializationLatch();
    assertTrue("Table initialization did not complete before timeout.", latch.await(30, TimeUnit.SECONDS));
    StsTestUtil.waitForDisplay();

    boolean foundItem = false;
    List<String> uris = new ArrayList<String>();
    for (TableItem item : checkViewer.getTable().getItems()) {
      INamespaceDefinition def = (INamespaceDefinition) item.getData();
      String currentUri = def.getNamespaceURI();
      uris.add(currentUri);
      if (AopSchemaConstants.URI.equals(currentUri)) {
        foundItem = true;
        assertTrue("Expected table item " + currentUri + "to be checked.", item.getChecked());
        item.setChecked(false);
        ((NamespacesMasterPart) page.getMasterPart()).updateDefinitionFromCheckState(def, item.getChecked());
        assertNull(cEditor.getFormPageForUri(AopSchemaConstants.URI));
        assertNotNull(cEditor.getFormPageForUri(BeansSchemaConstants.URI));
        item.setChecked(true);
        ((NamespacesMasterPart) page.getMasterPart()).updateDefinitionFromCheckState(def, item.getChecked());
        assertNotNull(cEditor.getFormPageForUri(AopSchemaConstants.URI));
        assertNotNull(cEditor.getFormPageForUri(BeansSchemaConstants.URI));
      }
    }
    assertTrue("Expected to find " + AopSchemaConstants.URI + " but found " + uris + " instead.", foundItem);
View Full Code Here

  public void testDocumentationSection() throws Exception {
    cEditor = openFileInEditor("src/beans-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    AbstractConfigFormPage page = cEditor.getFormPageForUri(BeansSchemaConstants.URI);
    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load beans page.", page.getMasterPart());

    TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
    TreeItem root = treeViewer.getTree().getItem(0);
    TreeItem beanItem = root.getItem(0);
    page.setSelection(new StructuredSelection(beanItem.getData()));

    AbstractConfigMasterDetailsBlock block = page.getMasterDetailsBlock();
    IDetailsPage details = block.getDetailsPart().getCurrentPage();
    assertTrue("Could not load details part.", details instanceof AbstractNamespaceDetailsPart);

    AbstractNamespaceDetailsPart detailsPart = (AbstractNamespaceDetailsPart) details;
    Section docsSection = detailsPart.getDocumentationSection().getSection();
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.config.ui.editors.AbstractConfigFormPage

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.