Package org.fusesource.ide.camel.model

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


    }
    @Override
    protected Image getImage() {
        AbstractNode node = getModelNode();
        if (image == null && node != null) {
            image = node.getSmallImage();
        }
        return image;
    }
View Full Code Here


    protected boolean isTreeRelationshipPropertyName(String propertyName) {
        return treeRelationshipPropertyNames.contains(propertyName);
    }
    public String getToolTip() {
        AbstractNode node = (AbstractNode) getModel();
        return node.getDisplayToolTip();
    }
View Full Code Here

      @Override
      public void selectionChanged(SelectionChangedEvent event) {
        final ISelection selection = event.getSelection();
        nodeListener.selectionChanged(part, selection);
        AbstractNode node = AbstractNodes.getSelectedNode(selection);
        RouteSupport route = AbstractNodes.getRoute(node);
        if (route != null && route != previousSelection) {
          // lets potentially update the selected route
          previousSelection = route;
          // only set the route if it differs from the currently selected one in the editor
          if (editor.getSelectedRoute() != route) {
            editor.setSelectedRoute(route);
          }

          // lets make sure we get the focus afterwards
          Display.getDefault().asyncExec(new Runnable() {
            @Override
            public void run() {
              //viewer.setSelection(selection);
              setFocus();
            }
          });
        }

        // TODO should we update the diagram's selection too?
      }
    });
    final Tree tree = (Tree)viewer.getControl();
    ToolTip tooltip = new DefaultToolTip(tree) {
      @Override
      protected String getText(Event event) {
        TreeItem item = tree.getItem(new Point(event.x, event.y));
        if (item != null) {
          Object data = item.getData();
          AbstractNode node = AbstractNodes.toAbstractNode(item.getData());
          if (node != null) {
            return node.getDisplayToolTip();
          }
          if (data instanceof AbstractNodeTreeEditPart) {
            AbstractNodeTreeEditPart nodeTree = (AbstractNodeTreeEditPart) data;
            return nodeTree.getToolTip();
          }
View Full Code Here

    // Activator.getLogger().debug("Selection is " + selection +
    // " of type: "
    // + selection.getClass());
    super.setInput(part, selection);

    AbstractNode newNode = getSelectedNode(selection);

    // Activator.getLogger().debug("Selection first element is " + input +
    // " of type: " + (input == null ? null : input.getClass()));
    setSelectedNode(newNode);
  }
View Full Code Here

  public void aboutToBeShown() {
    super.aboutToBeShown();

    // lets update the node to the current selection
    ISelection selection = null;
    AbstractNode newNode = null;
    if (lastPart != null) {
       selection = lastPart.getSite().getSelectionProvider().getSelection();
     
      newNode = getSelectedNode(selection);
      if (newNode != null) {
View Full Code Here

  protected void setSelectedNode(AbstractNode newNode) {
    // Activator.getLogger().debug("Property view setting selected node to be: "
    // + newNode);

    if (newNode != null) {
      AbstractNode lastNode = node;
      if (newNode instanceof RouteContainer) {
        nodeContainer = (RouteContainer) newNode;
      } else {
        RouteContainer parent = newNode.getParent();
        if (parent != null) {
View Full Code Here

  @Override
  public boolean canCreate(ICreateConnectionContext context) {
    // return true if both anchors belong to a EClass
    // and those EClasses are not identical
    AbstractNode source = getNode(context.getSourceAnchor());
    AbstractNode target = getNode(context.getTargetAnchor());
    if (target != null && source != target) {
      // source == null indicates its a new node with the route being the source
      return source == null || source.canConnectTo(target);
    }
    return false;
View Full Code Here

      IFile contextFile = getContextFile();
      String fileName = contextFile.getName();
      String projectName = contextFile.getProject().getName();
      IBreakpoint[] bps = CamelDebugUtils.getBreakpointsForContext(fileName, projectName);
    for (IBreakpoint bp : bps) {
      AbstractNode bo = ((RiderDesignEditor)getDiagramBehavior().getDiagramContainer()).getModel().getNode(((CamelEndpointBreakpoint)bp).getEndpointNodeId());
      try {
        bp.delete();
      } catch (CoreException ex) {
        Activator.getLogger().error("Unable to delete breakpoint " + bp, ex);
      } finally {
View Full Code Here

  @Override
  public Connection create(ICreateConnectionContext context) {
    Connection newConnection = null;

    // get EClasses which should be connected
    AbstractNode source = getNode(context.getSourceAnchor());
    AbstractNode target = getNode(context.getTargetAnchor());

    if (target != null) {
      if (source == null) {
        // lets add the target to the diagram
        RiderDesignEditor editor = RiderDesignEditor.toRiderDesignEditor(getDiagramBehavior());
View Full Code Here

  protected boolean isMandatory(Object bean, String propertyName) {
    // lets look at the setter method and see if its got a @Required
    // annotation
    if (bean instanceof AbstractNode) {
      AbstractNode node = (AbstractNode) bean;
      Class<?> camelClass = node.getCamelDefinitionClass();
      if (camelClass != null) {
        XmlAccessorType accessorType = camelClass.getAnnotation(XmlAccessorType.class);
        boolean useMethods = true;
        if (accessorType != null) {
          if (accessorType.value().equals(XmlAccessType.FIELD)) {
View Full Code Here

TOP

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

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.