Package org.eclipse.swt.program

Examples of org.eclipse.swt.program.Program


          Debug.printStackTrace(t);
        }
      }

      if (imageData == null) {
        Program program = Program.findProgram(ext);
        if (program != null) {
          imageData = program.getImageData();
        }
      }

      if (imageData != null) {
        image = new Image(Display.getDefault(), imageData);
View Full Code Here


      Logger.log(new LogEvent(LogIDs.UI3, "Media server plugin not operational"));
      return null;
    }
 
    try {
      Program program = Program.findProgram(".qtl");
      boolean hasQuickTime = program == null ? false
          : (program.getName().toLowerCase().indexOf("quicktime") != -1);
 
      pi.getIPC().invoke("setQuickTimeAvailable", new Object[] {
        new Boolean(hasQuickTime)
      });
 
View Full Code Here

      Logger.log(new LogEvent(LogIDs.UI3, "Media server plugin not operational"));
      return null;
    }
 
    try {
      Program program = Program.findProgram(".qtl");
      boolean hasQuickTime = program == null ? false
          : (program.getName().toLowerCase().indexOf("quicktime") != -1);
 
      pi.getIPC().invoke("setQuickTimeAvailable", new Object[] {
        new Boolean(hasQuickTime)
      });
 
View Full Code Here

      UIFunctionsSWT functionsSWT = UIFunctionsManagerSWT.getUIFunctionsSWT();
      if (functionsSWT == null) {
        return;
      }
     
      final Program program = Program.findProgram(ext);
      String sTextID;
      String sFileType;
      if (program == null) {
        sTextID = sPrefix + "text.unknown";
        sFileType = ext;
      } else {
        sTextID = sPrefix + "text.known";
        sFileType = program.getName();
      }
     
      String[] buttons = new String[(program == null ? 2 : 3)];
      buttons[0] = MessageText.getString(sPrefix + "button.guide");
      buttons[buttons.length-1] = MessageText.getString(sPrefix + "button.cancel");
View Full Code Here

  private boolean selectedRunnableFiles() {
    java.util.List<UploadSession> selectedSessions = getSelectedObjects();
    for(UploadSession session : selectedSessions) {
      SharedFile file = session.getSharedFile();
      String extension = FileFormatter.getFileExtension(file.getSharingName());
      Program program = Program.findProgram(extension);
      if (program != null) return true;
    }
    return false;
  }
View Full Code Here

    open_shared_file.setImage(SWTImageRepository.getImage("open_file.png"));
    open_shared_file.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        SharedFile shared_file = getSelectedObject().getSharedFile();
        String extension = FileFormatter.getFileExtension(shared_file.getSharingName());
        Program program = Program.findProgram(extension);
        if (program == null) return;
        program.execute(shared_file.getAbsolutePath());
      }
    });
   
    new MenuItem(upload_selected_menu,SWT.SEPARATOR);
   
View Full Code Here

  private void openSelected() {
    java.util.List<SharedFile> selected_files = shared_files_table.getSelectedObjects();
    for(SharedFile file : selected_files) {
      if (!file.isCompleted()) continue;
      String extension = FileFormatter.getFileExtension(file.getSharingName());
      Program program = Program.findProgram(extension);
      if (program == null) continue;
      program.execute(file.getAbsolutePath());
    }
  }
View Full Code Here

  private boolean selectedRunnableFiles() {
    java.util.List<SharedFile> sharedFiles = shared_files_table.getSelectedObjects();
    for(SharedFile file : sharedFiles) {
      if (!file.isCompleted()) continue;
      String extension = FileFormatter.getFileExtension(file.getSharingName());
      Program program = Program.findProgram(extension);
      if (program != null) return true;
    }
    return false;
  }
View Full Code Here

    }
    String extension = "no extension";
    if (id!=0)
      extension = fileName.substring(id+1, fileName.length());
   
    Program program = Program.findProgram(extension);
    if (program == null) {
     
      InputStream stream = UIConstants.getIconByExtension(extension);
      Image img = new Image(SWTThread.getDisplay(),stream);
     
      try {
        stream.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
      stream = null;
      return img;
    }
   
    ImageData image_data = program.getImageData();
    if (image_data == null) {
      return getImage("image_not_found.png");
    }
    image_data = image_data.scaledTo(16, 16);
    Image image = new Image(SWTThread.getDisplay(),image_data);
View Full Code Here

    TABLE_ODD_BACKGROUND_COLOR.dispose();
    FEED_TITLE_COLOR.dispose();
  }

  private Image getImage(String lExtension) {
    Program lProgram = ContentAssociation.getOSAssociation(lExtension);
    if (lProgram != null) {
      try {
        ImageData lData = lProgram.getImageData();
        if (lData != null) {
          return new Image(null, lData);
        }
      } catch (ArrayIndexOutOfBoundsException aio) {
        // CB TODO This is a SWT bug, have to report with SWT.
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.