Package org.eclipse.osgi.framework.console

Examples of org.eclipse.osgi.framework.console.CommandProvider


  private void displayAllHelp() {
    int size = commandProviders.length;
    for (int i = 0; i < size; i++) {
      try {
        CommandProvider commandProvider = commandProviders[i];
        out.print(commandProvider.getHelp());
        out.flush();
      } catch (Exception ee) {
        printStackTrace(ee);
      }
    }
View Full Code Here


    }
    // if no command was found to execute, display help for all registered command providers
    if (!executed) {
      for (int i = 0; i < size; i++) {
        try {
          CommandProvider commandProvider = (CommandProvider) commandProviders[i];
          out.print(commandProvider.getHelp());
          out.flush();
        } catch (Exception ee) {
          printStackTrace(ee);
        }
      }
View Full Code Here

        Assert.assertTrue(commandReferences.length != 0);

        int foundCommands = 0;
        Collection<String> commandHelps = defaultCommansList.values();
        for (ServiceReference commandReference : commandReferences) {
            CommandProvider commandProvider = (CommandProvider) bc.getService(commandReference);
            if (commandProvider.getHelp().contains(groupName)) {
                for (String commandHelp : commandHelps) {
                    if (commandProvider.getHelp().contains(commandHelp)) {
                        foundCommands++;
                    }
                }
            }
        }
        Assert.assertEquals(defaultCommansList.size(), foundCommands);

        registration.unregister();

        foundCommands = 0;
        commandReferences = bc.getServiceReferences("org.eclipse.osgi.framework.console.CommandProvider", null);
        if (commandReferences != null) {
            for (ServiceReference commandReference : commandReferences) {
                CommandProvider commandProvider = (CommandProvider) bc.getService(commandReference);
                if (commandProvider.getHelp().contains(groupName)) {
                    for (String commandHelp : commandHelps) {
                        if (commandProvider.getHelp().contains(commandHelp)) {
                            foundCommands++;
                        }
                    }
                }
            }
View Full Code Here

    }
    // if no command was found to execute, display help for all registered command providers
    if (!executed) {
      for (int i = 0; i < size; i++) {
        try {
          CommandProvider commandProvider = (CommandProvider) commandProviders[i];
          out.print(commandProvider.getHelp());
          out.flush();
        } catch (Exception ee) {
          printStackTrace(ee);
        }
      }
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.framework.console.CommandProvider

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.