Examples of FileDialog


Examples of org.eclipse.swt.widgets.FileDialog

    Point location = getInitialLocation(bestSize);
    getShell().setBounds(location.x, location.y, bestSize.x, bestSize.y);
  }

  private void doSaveErrorLog() {
    FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
    dialog.setText(Messages.StartupErrorDialog_SAVE_CRASH_REPORT);
    dialog.setFilterExtensions(new String[] { "*.log" }); //$NON-NLS-1$
    dialog.setFileName("rssowl.log"); //$NON-NLS-1$
    dialog.setOverwrite(true);

    String file = dialog.open();
    if (StringUtils.isSet(file)) {
      try {

        /* Check for Log Message from Core to have a complete log */
        String logMessages = CoreUtils.getAndFlushLogMessages();
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

      }
    });
  }

  private void onBrowse() {
    FileDialog dialog = new FileDialog(getShell());
    dialog.setText(Messages.ImportSourcePage_CHOOSE_FILE);

    /* Set Export Formats also for Import (we assume this is supported) */
    List<String> filterExtensions = new ArrayList<String>();
    filterExtensions.add("*.opml"); //$NON-NLS-1$
    filterExtensions.add("*.xml"); //$NON-NLS-1$

    Collection<String> exportFormats = Owl.getInterpreter().getExportFormats();
    for (String exportFormat : exportFormats) {
      String format = "*." + exportFormat.toLowerCase(); //$NON-NLS-1$
      if (!filterExtensions.contains(format))
        filterExtensions.add(format);
    }

    if (!filterExtensions.contains("*.*")) //$NON-NLS-1$
      filterExtensions.add("*.*"); //$NON-NLS-1$

    dialog.setFilterExtensions(filterExtensions.toArray(new String[filterExtensions.size()]));
    if (StringUtils.isSet(fResourceInput.getText()))
      dialog.setFileName(fResourceInput.getText());

    String string = dialog.open();
    if (string != null)
      fResourceInput.setText(string);

    updatePageComplete();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    run();
  }

  @Override
  public void run() {
    FileDialog dialog = new FileDialog(fShell, SWT.SAVE);
    dialog.setText("Export all Feeds to OPML");
    dialog.setFilterExtensions(new String[] { "*.opml", "*.xml", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    dialog.setFileName("feeds.opml");
    String string = dialog.open();
    if (string != null) {
      try {
        File file = new File(string);

        /* Ask for Confirmation if file exists */
 
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    fCustomBrowserSearchButton.setText("Search...");
    fCustomBrowserSearchButton.setEnabled(fUseCustomExternalBrowser.getSelection());
    fCustomBrowserSearchButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
        dialog.setFileName(fCustomBrowserInput.getText());
        String path = dialog.open();
        if (path != null)
          fCustomBrowserInput.setText(path);
      }
    });
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    run();
  }

  @Override
  public void run() {
    FileDialog dialog = new FileDialog(fShell);
    dialog.setText("Import Feeds from OPML");
    dialog.setFilterExtensions(new String[] { "*.opml", "*.xml", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    String string = dialog.open();
    if (string != null) {
      try {
        Controller.getDefault().importFeeds(string);
      } catch (Exception e) {
        Activator.getDefault().logError(e.getMessage(), e);
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    run();
  }

  @Override
  public void run() {
    FileDialog dialog = new FileDialog(fShell, SWT.SAVE);
    dialog.setText("Export all Feeds to OPML");
    dialog.setFilterExtensions(new String[] { "*.opml", "*.xml", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    dialog.setFileName("feeds.opml");
    String string = dialog.open();
    if (string != null) {
      try {
        File file = new File(string);

        /* Ask for Confirmation if file exists */
 
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    run();
  }

  @Override
  public void run() {
    FileDialog dialog = new FileDialog(fShell);
    dialog.setText("Import Feeds from OPML");
    dialog.setFilterExtensions(new String[] { "*.opml", "*.xml", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    String string = dialog.open();
    if (string != null) {
      Controller.getDefault().importFeeds(string);

      /* Force to rerun saved searches */
      JobRunner.runDelayedInBackgroundThread(new Runnable() {
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

      search.setText("Search...");
      search.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
      search.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
          dialog.setFilterExtensions(new String[] { "*.opml", "*.xml", "*.*" });
          dialog.setFileName("feeds.opml");
          String file = dialog.open();
          if (file != null)
            fInput.setText(file);
        }
      });

View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    /* Export Log to File */
    helpMenu.add(new Action(Messages.ApplicationActionBarAdvisor_EXPORT_LOGFILE) {
      @Override
      public void run() {
        FileDialog dialog = new FileDialog(getActionBarConfigurer().getWindowConfigurer().getWindow().getShell(), SWT.SAVE);
        dialog.setText(Messages.ApplicationActionBarAdvisor_EXPORT_LOGFILE_DIALOG);
        dialog.setFilterExtensions(new String[] { "*.log" }); //$NON-NLS-1$
        dialog.setFileName("rssowl.log"); //$NON-NLS-1$
        dialog.setOverwrite(true);

        String file = dialog.open();
        if (StringUtils.isSet(file)) {
          try {

            /* Check for Log Message from Core to have a complete log */
            String logMessages = CoreUtils.getAndFlushLogMessages();
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

        String size = OwlUI.getSize(attachment.getLength());

        Action action = new Action(size != null ? (NLS.bind(Messages.ApplicationActionBarAdvisor_FILE_SIZE, fileName, size)) : (fileName)) {
          @Override
          public void run() {
            FileDialog dialog = new FileDialog(shellProvider.getShell(), SWT.SAVE);
            dialog.setText(Messages.ApplicationActionBarAdvisor_SELECT_FILE_FOR_DOWNLOAD);
            dialog.setFileName(Application.IS_WINDOWS ? CoreUtils.getSafeFileNameForWindows(fileName) : fileName);
            dialog.setOverwrite(true);

            String downloadFolder = preferences.getString(DefaultPreferences.DOWNLOAD_FOLDER);
            if (StringUtils.isSet(downloadFolder) && new File(downloadFolder).exists())
              dialog.setFilterPath(downloadFolder);

            String selectedFileName = dialog.open();
            if (StringUtils.isSet(selectedFileName)) {
              File file = new File(selectedFileName);
              Controller.getDefault().getDownloadService().download(attachmentPair.getFirst(), attachmentPair.getSecond(), file.getName(), file.getParentFile(), true);

              /* Remember Download Folder in Settings */
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.