Codota Logo
TextIO.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.beryx.textio.TextIO
constructor

Best Java code snippets using org.beryx.textio.TextIO.<init> (Showing top 7 results out of 315)

  • Common ways to obtain TextIO
private void myMethod () {
TextIO t =
  • Codota IconTextTerminal textTerminal;new TextIO(textTerminal)
  • Smart code suggestions by Codota
}
origin: beryx/text-io

protected DataApi create(RatpackDataServer.ContextHolder ctxHolder, String initData) {
  String textTermSessionId = ctxHolder.contextId;
  logger.debug("Creating terminal for textTermSessionId: {}", textTermSessionId);
  WebTextTerminal terminal = termTemplate.createCopy();
  String mapKey = getSessionIdMapKey(textTermSessionId);
  terminal.setOnDispose(() -> {
    if(onDispose != null) {
      onDispose.accept(textTermSessionId);
    }
    Executors.newSingleThreadScheduledExecutor().schedule(() -> webTextTerminalCache.invalidate(mapKey), 5, TimeUnit.SECONDS);
  });
  terminal.setOnAbort(() -> {
    if(onAbort != null) {
      onAbort.accept(textTermSessionId);
    }
    Executors.newSingleThreadScheduledExecutor().schedule(() -> webTextTerminalCache.invalidate(mapKey), 5, TimeUnit.SECONDS);
  });
  webTextTerminalCache.put(mapKey, terminal);
  TextIO textIO = new TextIO(terminal);
  RunnerData runnerData = createRunnerData(initData, ctxHolder);
  Thread thread = new Thread(() -> textIoRunner.accept(textIO, runnerData));
  thread.setDaemon(true);
  thread.start();
  webTextTerminalCache.cleanUp();
  return terminal;
}
origin: mars-sim/mars-sim

public InteractiveTerm() {
  
  terminal = new MarsTerminal();
  terminal.init();
  
  textIO = new TextIO(terminal);
  
  setUpArrows();
  
  setUpESC();
}

origin: beryx/text-io

protected WebTextTerminal create(SessionHolder sessionHolder, String initData) {
  String sessionId = sessionHolder.sessionId;
  Session session = sessionHolder.session;
  logger.debug("Creating terminal for sessionId: {}", sessionId);
  WebTextTerminal terminal = termTemplate.createCopy();
  terminal.setOnDispose(() -> {
    if(onDispose != null) {
      onDispose.accept(sessionId);
    }
    Executors.newSingleThreadScheduledExecutor().schedule(() -> session.removeAttribute(getSessionIdAttribute(sessionId)), 5, TimeUnit.SECONDS);
  });
  terminal.setOnAbort(() -> {
    if(onAbort != null) {
      onAbort.accept(sessionId);
    }
    Executors.newSingleThreadScheduledExecutor().schedule(() -> session.removeAttribute(getSessionIdAttribute(sessionId)), 5, TimeUnit.SECONDS);
  });
  session.attribute(getSessionIdAttribute(sessionId), terminal);
  if(maxInactiveSeconds != null) {
    session.maxInactiveInterval(maxInactiveSeconds);
  }
  TextIO textIO = new TextIO(terminal);
  RunnerData runnerData = createRunnerData(initData, sessionHolder);
  Thread thread = new Thread(() -> textIoRunner.accept(textIO, runnerData));
  thread.setDaemon(true);
  thread.start();
  return terminal;
}
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

  public static void main(String[] args) {
    SystemTextTerminal sysTerminal = new SystemTextTerminal();
    TextIO sysTextIO = new TextIO(sysTerminal);

    BiConsumer<TextIO, RunnerData> app = chooseApp(sysTextIO);
    TextIO textIO = chooseTextIO();

    // Uncomment the line below to ignore user interrupts.
//        textIO.getTextTerminal().registerUserInterruptHandler(term -> System.out.println("\n\t### User interrupt ignored."), false);

    if(textIO.getTextTerminal() instanceof WebTextTerminal) {
      WebTextTerminal webTextTerm = (WebTextTerminal)textIO.getTextTerminal();
      TextIoApp<?> textIoApp = createTextIoApp(sysTextIO, app, webTextTerm);
      WebTextIoExecutor webTextIoExecutor = new WebTextIoExecutor();
      configurePort(sysTextIO, webTextIoExecutor, 8080);
      webTextIoExecutor.execute(textIoApp);
    } else {
      app.accept(textIO, null);
    }
  }

origin: beryx/text-io

private static TextIO chooseTextIO() {
  SystemTextTerminal terminal = new SystemTextTerminal();
  TextIO textIO = new TextIO(terminal);
  while(true) {
    TextTerminalProvider terminalProvider = textIO.<TextTerminalProvider>newGenericInputReader(null)
    return new TextIO(chosenTerminal);
origin: mars-sim/mars-sim

public static void main(String[] args) {
  SwingTextTerminal terminal = new SwingTextTerminal();
  terminal.init();
  TextIO textIO = new TextIO(terminal);
org.beryx.textioTextIO<init>

Popular methods of TextIO

  • dispose
  • getTextTerminal
  • newBooleanInputReader
  • newDoubleInputReader
  • newGenericInputReader
  • newIntInputReader
  • newStringInputReader
  • newEnumInputReader
  • newLongInputReader

Popular in Java

  • Reading from database using SQL prepared statement
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • getApplicationContext (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
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