Package org.fusesource.ide.camel.model

Examples of org.fusesource.ide.camel.model.RouteContainer


    selectedNode = AbstractNodes.getSelectedNode(selection);
    if (selectedNode != null) {
      if (selectedNode instanceof RouteContainer) {
        nodeContainer = (RouteContainer) selectedNode;
      } else {
        RouteContainer parent = selectedNode.getParent();
        if (parent != null) {
          nodeContainer = parent;
        }
      }
View Full Code Here


    String filePath = CamelDebugUtils.getRawCamelContextFilePathFromLaunchConfig(getLaunch().getLaunchConfiguration());
    if (filePath != null) {
      File f = new File(filePath);
      if (f.exists() && f.isFile() && CamelUtils.isCamelContextFile(filePath)) {
        XmlContainerMarshaller m = new XmlContainerMarshaller();
        RouteContainer c = m.loadRoutes(f)
        if (c != null) {
          this.camelContextId = c.getCamelContextId();
        }
        if (CamelUtils.isBlueprintFile(filePath)) {
          this.contentType = ICamelDebugConstants.CAMEL_CONTEXT_CONTENT_TYPE_BLUEPRINT;
        } else if (CamelUtils.isSpringFile(filePath)) {
          this.contentType = ICamelDebugConstants.CAMEL_CONTEXT_CONTENT_TYPE_SPRING;
View Full Code Here

    OtherwiseDefinition od1 = c1.getOtherwise();
    assertNotNull("Should have Otherwise", od1);
    ToDefinition ed3 = assertSingleOutput(od1, ToDefinition.class);
    assertEquals("otherwise -> to", "seda:c", ed3.getUri());

    RouteContainer routeContainer = new RouteContainer();
    RouteSupport route2 = new Route(routeDef, routeContainer);
    System.out.println("Created route: " + route2);
    assertRoute(route);
   
    /** TODO: commented out as this fails for unknown reason - needs further investigation
View Full Code Here

public class EndpointSummaryTest {

  @Test
  public void testEndpointSummary() throws Exception {
    RouteContainer routeContainer = new RouteContainer();
   
    // from seda:a -> filter -> seda:b
    RouteSupport route1 = new Route();
    routeContainer.addChild(route1);
   
    Endpoint endpoint1 = new Endpoint("seda:a");
    route1.addChild(endpoint1);
   
    Filter filter1 = new Filter();
    endpoint1.addTargetNode(filter1);
   
    Endpoint endpoint2 = new Endpoint("seda:b");
    filter1.addTargetNode(endpoint2);

    // from seda:b -> filter -> seda:c
    RouteSupport route2 = new Route();
    routeContainer.addChild(route2);
   
    Endpoint endpoint3 = new Endpoint("seda:b");
    route2.addChild(endpoint3);
   
    Filter filter2 = new Filter();
View Full Code Here

      return (Object[]) input;
    } else if (input instanceof AbstractNode) {
      AbstractNode node = (AbstractNode) input;

      Set<Flow> set = new HashSet<Flow>();
      RouteContainer parent;
      if (node instanceof RouteContainer) {
        parent = (RouteContainer) node;
      } else {
        parent = node.getParent();
      }
      if (parent == null) {
        set = node.getAllConnections();
      } else {
        Set<AbstractNode> descendents = parent.getDescendents();
        for (AbstractNode child : descendents) {
          set.addAll(child.getAllConnections());
        }
      }
      return set.toArray();
View Full Code Here

  public Object[] getElements(Object input) {
    if (input instanceof AbstractNode) {
      AbstractNode node = (AbstractNode) input;

      Set<AbstractNode> set = new HashSet<AbstractNode>();
      RouteContainer parent;
      if (node instanceof RouteContainer) {
        parent = (RouteContainer) node;
      } else {
        parent = node.getParent();
        set.add(node);
      }
      if (parent == null) {
        set.addAll(node.getOutputs());
      } else {
        set.addAll(parent.getDescendents());
      }
      return set.toArray();
    } else {
      List<Object> answer = new ArrayList<Object>();
      if (input instanceof GraphableNode) {
View Full Code Here

    setSelectedObjectOnly(node);
  }

  protected boolean selectNodeId(String toNode, String endpointUri) {
    if (node != null) {
      RouteContainer parent = getParentContainer();
      if (parent != null) {
        AbstractNode newSelection = parent.getNode(toNode);
        if (newSelection != null) {
          if (newSelection instanceof Route) {
            // okay its the route we want to select, but we dont display the route node itself
            // so instead select the endpoint uri which is the source node of the route
            if (endpointUri != null) {
View Full Code Here

    return false;
  }

  protected boolean selectEndpointUri(String uri) {
    if (node != null) {
      RouteContainer parent = getParentContainer();
      if (parent instanceof RouteSupport) {
        RouteSupport route = (RouteSupport) parent;
        AbstractNode newSelection = route.findEndpoint(uri);
        if (newSelection == null) {
          // lets try iterate through any children
          List<AbstractNode> children = parent.getChildren();
          for (AbstractNode child : children) {
            if (child instanceof RouteSupport) {
              route = (RouteSupport) child;
              newSelection = route.findEndpoint(uri);
              if (newSelection != null) {
View Full Code Here

    return false;
  }


  protected RouteContainer getParentContainer() {
    RouteContainer parent = node.getParent();
    if (parent == null && node instanceof RouteContainer) {
      parent = (RouteContainer) node;
    }
    return parent;
  }
View Full Code Here

  }


  @Override
  public void onModelChange() {
    RouteContainer model = editor.getModel();
    if (model != null) {
      Tree tree = getTree();
      if (tree == null) {
        Activator.getLogger().warning("Warning - attempt to set the model when no tree!");
      } else {
View Full Code Here

TOP

Related Classes of org.fusesource.ide.camel.model.RouteContainer

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.