Package org.jboss.aesh.terminal

Examples of org.jboss.aesh.terminal.TerminalString


      writer.println(message);
   }

   public static void warn(final PrintStream writer, final String message)
   {
      writer.print(new TerminalString("***WARNING*** ", new TerminalColor(Color.YELLOW, Color.DEFAULT)));
      writer.println(message);
   }
View Full Code Here


            shell.out().println("Did you mean any of these?");
         }
         for (String plugin : similarPlugins)
         {
            shell.out().println(
                     new TerminalString("\t" + plugin,
                              new TerminalColor(Color.DEFAULT, Color.DEFAULT, Intensity.BRIGHT)));
         }
      }

   }
View Full Code Here

      {
         String name = commandFactory.getCommandName(context.getUIContext(), controller.getCommand());
         UICommandMetadata metadata = controller.getMetadata();
         display.add(metadata.getCategory()
                  + " > "
                  + new TerminalString(name, new TerminalColor(controller.isEnabled() ? Color.CYAN : Color.RED,
                           Color.DEFAULT)).toString() + " - " + metadata.getDescription());
      }

      UIOutput output = context.getUIContext().getProvider().getOutput();
      PrintStream out = output.out();
View Full Code Here

   public static String colorizeResource(FileResource<?> resource)
   {
      String name = resource.getName();
      if (resource.isDirectory())
      {
         name = new TerminalString(name, new TerminalColor(Color.BLUE, Color.DEFAULT)).toString();
      }
      else if (resource.isExecutable())
      {
         name = new TerminalString(name, new TerminalColor(Color.GREEN, Color.DEFAULT)).toString();
      }
      return name;
   }
View Full Code Here

   public static String colorizeJavaMethodResource(JavaMethodResource resource)
   {
      String name = resource.getName();
      String[] splitName = name.split("(?=\\:\\:)"); // split with "::" but preserve delimiter
      return splitName[0] + new TerminalString(splitName[1], new TerminalColor(Color.GREEN, Color.DEFAULT)).toString();
   }
View Full Code Here

   public static String colorizeJavaFieldResource(JavaFieldResource resource)
   {
      String name = resource.getName();
      String[] splitName = name.split("(?=\\:\\:)"); // split with "::" but preserve delimiter
      return splitName[0] + new TerminalString(splitName[1], new TerminalColor(Color.GREEN, Color.DEFAULT)).toString();
   }
View Full Code Here

      return splitName[0] + new TerminalString(splitName[1], new TerminalColor(Color.GREEN, Color.DEFAULT)).toString();
   }

   public static String colorizeLabel(String label)
   {
      return new TerminalString(label, new TerminalColor(Color.RED, Color.DEFAULT)).toString();
   }
View Full Code Here

      return new TerminalString(label, new TerminalColor(Color.RED, Color.DEFAULT)).toString();
   }

   public static TerminalString colorizeResourceTerminal(FileResource<?> resource)
   {
      TerminalString name;
      if (resource.isDirectory())
      {
         name = new TerminalString(resource.getName(), new TerminalColor(Color.BLUE, Color.DEFAULT));
      }
      else if (resource.isExecutable())
      {
         name = new TerminalString(resource.getName(), new TerminalColor(Color.GREEN, Color.DEFAULT));
      }
      else
      {
         name = new TerminalString(resource.getName());
      }
      return name;
   }
View Full Code Here

     public void removeEscapedSpacesFromCompletionCandidates() {
        Parser.switchEscapedSpacesToSpacesInTerminalStringList(getCompletionCandidates());
    }

    private void addStringCandidate(String completionCandidate) {
        this.completionCandidates.add(new TerminalString(completionCandidate, true));
    }
View Full Code Here

        List<TerminalString> fixedCandidates = new ArrayList<TerminalString>(completionCandidates.size());
        for(TerminalString c : completionCandidates) {
            if(!ignoreOffset && offset < cursor) {
                int pos = cursor - offset;
                if(c.getCharacters().length() >= pos) {
                    TerminalString ts = c;
                    ts.setCharacters(c.getCharacters().substring(pos));
                    fixedCandidates.add(ts);
                }
                else
                    fixedCandidates.add(new TerminalString("", true));
            }
            else {
                fixedCandidates.add(c);
            }
        }
View Full Code Here

TOP

Related Classes of org.jboss.aesh.terminal.TerminalString

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.