Codota Logo
org.beryx.textio
Code IndexAdd Codota to your IDE (free)

How to use org.beryx.textio

Best Java code snippets using org.beryx.textio (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: beryx/text-io

private Holder() {
  TextTerminal<?> t = getTerminalFromProperty();
  if(t == null) {
    t = getTerminalFromService();
  }
  if(t == null) {
    t = getDefaultTerminal();
  }
  t.init();
  this.terminal = t;
  this.textIO = new TextIO(t);
}
origin: beryx/text-io

/**
 * Provides the list of error messages for the input string <tt>s</tt>.
 * If a {@link #parseErrorMessagesProvider} exists, it will be used. Otherwise, {@link #getDefaultErrorMessages(String)} will be called.
 */
protected final List<String> getErrorMessages(String s) {
  if(parseErrorMessagesProvider != null) return parseErrorMessagesProvider.getErrorMessages(s, itemName);
  return getDefaultErrorMessages(s);
}
origin: beryx/text-io

@SuppressWarnings({ "rawtypes", "unchecked" })
public AbstractTextTerminal() {
  this.properties = new TerminalProperties(this);
  addDefaultProperty(PropertiesConstants.PROP_USER_INTERRUPT_KEY, DEFAULT_USER_INTERRUPT_KEY);
}
origin: beryx/text-io

public static ReadInterruptionData from(ReadHandlerData handlerData, String partialInput) {
  Function<String, String> valueProvider = handlerData.getReturnValueProvider();
  String retVal = (valueProvider == null) ? null : valueProvider.apply(partialInput);
  return new ReadInterruptionData(handlerData.getAction())
      .withRedrawRequired(handlerData.isRedrawRequired())
      .withPayload(handlerData.getPayload())
      .withReturnValue(retVal);
}
origin: beryx/text-io

private static void configurePort(TextIO textIO, WebTextIoExecutor webTextIoExecutor, int defaultPort) {
  int port = textIO.newIntInputReader()
      .withDefaultValue(defaultPort)
      .read("Server port number");
  webTextIoExecutor.withPort(port);
}
origin: beryx/text-io

/**
 * Prints a message that possibly contains line separators and subsequently prints a line separator.
 */
default void println(String message) {
  print(message);
  println();
}
origin: beryx/text-io

/**
 * Clears the text after the given bookmark.
 * The bookmark name can be subsequently used in a call to {@link #resetToBookmark(String)} in order to clear the text after this bookmark.
 * Since not all terminals support this feature, the default implementation calls {@link #println()} and returns false.
 * @return true, if the terminal supports bookmarking, the given bookmark exists and the text after it has been successfully cleared.
 */
default boolean resetToBookmark(String bookmark) {
  println();
  return false;
}
origin: beryx/text-io

/** Convenience method that associates the specified {@code bgcolor} with the key {@value PropertiesConstants#PROP_PANE_BGCOLOR} */
public void setPaneBackgroundColor(String bgcolor) {
  put(PROP_PANE_BGCOLOR, bgcolor);
}
/** Convenience method that associates the hex representation of the specified {@code bgcolor} with the key {@value PropertiesConstants#PROP_PANE_BGCOLOR} */
origin: beryx/text-io

  @Override
  protected ParseResult<Float> parse(String s) {
    try {
      return new ParseResult<>(Float.parseFloat(s));
    } catch (NumberFormatException e) {
      return new ParseResult<>(null, getErrorMessages(s));
    }
  }
}
origin: beryx/text-io

  @Override
  protected ParseResult<Double> parse(String s) {
    try {
      return new ParseResult<>(Double.parseDouble(s));
    } catch (NumberFormatException e) {
      return new ParseResult<>(null, getErrorMessages(s));
    }
  }
}
origin: beryx/text-io

  @Override
  protected ParseResult<Long> parse(String s) {
    try {
      return new ParseResult<>(Long.parseLong(s));
    } catch (NumberFormatException e) {
      return new ParseResult<>(null, getErrorMessages(s));
    }
  }
}
origin: beryx/text-io

  @Override
  protected ParseResult<Byte> parse(String s) {
    try {
      return new ParseResult<>(Byte.parseByte(s));
    } catch (NumberFormatException e) {
      return new ParseResult<>(null, getErrorMessages(s));
    }
  }
}
origin: beryx/text-io

  @Override
  protected ParseResult<Short> parse(String s) {
    try {
      return new ParseResult<>(Short.parseShort(s));
    } catch (NumberFormatException e) {
      return new ParseResult<>(null, getErrorMessages(s));
    }
  }
}
origin: beryx/text-io

