com.vaadin.ui.TextArea.commit()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(108)

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

TextArea.commit介绍

暂无

代码示例

代码示例来源:origin: org.aperteworkflow/base-widgets

@Override
public void commit() throws SourceException, Validator.InvalidValueException {
  rawText.commit();
}

代码示例来源:origin: org.aperteworkflow/base-widgets

private void validateAndSave() throws Validator.InvalidValueException {
  if (code.getValue() == null || ((String) code.getValue()).trim().isEmpty()) {
    commit();
    return;
  }
  try {
    ScriptProcessorRegistry registry = ProcessToolContext.Util.getThreadProcessToolContext().getRegistry().lookupService(
        ScriptProcessorRegistry.class.getName());
    Property scriptType = formProperties.get("scriptEngineType");
    if (scriptType == null || scriptType.getValue() == null || ((String) scriptType.getValue()).isEmpty())
      throw new Validator.InvalidValueException("script.undefined.type");
    ScriptProcessor scriptProcessor = registry.getScriptProcessor((String) scriptType.getValue());
    if (scriptProcessor == null)
      throw new Validator.InvalidValueException("script.processor.not.found");
    InputStream is = new ByteArrayInputStream(((String) code.getValue()).getBytes());
    scriptProcessor.validate(is);
    code.commit();
    showInfoNotification("validation.script.ok");
  } catch (Validator.InvalidValueException e) {
    logger.log(Level.SEVERE, e.getMessage(), e);
    showWarningNotification(e.getMessage(), null);
  } catch (Exception e) {
    logger.log(Level.SEVERE, e.getMessage(), e);
    showWarningNotification("validation.script.error", e.getMessage());
  }
}

代码示例来源:origin: org.opennms.features/vaadin-snmp-events-and-metrics

@Override
public void buttonClick(ClickEvent event) {
  if (event.getButton().equals(save)) {
    if (editor.isReadOnly()) {
      Notification.show("Unsupported action for readOnly viewer.", Notification.Type.WARNING_MESSAGE);
    } else {
      editor.commit();
      logger.info("The file " + file + " has been changed.");
    }
  }
  if (event.getButton().equals(cancel)) {
    if (!editor.isReadOnly())
      logger.info("The file editing has been canceled.");
    editor.discard();
  }
  close();
}

相关文章