コード例 #1
0
 private boolean isinputContainerOutput(Connection connec) {
   boolean isREF = connec.getLineStyle().equals(EConnectionType.FLOW_REF);
   if (isREF && (connec.getTarget().getOutgoingConnections().size() == 1)) {
     if (connec
         .getTarget()
         .getOutgoingConnections()
         .get(0)
         .getLineStyle()
         .equals(EConnectionType.FLOW_REF)) {
       return true;
     }
   }
   return false;
 }
コード例 #2
0
 private boolean conSchema() {
   Connection connection = (Connection) elem;
   return connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA);
 }
コード例 #3
0
 private boolean conIf() {
   Connection connection = (Connection) elem;
   return connection.getLineStyle() == EConnectionType.RUN_IF
       || connection.getLineStyle() == EConnectionType.ROUTE_WHEN;
 }
コード例 #4
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
  */
 public String getText(Object objects) {
   Node node = null;
   if (objects == null || objects.equals(StructuredSelection.EMPTY)) {
     return "No items selected"; //$NON-NLS-1$
   }
   if (!(objects instanceof IStructuredSelection)) {
     return null;
   }
   final boolean[] multiple = {false};
   Object object = getObject(objects, multiple);
   if (object == null /* || ((IStructuredSelection) objects).size() > 1 */) {
     return "No items selected"; //$NON-NLS-1$
   } else {
     if (object instanceof NodeContainerPart) {
       NodeContainerPart nContainer = (NodeContainerPart) object;
       Process process = (Process) nContainer.getParent().getModel();
       return process.getName();
     } else if (object instanceof ProcessPart) {
       Process process = (Process) ((ProcessPart) object).getModel();
       return process.getLabel();
     } else if (object instanceof ProcessTreeEditPart) {
       Process process = (Process) ((ProcessTreeEditPart) object).getModel();
       return process.getName();
     }
     if (object instanceof ConnectionPart) {
       Connection conn = (Connection) ((ConnectionPart) object).getModel();
       return conn.getName();
     }
     if (object instanceof NoteEditPart) {
       return Note.class.getSimpleName();
     }
     if (object instanceof ConnLabelEditPart) {
       Connection conn =
           (Connection)
               ((ConnectionLabel) ((ConnLabelEditPart) object).getModel()).getConnection();
       return conn.getName();
     }
     if (object instanceof NodeTreeEditPart) {
       node = (Node) ((NodeTreeEditPart) object).getModel();
     } else {
       if (object instanceof NodeReturnsTreeEditPart) {
         node = lastNode;
       } else {
         if (object instanceof NodeLabelEditPart) {
           node = ((NodeContainer) ((NodeLabelEditPart) object).getParent().getModel()).getNode();
         }
         if (!(object instanceof NodePart)) {
           return null;
         }
         if (node == null) {
           node = (Node) ((NodePart) object).getModel();
         }
       }
     }
     if (lastNode != node) {
       lastNode = node;
     }
     String name = node.getUniqueName();
     // if (!node.getComponent().getTranslatedName().equals(node.getComponent().getName())) {
     // name += " (" + node.getComponent().getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
     // }
     return name;
   }
 }
コード例 #5
0
  private void initializeContainer() {
    outputdataContainer = new IODataComponentContainer();
    for (Connection connec : (List<Connection>) node.getIncomingConnections()) {
      if (connec.getLineStyle().equals(EConnectionType.FLOW_MAIN)) {
        IODataComponent input = null;
        if (newInputMetadata == null) {
          input = new IODataComponent(connec);
        } else {
          if (connec.getMetaName().equals(newInputMetadata.getTableName())) {
            input = new IODataComponent(connec, newInputMetadata);
          }
        }
        if (input != null) {
          outputdataContainer.getInputs().add(input);
        }
      }
    }
    for (Connection connec : (List<Connection>) node.getOutgoingConnections()) {
      if (connec.getLineStyle().equals(EConnectionType.FLOW_MAIN)
          || isinputContainerOutput(connec)
          || ((connec.getLineStyle().equals(EConnectionType.FLOW_MERGE)
              && (connec.getInputId() == 1)))) {
        if ((!connec.getSource().getConnectorFromType(connec.getLineStyle()).isMultiSchema())
            || (connec.getMetaName().equals(newOutputMetadata.getTableName()))) {
          IODataComponent output = new IODataComponent(connec, newOutputMetadata);
          outputdataContainer.getOuputs().add(output);
        }
      }
    }

    if (inputNode != null) {
      inputdataContainer = new IODataComponentContainer();
      for (Connection connec : (List<Connection>) inputNode.getOutgoingConnections()) {
        if (connec.getTarget().equals(node)) {
          if ((!connec.getSource().getConnectorFromType(connec.getLineStyle()).isMultiSchema())
              || (connec.getMetaName().equals(newInputMetadata.getTableName()))) {
            IODataComponent output = new IODataComponent(connec, newInputMetadata);
            inputdataContainer.getOuputs().add(output);
          }
        }
      }
    }
  }