Package org.eclipse.swt.program

Examples of org.eclipse.swt.program.Program


     *
     * @see org.eclipse.ui.IEditorRegistry#getSystemExternalEditorImageDescriptor(java.lang.String)
     */
    public ImageDescriptor getSystemExternalEditorImageDescriptor(
            String filename) {
        Program externalProgram = null;
        int extensionIndex = filename.lastIndexOf('.');
        if (extensionIndex >= 0) {
            externalProgram = Program.findProgram(filename
                    .substring(extensionIndex));
        }
View Full Code Here


        return;
      }
    }

    // Programmatically try to find something that can handle html files
    Program browserProgram = Program.findProgram("html");
    if (browserProgram != null) {
      if (browserProgram.execute(location)) {
        return;
      } else {
        logger.log(TreeLogger.ERROR, "Error launching external HTML program '"
            + browserProgram.getName() + "'", null);
        return;
      }
    }

    // We're out of options, so fail.
View Full Code Here

        return;
      }
    }

    // Programmatically try to find something that can handle html files
    Program browserProgram = Program.findProgram("html");
    if (browserProgram != null) {
      if (browserProgram.execute(location)) {
        return;
      } else {
        logger.log(TreeLogger.ERROR, "Error launching external HTML program '"
            + browserProgram.getName() + "'", null);
        return;
      }
    }

    // We're out of options, so fail.
View Full Code Here

          (file.length() + 512) / 1024) });

      int dot = nameString.lastIndexOf('.');
      if (dot != -1) {
        String extension = nameString.substring(dot);
        Program program = Program.findProgram(extension);
        if (program != null) {
          typeString = program.getName();
          iconImage = iconCache.getIconFromProgram(program);
        } else {
          typeString = FileViewer.getResourceString("filetype.Unknown", new Object[] { extension
              .toUpperCase() });
          iconImage = iconCache.stockImages[iconCache.iconFile];
View Full Code Here

        if (idx != -1) {
          String extension = lastSegment.substring(idx);
          if (images.containsKey(extension)) {
            return images.get(extension);
          }
          Program p = Program.findProgram(extension);
          if (p != null) {
            ImageData data = p.getImageData();
            if (data != null) {
              Image image = new Image(Display.getDefault(), data);
              images.put(extension, image);
              return image;
            }
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

  /* 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

  private static class CMN_initializeExtensions extends CommandMessage {
    @Override
    public Object run(Object[] args) {
      for(String extension: Program.getExtensions()) {
        Program program = Program.findProgram(extension);
        if(program != null) {
          initNative();
          FileTypeLauncherInfo fileTypeLauncherInfo = programToFileTypeLauncherInfoMap.get(program);
          if(fileTypeLauncherInfo == null && isProgramValid(program)) {
            fileTypeLauncherInfo = new FileTypeLauncherInfo(program);
View Full Code Here

  private static class CMN_getLauncherID extends CommandMessage {
    @Override
    public Object run(Object[] args) {
      String extension = (String)args[0];
      Program program = Program.findProgram(extension);
      if(program == null) {
        return null;
      }
      initNative();
      FileTypeLauncherInfo fileTypeLauncher = programToFileTypeLauncherInfoMap.get(program);
View Full Code Here

        return;
      }
    }

    // Programmatically try to find something that can handle html files
    Program browserProgram = Program.findProgram("html");
    if (browserProgram != null) {
      if (browserProgram.execute(location)) {
        return;
      } else {
        logger.log(TreeLogger.ERROR, "Error launching external HTML program '"
            + browserProgram.getName() + "'", null);
        return;
      }
    }

    // We're out of options, so fail.
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.