Package org.eclipse.swt.widgets

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.OPEN);
          dialog.setFilterExtensions(new String[] { "*.opml", "*.xml", "*.*" });
          String file = dialog.open();
          if (file != null)
            fInput.setText(file);
        }
      });

View Full Code Here


    if (URIUtils.ABOUT_BLANK.equals(fBrowser.getControl().getUrl()))
      return;

    /* Ask user for File */
    FileDialog dialog = new FileDialog(getSite().getShell(), SWT.SAVE);
    dialog.setOverwrite(true);
    dialog.setFilterExtensions(new String[] { ".html" }); //$NON-NLS-1$
    dialog.setFileName("site.html"); //$NON-NLS-1$

    String fileName = dialog.open();
    if (fileName == null)
      return;

    StringBuilder content = new StringBuilder();
    content.append(fBrowser.getControl().getText());
View Full Code Here

    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

      }
    });
  }

  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

    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

    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

    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

    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

    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

      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

TOP

Related Classes of org.eclipse.swt.widgets.FileDialog

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.