コード例 #1
0
  public void init(
      INode node,
      IElementParameter schemaParam,
      IMetadataTable currentOutputMetadata,
      IMetadataTable newOutputMetadata) {
    this.node = node;
    this.schemaParam = schemaParam;
    if (schemaParam == null) {
      if (newOutputMetadata.getAttachedConnector() != null) {
        currentConnector = newOutputMetadata.getAttachedConnector();
      } else {
        if (node.isELTComponent()) {
          currentConnector = EConnectionType.TABLE.getName();
        } else {
          currentConnector = EConnectionType.FLOW_MAIN.getName();
        }
      }
      for (IElementParameter param : node.getElementParameters()) {
        if (param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)
            && param.getContext().equals(currentConnector)) {
          this.schemaParam = param;
        }
      }
    } else {
      currentConnector = this.schemaParam.getContext();
    }

    this.inputNode = null;
    this.currentInputMetadata = null;
    this.newInputMetadata = null;
    oldInputMetadata = null;
    this.currentOutputMetadata = currentOutputMetadata;
    if (this.currentOutputMetadata == null) {
      this.currentOutputMetadata = node.getMetadataFromConnector(currentConnector);
    }
    if (currentOutputMetadata == null && newOutputMetadata != null) {
      currentOutputMetadata = newOutputMetadata.clone(true);
    }
    oldOutputMetadata = this.currentOutputMetadata.clone(true);
    this.newOutputMetadata = newOutputMetadata.clone(true);
    this.newOutputMetadata.setReadOnly(this.currentOutputMetadata.isReadOnly());
    initializeContainer();
    setLabel(Messages.getString("ChangeMetadataCommand.changeMetadataValues")); // $NON-NLS-1$
  }
コード例 #2
0
 public ChangeMetadataCommand(
     INode node,
     IElementParameter schemaParam,
     INode inputNode,
     IMetadataTable currentInputMetadata,
     IMetadataTable newInputMetadata,
     IMetadataTable currentOutputMetadata,
     IMetadataTable newOutputMetadata) {
   this.node = node;
   this.inputNode = inputNode;
   this.schemaParam = schemaParam;
   if (schemaParam == null) {
     currentConnector = EConnectionType.FLOW_MAIN.getName();
     for (IElementParameter param : node.getElementParameters()) {
       if ((param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)
               || param.getFieldType().equals(EParameterFieldType.DCSCHEMA))
           && param.getContext().equals(currentConnector)) {
         this.schemaParam = param;
       }
     }
   } else {
     currentConnector = this.schemaParam.getContext();
   }
   this.currentInputMetadata = currentInputMetadata;
   if (currentInputMetadata != null) {
     oldInputMetadata = currentInputMetadata.clone();
   } else {
     oldInputMetadata = null;
   }
   this.newInputMetadata = newInputMetadata;
   this.currentOutputMetadata = currentOutputMetadata;
   if (this.currentOutputMetadata == null) {
     this.currentOutputMetadata = node.getMetadataFromConnector(currentConnector);
   }
   oldOutputMetadata = this.currentOutputMetadata.clone();
   this.newOutputMetadata = newOutputMetadata;
   initializeContainer();
   setLabel(Messages.getString("ChangeMetadataCommand.changeMetadataValues")); // $NON-NLS-1$
 }