Package javax.swing.filechooser

Examples of javax.swing.filechooser.FileSystemView$LinuxFileSystemView


   * This actually brings up a JFileChooser to select a new Folder for
   * the value of the property.
   */
  public void selectNewFolder() {

    FileSystemView mfsv = createFileSystemView();

    String defaultRoot = valueDisplay.getText();
    if (defaultRoot.equals("")) {
      defaultRoot = "/";
      try {
        String storeName = property.substring(property.indexOf('.') + 1, property.indexOf('.', property.indexOf('.') + 1));
        StoreInfo si = Pooka.getStoreManager().getStoreInfo(storeName);
        if (si != null) {
          defaultRoot = storeName;
        }
      } catch (Exception e) {
      }
    } else {

      if (defaultRoot.lastIndexOf('/') > -1) {
        defaultRoot = defaultRoot.substring(0, defaultRoot.lastIndexOf('/'));
      }
    }

    JFileChooser jfc =
      new JFileChooser(defaultRoot, mfsv);
    jfc.setMultiSelectionEnabled(false);
    jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    // workaround for bug in jdk 1.4
    jfc.setCurrentDirectory(mfsv.createFileObject(defaultRoot));

    int returnValue =
      jfc.showDialog(Pooka.getMainPanel(),
                     Pooka.getProperty("FolderEditorPane.Select",
                                       "Select"));
View Full Code Here


   * folders, or just the folders of a single store.  This is determined
   * by the 'selectionRoot' subproperty of the edited property's template.
   */
  public FileSystemView createFileSystemView() {

    FileSystemView returnValue = null;
    boolean justSubscribed = manager.getProperty(editorTemplate + ".onlySubscribed", "true").equalsIgnoreCase("true");

    if (manager.getProperty(editorTemplate + ".selectionRoot", "allStores").equals("allStores")) {
      if (justSubscribed)
        returnValue = new PookaFileSystemView();
View Full Code Here

            return null;
        }
        Stack<File> stack = new Stack<File>();
        List<Object> list = new ArrayList<Object>();
        list.add(_fileSystemTree.getModel().getRoot());
        FileSystemView view = _folderChooser.getFileSystemView();
        File[] alternativeRoots = null;
        File root = null;
        if (SystemInfo.isWindows()) {
            File[] roots = view.getRoots();
            root = roots[0];
            if (isFileSystem(root) && root.isDirectory()) {
                alternativeRoots = root.listFiles();
            }
        }
View Full Code Here

            }
            public void cancel() {
                ImageList.cancel();
            }
        };
        FileSystemView view = Platform.getPlatform().getFileSystemView();
        String dirName = view.getSystemDisplayName(directory);
        dialog.showProgress(
            this, thread, LOCALE.get("ScanningMessage", dirName), 0, 1, true
        );
        Throwable t = dialog.getThrown();
        if (t != null) {
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)      
  {
    // the method returns the same FileSystemView instance every time
    FileSystemView fsv1 = FileSystemView.getFileSystemView();
    FileSystemView fsv2 = FileSystemView.getFileSystemView();
    harness.check(fsv1 == fsv2);
  }
View Full Code Here

  public void test(TestHarness harness)      
  {
    JFileChooser jfc = new JFileChooser();
    harness.check(jfc.getFileSystemView(), FileSystemView.getFileSystemView());
   
    FileSystemView fsv1 = new MyFileSystemView();
    jfc.setFileSystemView(fsv1);
    harness.check(jfc.getFileSystemView(), fsv1);
   
    jfc.setFileSystemView(null);
    harness.check(jfc.getFileSystemView(), null);
View Full Code Here

  {
    JFileChooser jfc = new JFileChooser();
    jfc.addPropertyChangeListener(this);
    harness.check(jfc.getFileSystemView(), FileSystemView.getFileSystemView());
   
    FileSystemView fsv1 = new MyFileSystemView();
    jfc.setFileSystemView(fsv1);
    harness.check(jfc.getFileSystemView(), fsv1);
    harness.check(event.getPropertyName(),
            JFileChooser.FILE_SYSTEM_VIEW_CHANGED_PROPERTY);
    harness.check(event.getOldValue(), FileSystemView.getFileSystemView());
View Full Code Here

  }

  public void testConstructor3(TestHarness harness)      
  {
    harness.checkPoint("(File, FileSystemView)");
    FileSystemView fsv = new MyFileSystemView();
    File f = new File(System.getProperty("user.home"));
    JFileChooser fc = new JFileChooser(f, fsv);
    harness.check(fc.getCurrentDirectory(), f);
    harness.check(fc.getSelectedFile(), null);
    harness.check(fc.getFileSystemView(), fsv);
View Full Code Here

  }

  public void testConstructor4(TestHarness harness)      
  {
    harness.checkPoint("(FileSystemView)");
    FileSystemView fsv = new MyFileSystemView();
    File f = new File(System.getProperty("user.home"));
    JFileChooser fc = new JFileChooser(fsv);
    harness.check(fc.getCurrentDirectory(), f);
    harness.check(fc.getSelectedFile(), null);
    harness.check(fc.getFileSystemView(), fsv);
View Full Code Here

  }

  public void testConstructor6(TestHarness harness)      
  {
    harness.checkPoint("(String, FileSystemView)");
    FileSystemView fsv = new MyFileSystemView();
    File f = new File(System.getProperty("user.home"));
    JFileChooser fc = new JFileChooser(System.getProperty("user.home"), fsv);
    harness.check(fc.getCurrentDirectory(), f);
    harness.check(fc.getSelectedFile(), null);
    harness.check(fc.getFileSystemView(), fsv);
View Full Code Here

TOP

Related Classes of javax.swing.filechooser.FileSystemView$LinuxFileSystemView

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.