private Widget getSetterLabel() {

    ClickHandler clk =
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            // Widget w = (Widget)event.getSource();
            showAddFieldPopup(event);
          }
        };
    String modifyType = "set";
    if (this.model instanceof ActionUpdateField) {
      modifyType = "modify";
    }

    String type = this.getModeller().getModel().getLHSBindingType(model.getVariable());

    String descFact =
        (type != null) ? type + " <b>[" + model.getVariable() + "]</b>" : model.getVariable();

    String sl =
        Constants.INSTANCE.setterLabel(HumanReadable.getActionDisplayName(modifyType), descFact);
    return new ClickableLabel(
        sl,
        clk,
        !this
            .readOnly); // HumanReadable.getActionDisplayName(modifyType) + " value of <b>[" +
                        // model.variable + "]</b>", clk);
  }
Beispiel #2
0
  private Widget getSetterLabel() {
    HorizontalPanel horiz = new HorizontalPanel();

    if (mCall.getState() == ActionCallMethod.TYPE_UNDEFINED) {
      Image edit = TestScenarioAltedImages.INSTANCE.AddFieldToFact();
      edit.setTitle(TestScenarioConstants.INSTANCE.AddAnotherFieldToThisSoYouCanSetItsValue());

      edit.addClickHandler(
          new ClickHandler() {

            public void onClick(ClickEvent event) {
              Image w = (Image) event.getSource();
              showAddFieldPopup(w);
            }
          });

      horiz.add(
          new SmallLabel(
              HumanReadable.getActionDisplayName("call")
                  + " ["
                  + mCall.getVariable()
                  + "]")); // NON-NLS
      horiz.add(edit);
    } else {
      horiz.add(
          new SmallLabel(
              HumanReadable.getActionDisplayName("call")
                  + " ["
                  + mCall.getVariable()
                  + "."
                  + mCall.getMethodName()
                  + "]")); // NON-NLS
    }

    return horiz;
  }
  protected Widget getCompositeLabel() {
    ClickHandler click =
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            Widget w = (Widget) event.getSource();
            showFactTypeSelector(w);
          }
        };
    String lbl = HumanReadable.getCEDisplayName(pattern.getType());

    if (pattern.getPatterns() == null || pattern.getPatterns().length == 0) {
      lbl += " <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>";
    }

    return new ClickableLabel(lbl + ":", click, !this.readOnly);
  }
  @Override
  protected Widget getCompositeLabel() {

    ClickHandler click =
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            Widget w = (Widget) event.getSource();
            showFactTypeSelector(w);
          }
        };
    String lbl =
        "<div class='form-field'>" + HumanReadable.getCEDisplayName("from entry-point") + "</div>";

    DirtyableFlexTable panel = new DirtyableFlexTable();

    int r = 0;

    if (pattern.getFactPattern() == null) {
      panel.setWidget(
          r,
          0,
          new ClickableLabel(
              "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>",
              click,
              !this.readOnly));
      r++;
    }

    panel.setWidget(r, 0, new HTML(lbl));

    this.txtEntryPoint = new TextBox();
    this.txtEntryPoint.setText(getFromEntryPointPattern().getEntryPointName());
    this.txtEntryPoint.addChangeHandler(
        new ChangeHandler() {

          public void onChange(ChangeEvent event) {
            getFromEntryPointPattern().setEntryPointName(txtEntryPoint.getText());
            setModified(true);
          }
        });
    panel.setWidget(r, 1, this.txtEntryPoint);

    return panel;
  }
  protected Widget getCompositeLabel() {

    ClickHandler click =
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            Widget w = (Widget) event.getSource();
            showFactTypeSelector(w);
          }
        };
    String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName("from") + "</div>";

    DirtyableFlexTable panel = new DirtyableFlexTable();

    int r = 0;

    if (pattern.getFactPattern() == null) {
      panel.setWidget(
          r,
          0,
          new ClickableLabel(
              "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>",
              click,
              !this.readOnly));
      r++;
    }

    panel.setWidget(r, 0, new HTML(lbl));
    ExpressionBuilder expressionBuilder =
        new ExpressionBuilder(
            this.getModeller(), this.getEventBus(), this.pattern.getExpression(), this.readOnly);
    expressionBuilder.addOnModifiedCommand(
        new Command() {
          public void execute() {
            setModified(true);
          }
        });
    panel.setWidget(r, 1, expressionBuilder);

    return panel;
  }