@Override
protected ParseResult<Boolean> parse(String s) {
  if(trueInput.equalsIgnoreCase(s)) return new ParseResult<>(true);
  if(falseInput.equalsIgnoreCase(s)) return new ParseResult<>(false);
  return new ParseResult<>(null, getErrorMessages(s));
}
origin: beryx/text-io

/**
 * Convenience method that adds a listener for the long property with the specified key.
 * @param key the key of the property for which the listener is added.
 * @param defaultValue the value to be used if the new value cannot be converted to a long.
 * @param listener the listener to be added.
 */
public void addLongListener(String key, long defaultValue, LongChangeListener<T> listener) {
  listeners.add(new ChangeListenerForKey<>(key, defaultValue, Long::parseLong, listener.get()));
}
origin: beryx/text-io

/**
 * Convenience method that adds a listener for the boolean property with the specified key.
 * @param key the key of the property for which the listener is added.
 * @param defaultValue the value to be used if the new value is null.
 * @param listener the listener to be added.
 */
public void addBooleanListener(String key, boolean defaultValue, BooleanChangeListener<T> listener) {
  listeners.add(new ChangeListenerForKey<>(key, defaultValue, Boolean::parseBoolean, listener.get()));
}
origin: beryx/text-io

  @Override
  public String toString() {
    return super.toString() + ", returnValue: " + returnValue;
  }
}
origin: beryx/text-io

@SuppressWarnings("unchecked")
public B withInlinePossibleValues(T... possibleValues) {
  withPossibleValues(possibleValues);
  this.inlinePossibleValues = true;
  return (B)this;
}
origin: beryx/text-io

/** Convenience method that associates the specified {@code width} with the key {@value PropertiesConstants#PROP_PANE_WIDTH} */
public void setPaneWidth(int width) {
  put(PROP_PANE_WIDTH, width);
}
/** Convenience method that associates the specified {@code height} with the key {@value PropertiesConstants#PROP_PANE_HEIGHT} */
origin: beryx/text-io

/** Convenience method that associates the specified {@code height} with the key {@value PropertiesConstants#PROP_PANE_HEIGHT} */
public void setPaneHeight(int height) {
  put(PROP_PANE_HEIGHT, height);
}
/** Convenience method that associates the specified {@code width} and {@code height} with the keys {@value PropertiesConstants#PROP_PANE_WIDTH} and {@value PropertiesConstants#PROP_PANE_HEIGHT}*/
org.beryx.textio

Most used classes

  • ReadHandlerData
  • TerminalProperties
    A map of properties associated with a TextTerminal.
  • TextIO
    A factory for creating InputReaders. All InputReaders created by the same TextIO instance share the
  • BooleanInputReader
    A reader for boolean values. Allows configuring which string value should be interpreted as true and
  • DoubleInputReader
    A reader for double values.
  • IntInputReader,
  • ReadAbortedException,
  • StringInputReader,
  • TextTerminal,
  • EnumInputReader,
  • InputReader,
  • KeyCombination,
  • PropertiesPrefixes,
  • ReadInterruptionData,
  • ReadInterruptionException,
  • TextIoFactory,
  • TextTerminalProvider,
  • ConsoleTextTerminalProvider,
  • JLineTextTerminalProvider
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now