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

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


  public void testEditAttribute() 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 subItem = root.getItem(1);
    page.setSelection(new StructuredSelection(subItem.getData()));

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

    AbstractNamespaceDetailsPart detailsPart = (AbstractNamespaceDetailsPart) details;
    SpringConfigInputAccessor accessor = new SpringConfigInputAccessor(cEditor, detailsPart.getInput());
View Full Code Here


  public void testEditElement() 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 subItem = root.getItem(0);
    page.setSelection(new StructuredSelection(subItem.getData()));

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

    AbstractNamespaceDetailsPart detailsPart = (AbstractNamespaceDetailsPart) details;
    SpringConfigInputAccessor accessor = new SpringConfigInputAccessor(cEditor, detailsPart.getInput());
View Full Code Here

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

    AbstractConfigFormPage page = cEditor.getFormPage(OverviewFormPage.ID);
    StructuredTextViewer textView = cEditor.getTextViewer();
    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
    TreeItem root = treeViewer.getTree().getItem(0);
    assertEquals(0, root.getItemCount());

    InsertNodeAction insert = new InsertNodeAction(treeViewer, cEditor.getXmlProcessor(), textView, "bean");
    treeViewer.getTree().setSelection(root);
View Full Code Here

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

    AbstractConfigFormPage page = cEditor.getFormPage(OverviewFormPage.ID);
    StructuredTextViewer textView = cEditor.getTextViewer();
    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
    TreeItem root = treeViewer.getTree().getItem(0);
    IDOMElement node = (IDOMElement) root.getItem(0).getData();
    assertEquals(20, root.getItemCount());

    DeleteNodeAction action = new DeleteNodeAction(textView, node);
View Full Code Here

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

    AbstractConfigFormPage page = cEditor.getFormPage(OverviewFormPage.ID);
    StructuredTextViewer textView = cEditor.getTextViewer();
    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
    TreeItem root = treeViewer.getTree().getItem(0);
    assertEquals(20, root.getItemCount());

    InsertNodeAction action = new InsertNodeAction(treeViewer, cEditor.getXmlProcessor(), textView, "bean");
    treeViewer.getTree().setSelection(root);
View Full Code Here

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

    AbstractConfigFormPage page = cEditor.getFormPage(OverviewFormPage.ID);
    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
    TreeItem root = treeViewer.getTree().getItem(0);
    TreeItem innerNode = root.getItem(3);
    root.setExpanded(true);
    assertFalse(innerNode.getExpanded());
View Full Code Here

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

    AbstractConfigFormPage page = cEditor.getFormPage(OverviewFormPage.ID);
    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
    TreeItem root = treeViewer.getTree().getItem(0);
    root.setExpanded(true);
    assertTrue(root.getExpanded());

    CollapseNodeAction collapse = new CollapseNodeAction(treeViewer, cEditor.getXmlProcessor());
View Full Code Here

    // source page holds onto another reference
    IDOMModel model = cEditor.getDomDocument().getModel();
    int references = model.getReferenceCountForEdit();
    assertEquals(2, references);

    AbstractConfigFormPage page = cEditor.getFormPage(OverviewFormPage.ID);
    StructuredTextViewer textView = cEditor.getTextViewer();
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
    TreeItem root = treeViewer.getTree().getItem(0);

    LowerNodeAction lower = new LowerNodeAction(treeViewer, cEditor.getXmlProcessor(), textView);
    treeViewer.getTree().setSelection(root.getItem(0));
    lower.run();
View Full Code Here

public class AbstractNamespaceMasterPartUiTest extends AbstractConfigUiTestCase {

  public void testCreateButtons() throws Exception {
    cEditor = openFileInEditor("src/beans-config.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);
    final AbstractConfigFormPage page = cEditor.getFormPageForUri(BeansSchemaConstants.URI);
    Thread.sleep(StsTestUtil.WAIT_TIME);

    UIThreadRunnable.syncExec(new VoidResult() {
      public void run() {
        cEditor.setActivePage(page.getId());
        assertNotNull("Could not load beans page.", page.getMasterPart());
      }
    });

    SWTBotButton newBeanButton = bot.flatButton("New Bean...");
    SWTBotButton upButton = bot.flatButton("Up");
    SWTBotButton downButton = bot.flatButton("Down");
    assertFalse(upButton.isEnabled());
    assertFalse(downButton.isEnabled());

    UIThreadRunnable.syncExec(new VoidResult() {
      public void run() {
        TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
        TreeItem root = treeViewer.getTree().getItem(0);
        TreeItem beanItem = root.getItem(1);
        page.setSelection(new StructuredSelection(beanItem.getData()));
      }
    });

    assertTrue(upButton.isEnabled());
    assertTrue(downButton.isEnabled());
View Full Code Here

  public void testViewerEnablement() 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();

    AbstractConfigMasterDetailsBlock block = page.getMasterDetailsBlock();
    CheckboxTableViewer checkViewer = (CheckboxTableViewer) page.getMasterPart().getViewer();
    assertTrue(checkViewer.getTable().getItemCount() > 0);

    for (TableItem item : checkViewer.getTable().getItems()) {
      page.setSelection(new StructuredSelection(item.getData()));
      IDetailsPage details = block.getDetailsPart().getCurrentPage();
      assertTrue("Could not load details part.", details instanceof NamespacesDetailsPart);

      NamespacesDetailsPart detailsPart = (NamespacesDetailsPart) details;
      ColumnViewer versionViewer = detailsPart.getVersionViewer();
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.