org.fusesource.jansi.Ansi.setEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(136)

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

Ansi.setEnabled介绍

暂无

代码示例

代码示例来源:origin: fabric8io/docker-maven-plugin

private void initializeColor(boolean useColor) {
  // sl4j simple logger used by Maven seems to escape ANSI escapes on Windows
  this.useAnsi = useColor && System.console() != null && !log.isDebugEnabled() && !isWindows();
  if (useAnsi) {
    AnsiConsole.systemInstall();
    Ansi.setEnabled(true);
  }
  else {
    Ansi.setEnabled(false);
  }
}

代码示例来源:origin: org.apache.maven.plugins/maven-surefire-report-plugin

/**
 * Enables message color (if JAnsi is available).
 * @param flag
 */
public static void setColorEnabled( boolean flag )
{
  if ( JANSI )
  {
    Ansi.setEnabled( flag );
  }
}

代码示例来源:origin: org.apache.maven.shared/maven-shared-utils

/**
 * Enables message color (if JAnsi is available).
 * @param flag
 */
public static void setColorEnabled( boolean flag )
{
  if ( JANSI )
  {
    Ansi.setEnabled( flag );
  }
}

代码示例来源:origin: org.jolokia/docker-maven-plugin

private void initializeColor(boolean useColor) {
  if (System.console() == null || log.isDebugEnabled()) {
    useColor = false;
  }
  
  if (useColor) {
    AnsiConsole.systemInstall();
    Ansi.setEnabled(true);
  }
  else {
    Ansi.setEnabled(false);
  }
}

代码示例来源:origin: io.fabric8.updatebot/updatebot-core

private boolean useAnsiColor() {
  if (!ansiInitialised) {
    this.useAnsi = !isDisableAnsi() && System.console() != null && !isWindows();
    if (useAnsi) {
      //AnsiConsole.systemInstall();
      Ansi.setEnabled(true);
    } else {
      Ansi.setEnabled(false);
    }
    ansiInitialised = true;
  }
  return useAnsi;
}

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

private boolean useAnsiColor() {
  if (!ansiInitialised) {
    this.useAnsi = !isDisableAnsi() && System.console() != null && !isWindows();
    if (useAnsi) {
      //AnsiConsole.systemInstall();
      Ansi.setEnabled(true);
    } else {
      Ansi.setEnabled(false);
    }
    ansiInitialised = true;
  }
  return useAnsi;
}

代码示例来源:origin: neo4j/cypher-shell

public AnsiLogger(final boolean debug, @Nonnull Format format,
         @Nonnull PrintStream out, @Nonnull PrintStream err) {
  this.debug = debug;
  this.format = format;
  this.out = out;
  this.err = err;
  try {
    if (isOutputInteractive()) {
      Ansi.setEnabled(true);
      AnsiConsole.systemInstall();
    } else {
      Ansi.setEnabled(false);
    }
  } catch (Throwable t) {
    // Not running on a distro with standard c library, disable Ansi.
    Ansi.setEnabled(false);
  }
}

代码示例来源:origin: visallo/vertexium

Ansi.setEnabled(!suppressColor);
} else {
  Ansi.setEnabled(false);

代码示例来源:origin: org.sonatype.gshell/gshell-core

@Preference(name = "color")
@Option(name = "C", longName = "color")
protected void enableAnsiColors(final Boolean flag) {
  Ansi.setEnabled(flag);
}

代码示例来源:origin: dCache/dcache

/**
 * Start processing the command(s), based on the supplied arguments.
 */
protected void start(Args args) throws Throwable
{
  if (args.hasOption("h")) {
    System.out.println("Usage: " + getCommandName() + " [-e] [-f=<file>]|[-]|[COMMAND]");
    System.out.println();
    System.out.println("Use '" + getCommandName() + " help' for an overview of available commands.");
    System.exit(0);
  }
  Ansi.setEnabled(isAnsiSupported);
  if (args.hasOption("f")) {
    try (InputStream in = new FileInputStream(args.getOption("f"))) {
      execute(new BufferedInputStream(in), System.out, args.hasOption("e"));
    }
  } else if (args.argc() == 1 && args.argv(0).equals("-")) {
    execute(System.in, System.out, args.hasOption("e"));
  } else if (args.argc() > 0) {
    execute(args);
  } else if (!hasConsole) {
    execute(System.in, System.out, args.hasOption("e"));
  } else {
    console();
  }
}

代码示例来源:origin: zanata/zanata-platform

String format(String format, Object... args) {
  Ansi ansi = Ansi.ansi();
  Ansi.setEnabled(ansiEnabled);
  switch (mode) {
    case Hint:

代码示例来源:origin: org.zanata/zanata-client-commands

String format(String format, Object... args) {
  Ansi ansi = Ansi.ansi();
  Ansi.setEnabled(ansiEnabled);
  switch (mode) {
    case Hint:

相关文章