Package org.springframework.ide.eclipse.config.graph

Examples of org.springframework.ide.eclipse.config.graph.AbstractConfigGraphicalEditor


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

    enableGefPages(true);
    IEditorInput input = cEditor.getEditorInput();
    AbstractConfigGraphicalEditor gEditor = cEditor.getGraphicalEditorForUri(BatchSchemaConstants.URI);
    assertNotNull(gEditor);
    page.closeEditor(cEditor, false);

    enableGefPages(false);
    cEditor = (AbstractConfigEditor) page.openEditor(input, SpringConfigEditor.ID_EDITOR);
View Full Code Here


  @Override
  public void run() {
    IWorkbenchPart editor = getWorkbenchPart();
    ActivityPart part = (ActivityPart) getSelectedObjects().get(0);
    if (editor instanceof AbstractConfigGraphicalEditor) {
      AbstractConfigGraphicalEditor graph = (AbstractConfigGraphicalEditor) editor;
      IDOMElement element = part.getModelElement().getInput();
      int start = element.getStartOffset();
      int length = element.getLength();
      graph.getEditor().getSourcePage().selectAndReveal(start, length);
    }
  }
View Full Code Here

  @Override
  public void run() {
    IWorkbenchPart editor = getWorkbenchPart();
    if (editor instanceof AbstractConfigGraphicalEditor) {
      AbstractConfigGraphicalEditor graph = (AbstractConfigGraphicalEditor) editor;
      String uri = graph.getNamespaceUri();
      prefStore.firePropertyChangeEvent(SpringConfigPreferenceConstants.PROP_RESET_LAYOUT, null, uri);
    }
  }
View Full Code Here

    }
    return null;
  }

  public AbstractConfigGraphicalEditor getGraphicalEditorForAdapterUri(String uri) {
    AbstractConfigGraphicalEditor page = getGraphicalEditorForUri(uri);
    if (page != null) {
      return page;
    }
    if (uri != null && !uri.trim().equals("")) { //$NON-NLS-1$
      for (Object obj : pages) {
        if (obj instanceof AbstractConfigGraphicalEditor) {
          page = (AbstractConfigGraphicalEditor) obj;
          for (IConfigurationElement config : page.getAdapterDefinitions()) {
            if (uri.equals(config.getAttribute(PageAdaptersExtensionPointConstants.ATTR_NAMESPACE_URI))) {
              return page;
            }
          }
        }
View Full Code Here

   */
  public AbstractConfigGraphicalEditor getGraphicalEditorForUri(String uri) {
    if (uri != null && !uri.trim().equals("")) { //$NON-NLS-1$
      for (Object obj : pages) {
        if (obj instanceof AbstractConfigGraphicalEditor) {
          AbstractConfigGraphicalEditor page = (AbstractConfigGraphicalEditor) obj;
          if (uri.equals(page.getNamespaceUri())) {
            return page;
          }
          for (IConfigurationElement config : page.getAdapterDefinitions()) {
            if (uri.equals(config.getAttribute(PageAdaptersExtensionPointConstants.ATTR_NAMESPACE_URI))) {
              return page;
            }
          }
        }
View Full Code Here

      removePage(pages.indexOf(page));
    }
  }

  private void removeGraphicalEditor(String uri) {
    AbstractConfigGraphicalEditor gEditor = getGraphicalEditorForUri(uri);
    if (gEditor != null) {
      removePage(pages.indexOf(gEditor));
    }
  }
View Full Code Here

    if (activeEditorPart instanceof AbstractConfigGraphicalEditor) {
      // If leaving a graph page, clear the GEF command stack. This
      // ensures that graph pages can only undo/redo recent edits that
      // were performed in the page itself. All XML edits should remain
      // undo/redoable from the source and form pages.
      AbstractConfigGraphicalEditor editor = (AbstractConfigGraphicalEditor) activeEditorPart;
      CommandStack stack = (CommandStack) editor.getAdapter(CommandStack.class);
      stack.flush();
    }
    activeEditorPart = part;

    if (part instanceof StructuredTextEditor) {
View Full Code Here

  private void updateActionBars() {
    IActionBars actionBars = getActionBars();
    if (actionBars != null && configEditor != null) {
      if (activeEditorPart instanceof AbstractConfigGraphicalEditor) {
        AbstractConfigGraphicalEditor editor = (AbstractConfigGraphicalEditor) activeEditorPart;
        Object obj = editor.getAdapter(ActionRegistry.class);
        if (obj instanceof ActionRegistry) {
          ActionRegistry registry = (ActionRegistry) obj;
          actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(),
              registry.getAction(ActionFactory.UNDO.getId()));
          actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(),
              registry.getAction(ActionFactory.REDO.getId()));
          actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(),
              registry.getAction(ActionFactory.PRINT.getId()));
          actionBars
              .setGlobalActionHandler(ActionFactory.EXPORT.getId(), registry.getAction(ExportAction.ID));
        }
      }
      else if (activeEditorPart instanceof SpringConfigGraphPage) {
        SpringConfigGraphPage editor = (SpringConfigGraphPage) activeEditorPart;
        Object obj = editor.getAdapter(ActionRegistry.class);
        if (obj instanceof ActionRegistry) {
          ActionRegistry registry = (ActionRegistry) obj;
          actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), null);
          actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), null);
          actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(),
View Full Code Here

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

    AbstractConfigGraphicalEditor batch = cEditor.getGraphicalEditorForUri(BatchSchemaConstants.URI);
    assertNotNull(batch);
    assertEquals(BatchSchemaConstants.URI, batch.getNamespaceUri());

    AbstractConfigGraphicalEditor beans = cEditor.getGraphicalEditorForUri(BeansSchemaConstants.URI);
    assertNull(beans);

    AbstractConfigGraphicalEditor util = cEditor.getGraphicalEditorForUri(UtilSchemaConstants.URI);
    assertNull(util);
  }
View Full Code Here

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

    AbstractConfigGraphicalEditor batch = cEditor.getGraphicalEditorForUri(BatchSchemaConstants.URI);
    assertNull(batch);

    AbstractConfigGraphicalEditor beans = cEditor.getGraphicalEditorForUri(BeansSchemaConstants.URI);
    assertNull(beans);

    AbstractConfigGraphicalEditor util = cEditor.getGraphicalEditorForUri(UtilSchemaConstants.URI);
    assertNull(util);
  }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.config.graph.AbstractConfigGraphicalEditor

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.