Package org.jboss.aesh.console.settings

Examples of org.jboss.aesh.console.settings.SettingsBuilder


      public Settings getSettings()
      {
         try
         {
            inputStream = new PipedInputStream(stdin);
            settings = new SettingsBuilder()
                     .inputStream(inputStream)
                     .outputStream(new PrintStream(stdout))
                     .outputStreamError(new PrintStream(stderr))
                     .name("test")
                     .logging(true)
View Full Code Here


                        .type(String.class)
                        .create())
                .create();
                */

        SettingsBuilder builder = new SettingsBuilder().logging(true);
        builder.enableMan(true)
                .readInputrc(false);
                /*
                .interruptHook(new InterruptHook() {
                    @Override
                    public void handleInterrupt(Console console) {
                        console.getShell().out().println("^C");
                        console.clearBufferAndDisplayPrompt();
                    }
                });
                */
        Settings settings = builder.create();
        CommandRegistry registry = new AeshCommandRegistryBuilder()
                .command(ExitCommand.class)
                .command(fooCommand.generate())
                .command(LsCommand.class)
                .command(TestConsoleCommand.class)
View Full Code Here

   public ShellImpl(FileResource<?> initialResource, Settings settings,
            CommandManager commandManager, AddonRegistry addonRegistry, CommandControllerFactory commandFactory)
   {
      this.currentResource = initialResource;
      this.addonRegistry = addonRegistry;
      Settings newSettings = new SettingsBuilder(settings).interruptHook(new InterruptHook()
      {
         @Override
         public void handleInterrupt(Console console)
         {
            console.getShell().out().println("^C");
View Full Code Here

               final ByteArrayOutputStream stderr = new ByteArrayOutputStream();
               BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdin));

               Shell scriptShell = shellFactory.createShell(((FileResource<?>) context.getUIContext()
                        .getInitialSelection().get()).getUnderlyingResourceObject(),
                        new SettingsBuilder().inputStream(new PipedInputStream(stdin))
                                 .outputStream(new PrintStream(stdout))
                                 .outputStreamError(new PrintStream(stderr)).create());

               BufferedReader reader = new BufferedReader(new InputStreamReader(resource.getResourceInputStream()));
View Full Code Here

      File history = new File(forgeHome, "history");
      File alias = new File(forgeHome, "alias");
      File export = new File(forgeHome, "export");
      final ForgeCommandRegistry registry =
               new ForgeCommandRegistry(this, addonRegistry);
      SettingsBuilder newSettings = new SettingsBuilder(settings)
               .historyFile(history)
               .aliasFile(alias)
               .exportFile(export)
               .interruptHook(new ForgeInterruptHook(registry));
      // If system property is set, force POSIXTerminal
      if (Boolean.getBoolean("org.jboss.forge.addon.shell.forcePOSIXTerminal"))
      {
         newSettings.terminal(new POSIXTerminal());
      }
      this.console = new AeshConsoleBuilder()
               .prompt(createPrompt())
               .settings(newSettings.create())
               .commandRegistry(registry)
               .commandNotFoundHandler(new ForgeCommandNotFoundHandler(registry))
               .create();
      this.output = new ShellUIOutputImpl(console);
      this.console.start();
View Full Code Here

               BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdin));

               PrintStream stdout = new UncloseablePrintStream(context.getUIContext().getProvider().getOutput().out());
               PrintStream stderr = new UncloseablePrintStream(context.getUIContext().getProvider().getOutput().err());

               Settings settings = new SettingsBuilder()
                        .inputStream(new PipedInputStream(stdin))
                        .outputStream(stdout)
                        .outputStreamError(stderr)
                        .create();
View Full Code Here

   private Shell shell;

   public void initialize(File currentResource, InputStream stdIn, PrintStream stdOut, PrintStream stdErr)
   {
      Settings settings = new SettingsBuilder()
               .inputStream(stdIn)
               .outputStream(stdOut)
               .outputStreamError(stdErr)
               .enableMan(true)
               .create();
View Full Code Here

                        .fieldName("foo")
                        .type(String.class)
                        .create())
                .generateCommand();

        SettingsBuilder builder = new SettingsBuilder().logging(true);
        builder.enableMan(true)
                .readInputrc(false);
                /*
                .interruptHook(new InterruptHook() {
                    @Override
                    public void handleInterrupt(Console console) {
                        console.getShell().out().println("^C");
                        console.clearBufferAndDisplayPrompt();
                    }
                });
                */
        Settings settings = builder.create();
        CommandRegistry registry = new AeshCommandRegistryBuilder()
                .command(ExitCommand.class)
                .command(fooCommand, FooCommand.class)
                .command(LsCommand.class)
                .command(TestConsoleCommand.class)
View Full Code Here

* @author <a href="mailto:stale.pedersen@jboss.org">Ståle W. Pedersen</a>
*/
public class AeshExampleExtension {

    public static void main(String[] args) throws IOException {
        SettingsBuilder settingsBuilder = new SettingsBuilder();
        settingsBuilder.readInputrc(false);
        settingsBuilder.logging(true);

        Man man = new Man();

        CommandRegistry registry = new AeshCommandRegistryBuilder()
                .command(ExitCommand.class)
                .command(Less.class)
                .command(More.class)
                .command(man)
                .command(Harlem.class)
                .command(GroovyCommand.class)
                .command(Ls.class)
                .command(Grep.class)
                .create();
        //the man command need access to the registry
        man.setRegistry(registry);

        AeshConsole aeshConsole = new AeshConsoleBuilder()
                .commandRegistry(registry)
                .settings(settingsBuilder.create())
                .prompt(new Prompt("[aesh@extensions]$ "))
                .create();

        aeshConsole.start();
    }
View Full Code Here

public class ExampleExtension {

    public static void main(String[] args) throws IOException {

        //Settings.getInstance().setAnsiConsole(false);
        SettingsBuilder settingsBuilder = new SettingsBuilder();
        settingsBuilder.readInputrc(false);
        settingsBuilder.logging(true);
        final Console exampleConsole = new Console(settingsBuilder.create());

        PrintWriter out = new PrintWriter(System.out);

        final Man man = new Man(exampleConsole);
        //man.addPage(new File("/tmp/README.md"), "test");
View Full Code Here

TOP

Related Classes of org.jboss.aesh.console.settings.SettingsBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.