Package org.jboss.aesh.console.settings

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


   private Shell shell;

   @Override
   public void initialize(ShellHandleSettings settings)
   {
      SettingsBuilder settingsBuilder = new SettingsBuilder()
               .inputStream(settings.stdIn())
               .outputStream(settings.stdOut())
               .outputStreamError(settings.stdErr())
               .enableMan(true);
      if (settings.terminal() != null)
      {
         settingsBuilder.terminal(new ForgeTerminal(settings.terminal()));
      }
      this.shell = shellFactory.createShell(settings.currentResource(), settingsBuilder.create());
   }
View Full Code Here


   public void startupDefaultShell(@Observes PostStartup startup) throws Exception
   {
      if (!Boolean.getBoolean("forge.compatibility.IDE"))
      {
         Settings settings = new SettingsBuilder().create();
         this.shell = shellFactory.createShell(OperatingSystemUtils.getUserHomeDir(), settings);
      }
   }
View Full Code Here

         settings = provider.buildAeshSettings();
         instances.release(provider);
      }
     
      if (settings == null) {
         settings = new SettingsBuilder()
            .readInputrc(false)
            .logging(true)
            .create();
      }
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

                        .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

      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)
               .enableExport(true)
               .setExportUsesSystemEnvironment(true)
               .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(initialResource))
               .settings(newSettings.create())
               .commandRegistry(registry)
               .commandNotFoundHandler(new ForgeCommandNotFoundHandler(registry))
               .create();
      this.output = new ShellUIOutputImpl(console);
      setCurrentResource(initialResource);
View Full Code Here

   private Shell shell;

   @Override
   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

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

                  PrintStream stdout = new UncloseablePrintStream(output.out());
                  PrintStream stderr = new UncloseablePrintStream(output.err());

                  Settings settings = new SettingsBuilder()
                           .inputStream(new PipedInputStream(stdin))
                           .outputStream(stdout)
                           .outputStreamError(stderr)
                           .create();
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);

        CommandRegistry registry = new AeshCommandRegistryBuilder()
                .command(ExitCommand.class)
                .command(Less.class)
                .command(More.class)
                .command(Harlem.class)
                .command(Clear.class)
                .command(Matrix.class)
                .command(GroovyCommand.class)
                .command(Ls.class)
                .command(Grep.class)
                .command(Cat.class)
                .create();

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

        aeshConsole.start();
    }
View Full Code Here

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

        SettingsBuilder builder = new SettingsBuilder().logging(true);
        builder.enableMan(true)
                .readInputrc(true);
                /*
                .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

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.