Ejemplo n.º 1
0
  @SuppressWarnings("unchecked")
  public Widget createOutputPortTable() {
    VerticalPanel outputPanel = new VerticalPanel();

    Label hintLabel =
        new Label("Define the postcondtion where this resource will deliver results:");

    outputPanel.add(hintLabel);

    outputPortTable = new FlexTable();

    int numRows = outputPortTable.getRowCount();

    // Add new output port Button
    Button addOutputPortButton = new Button("Add postcondition");
    addOutputPortButton.setStyleName("fastButton");
    addOutputPortButton.addClickHandler(new AddNewOutputPortHandler());
    outputPortTable.setWidget(numRows, 0, addOutputPortButton);
    numRows++;

    // add output header row
    outputPortTable.setWidget(numRows, 0, new Label("Postcondition name"));
    outputPortTable.setWidget(numRows, 1, new Label("Postcondition type"));
    numRows++;

    // add rows for existing output fact ports
    Iterator<FactPort> iteratorOfPostconditions = buildingBlock.iteratorOfPostconditions();
    while (iteratorOfPostconditions.hasNext()) {
      FactPort factPort = iteratorOfPostconditions.next();

      // per fact port add one row with three text boxes for name, type, and example value
      createOutputTableRowFor(factPort);
    }

    if (longExampleValues) {
      // updateListener
      UpdateTransformationTabListener updateTabListener = new UpdateTransformationTabListener();
      buildingBlock.addPropertyChangeListener(
          BuildingBlock.PROPERTY_POSTCONDITIONS, updateTabListener);
    }

    // return the panel
    outputPortTable.ensureDebugId("cwFlexTable");

    outputPanel.add(outputPortTable);

    return outputPanel;
  }
Ejemplo n.º 2
0
  @SuppressWarnings("unchecked")
  public Widget createInputPortTable() {
    portPanel = new VerticalPanel();

    Label hintLabel =
        new Label("Define the preconditions where previous building blocks may provide data:");

    portPanel.add(hintLabel);

    inputPortTable = new FlexTable();

    int numRows = inputPortTable.getRowCount();

    // add the add-buttons
    // Add new input port Button
    Button addInputPortButton = new FastButton("Add precondition");
    addInputPortButton.addClickHandler(new AddNewInputPortHandler());
    inputPortTable.setWidget(numRows, 0, addInputPortButton);
    numRows++;

    // add input header row
    inputPortTable.setWidget(numRows, 0, new Label("Precondition name:"));
    inputPortTable.setWidget(numRows, 1, new Label("Precondition type:"));
    if (longExampleValues) {
      inputPortTable.setWidget(numRows, 2, new Label("List of example values"));
    } else {
      inputPortTable.setWidget(numRows, 2, new Label("Example value:"));
    }
    numRows++;

    // add rows for existing input fact ports
    Iterator<FactPort> iteratorOfPreconditions = buildingBlock.iteratorOfPreconditions();
    while (iteratorOfPreconditions.hasNext()) {
      FactPort factPort = iteratorOfPreconditions.next();

      // per fact port add one row with three text boxes for name, type, and example value
      createInputTableRowFor(factPort);
    }

    // return the panel
    inputPortTable.ensureDebugId("cwFlexTable");

    portPanel.add(inputPortTable);

    return portPanel;
  }