gpt4 book ai didi

com.github.bordertech.wcomponents.WText.setText()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 18:17:05 28 4
gpt4 key购买 nike

本文整理了Java中com.github.bordertech.wcomponents.WText.setText()方法的一些代码示例,展示了WText.setText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WText.setText()方法的具体详情如下:
包路径:com.github.bordertech.wcomponents.WText
类名称:WText
方法名:setText

WText.setText介绍

[英]Sets the text.

NOTE: If the text is dynamically generated, it may be preferable to override #getText() instead. This will reduce the amount of data which is stored in the user session.
[中]

代码示例

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

/**
 * Override of preparePaintComponent to set the dynamic (user specific) text.
 *
 * @param request the request being responded to.
 */
@Override
public void preparePaintComponent(final Request request) {
  String dateStr = "The current date is " + new Date();
  dynamicText.setText(dateStr);
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
  public void execute(final ActionEvent event) {
    if (dinnerCheckbox.isSelected()) {
      info.setText("Dinner selected");
    } else {
      info.setText("Dinner unselected");
    }
  }
});

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
public void execute(final ActionEvent event) {
  if (breakfastCheckbox.isSelected()) {
    info.setText("Breakfast selected");
  } else {
    info.setText("Breakfast unselected");
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
  public void execute(final ActionEvent event) {
    if (lunchCheckbox.isSelected()) {
      info.setText("Lunch selected");
    } else {
      info.setText("Lunch unselected");
    }
  }
});

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
  public void execute(final ActionEvent event) {
    txtNow.setText("Date Selected : " + pdfDate.getValueAsString());
  }
});

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

/**
   * Copies data from the Model into the View.
   *
   * @param data the MyData bean to set on the component.
   */
  @Override
  public void updateComponent(final Object data) {
    MyData myData = (MyData) data;
    name.setText("<B>" + myData.getName() + "</B>");
    count.setText(String.valueOf(myData.getCount()));
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
  public void execute(final ActionEvent event) {
    String html = htmlEditor.getText();
    injectedHtml.setText(html);
  }
});

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

/**
   * {@inheritDoc}
   */
  @Override
  public void updateComponent(final Object data) {
    MyData bean = (MyData) data;
    name.setText(bean.getName());
    count.setText(String.valueOf(bean.getCount()));
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

/**
   * Read fields is a simple method to read all the fields and populate the encoded text fields.
   */
  private void readFields() {
    plain.setText(tf1.getText());
    mandatory.setText(tf2.getText());
    readOnly.setText(tf3.getText());
    disabled.setText(tf4.getText());
    width.setText(tf5.getText());
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
  public void execute(final ActionEvent event) {
    ajaxContent.setText(before.equals(ajaxContent.getText()) ? after : before);
  }
});

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
  public void execute(final ActionEvent event) {
    message.setText(
        "The \"" + event.getActionCommand() + "\" button was pressed at " + new Date());
  }
});

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
  public void execute(final ActionEvent event) {
    String selected = (String) drop.getSelected();
    if (selected != null) {
      selected = selected.replaceAll(" ", "%20");
    }
    text.setText(selected);
  }
});

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

/**
   * {@inheritDoc}
   */
  @Override
  public void execute(final ActionEvent event) {
    if (event.getActionObject() == null) {
      throw new IllegalStateException("Missing action object");
    } else {
      selectedMenuText.setText(event.getActionObject().toString());
    }
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

/**
 * @param request the request being processed
 */
@Override
protected void preparePaintComponent(final Request request) {
  WApplication appl = findApplication();
  if (appl != null) {
    msg.setText("Unsaved changes: " + (appl.hasUnsavedChanges() ? "Yes" : "No"));
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
  public void execute(final ActionEvent event) {
    messages.addMessage(new Message(Message.SUCCESS_MESSAGE,
        link4.getText() + " clicked"));
    text.setText("Link Action: " + new Date().toString());
  }
};

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
public void execute(final ActionEvent event) {
  WTabSet tabSet = (WTabSet) event.getSource();
  int activeIndex = tabSet.getActiveIndex();
  String time = " The time is now " + new Date().toString();
  if (activeIndex == tabset.getTabIndex(text1)) {
    text1.setText(text1.getText() + time);
  } else if (activeIndex == tabset.getTabIndex(text2)) {
    text2.setText(text2.getText() + time);
  } else if (activeIndex == tabset.getTabIndex(text3)) {
    text3.setText(text3.getText() + time);
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

/**
 * {@inheritDoc}
 */
@Override
protected void preparePaintComponent(final Request request) {
  if (!isInitialised()) {
    repeater.setData(Arrays.asList(new String[]{"A", "B", "C"}));
    setInitialised(true);
  }
  text.setText("Selected: " + (group.getSelectedValue() == null ? "" : group.
      getSelectedValue().toString()));
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

@Override
  public void execute(final ActionEvent event) {
    PersonBean person = (PersonBean) button.getBean();
    actionText.setText("Action for: " + person.getFirstName() + ' ' + person.
        getLastName());
  }
});

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

/**
 * {@inheritDoc}
 */
@Override
public void updateComponent(final Object data) {
  MyData bean = (MyData) data;
  name.setText(bean.getName());
  name.setActionObject(bean);
  count.setText(String.valueOf(bean.getCount()));
  incBtn.setActionObject(bean);
  decBtn.setActionObject(bean);
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
  WText text = new WText();
  text.setText(getInvalidCharSequence());
  assertSafeContent(text);
  text.setText(getMaliciousContent());
  assertSafeContent(text);
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com