Package org.eclipse.swt.program

Examples of org.eclipse.swt.program.Program


  /* Find a Image for the given Extension using Program API from SWT */
  @SuppressWarnings("restriction")
  private static ImageDescriptor getImageForExtension(String extension) {
    if (StringUtils.isSet(extension)) {
      Program p = Program.findProgram(extension);
      if (p != null)
        return new org.eclipse.ui.internal.misc.ExternalProgramImageDescriptor(p);
    }

    return null;
View Full Code Here


  /**
   * @param pExtension
   * @return
   */
  public static Program getOSAssociation(String pExtension) {
    Program p = Program.findProgram(pExtension);
    return p;
  }
View Full Code Here

  /**
   * @param pExtension
   * @return
   */
  public static void openProgram(String pExtension, String pFile) {
    Program p = getOSAssociation(pExtension);
    if (p != null) {
      p.execute(pFile);
    }
  }
View Full Code Here

      }
    }, browserGroup);
  }

  private String getDefaultBrowserName() {
    Program program = Program.findProgram("html"); //$NON-NLS-1$
    if (program != null) {
      String name = program.getName();
      if (StringUtils.isSet(name)) {
        name = name.toLowerCase();
        if (name.contains("firefox")) //$NON-NLS-1$
          return "Mozilla Firefox"; //$NON-NLS-1$
View Full Code Here

        Element element = getElement();
        if (element != null) {
          try {
            String filename = _dom.transform(element);

            Program prog = Program.findProgram("html");
            if (prog != null)
              prog.execute(filename);
            else {
              filename = new File(filename).toURL().toString();
              Runtime.getRuntime().exec(Options.getBrowserExec(filename, null));
            }
          } catch (Exception ex) {
View Full Code Here

        try {
          Utils.startCursor(getShell());
          if (tFileName.getText() != null && tFileName.getText().length() > 0) {
            String sData = getData(tFileName.getText());
           
            Program prog = Program.findProgram("html");
           
            if (prog != null)
              prog.execute(new File((sData).concat(tFileName.getText())).toURL().toString());
            else {
              Runtime.getRuntime().exec(Options.getBrowserExec(new File((sData).concat(tFileName.getText())).toURL().toString(), Options.getLanguage()));
            }
          }
        } catch (Exception ex) {
View Full Code Here

      Element element = _dom.getRoot();
      if (element != null) {
          try {
              String filename = _dom.transform(element);

              Program prog = Program.findProgram("html");
              if (prog != null)
                  prog.execute(filename);
              else {
                  Runtime.getRuntime().exec(Options.getBrowserExec(filename, null));
              }
          } catch (Exception ex) {
              ex.printStackTrace();
View Full Code Here

    try {
      //TODO: �berpr�fen, ob Datei wirklich existiert
      url = new File(url).toURL().toString();

      Program prog = Program.findProgram("html");
      if (prog != null)
        prog.execute(url);
      else {              
        Runtime.getRuntime().exec(Options.getBrowserExec(url, lang));

        //Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler javascript:location.href='file://c:/scheduler/config/html/doc/en/xml/job.xml'");
View Full Code Here

          if (filename != null && filename.length() > 0) {
            File file = new File(filename);
            if(file.exists()) {
              //Runtime.getRuntime().exec("cmd /C START iExplore ".concat(filename));

              Program prog = Program.findProgram("html");
              if (prog != null) {
                prog.execute(new File(filename).toURL().toString());               
              } else {
                String[] split = Options.getBrowserExec(new File(filename).toURL().toString(), Options.getLanguage());
                Runtime.getRuntime().exec(split);               

              }                  
View Full Code Here

        butdescription.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            try  {
              if(txtPath.getText()!= null && txtPath.getText().length() > 0) {

                Program prog = Program.findProgram("html");
                if (prog != null)
                  prog.execute(new File(txtPath.getText()).toURL().toString());
                else {
                  Runtime.getRuntime().exec(Options.getBrowserExec(new File(txtPath.getText()).toURL().toString(), Options.getLanguage()));
                }
              } else {
                MainWindow.message(shell, sos.scheduler.editor.app.Messages.getString("no_jobdescription"), SWT.ICON_WARNING | SWT.OK );                
View Full Code Here

TOP

Related Classes of org.eclipse.swt.program.Program

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.