IsTraversable making files invisible, rather than non-traversable

I have some files stored in a folder (some kind of "compound" file) so when the user opens the folder it acts like a file. At the moment I am drawing its own little icon and stuff, everything works fine except the user can "double click" on the file and instead of opening it, they will go into it and see all the guts inside. I found the isTraversable method of the FileView object and that does half the job (other half would be to support double - click opening) However, when i try to use it anything I set as non traversable becomes invisible. I suppose its doing its job (I cannot traverse the file that isnt there) but i would like to be able to choose this file.
public Boolean isTraversable(File f)
          Boolean ret = super.isTraversable(f);
          if (QuantitationFileChooser.isQuantitationFile(f, false))
               ret= new Boolean(false);
          return ret;
     }Am i missing the point of this function or something? It seem pretty simple, i have no idea what i am doing wrong! The documentation says its exactly what i want:
"public Boolean isTraversable(File f) Whether the directory is traversable or not. This might be useful, for example, if you want a directory to represent a compound document and don't want the user to descend into it. "
Thanks for any help

794057 wrote:
Am i missing the point of this function or something? It seem pretty simple, i have no idea what i am doing wrong! The documentation says its exactly what i want:
"public Boolean isTraversable(File f) Whether the directory is traversable or not. This might be useful, for example, if you want a directory to represent a compound document and don't want the user to descend into it. "Works as documented for me. Run this code and try double-clicking around.import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileView;
public class ChooserWithView {
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        JFileChooser chooser = new JFileChooser();
        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        chooser.setFileView(new FileView() {
          @Override
          public Boolean isTraversable(File f) {
            if (f.getName().contains("o")) {
              return false;
            return null;
        chooser.showOpenDialog(null);
        System.out.println(chooser.getSelectedFile());
}

Similar Messages

  • Sorting files by file name rather than ID Tags

    Some of my files have incomplete or missing ID Tags ( a lot of mp3's from vinyl) making sorting more difficult and I typically find it more usefull to sort by file name rather than ID Tag anyway. Does anyone know how to sort by file name?

    Aloha!
    While this is not possible in iTunes right now, I might be able to help.
    It sounds like you've taken care to ensure that your music is properly labeled. That should make it easy to use a third party app to tag the lot as a batch. I am aware of one application that folks around here seem to like called "Tag & Rename" that can build a set of tags for you from folder and file names. I believe it has (or had) a free demo period as well. Try a google search or check out sites like versiontracker and you will find several apps that can do the task for you.
    Once done, iTunes will be able to handle the collection that has apparently been with you for some time. Hope this helps you decide on a course of action.

  • Csv files open rather than download

    Hello,
    We've just set up a new Communigate Pro mail server. However, our Safari users are experiencing a bit of a quirk when it comes to accessing their attachments. When clicking on the download link for an attachment of content-type text/csv, the attachment opens as plain text in a new Safari window by default rather than it being downloaded. The user can option-click to force it to download, but I'd rather it download by default, as is the case with Firefox. Is there a preferences setting I can change to make this happen?
    Thanks,
    Bill

    Hi Bill,
    There's no setting you can set in Safari to make it download a particular file. I don't know anything about Communigate but can you modify it to specify a content-disposition header for the csv files? E.g.
    Content-Disposition: attachment; filename="mydatafile.csv"
    The 'Content-Disposition' header will tell the browser to download the file rather than view it inline.

  • Is it possible to view ".mp3" files in Mavericks "Tags" windows by file name (rather than the info in the "name" field of it's ID3 tag)?

    Short version:
    When viewing ".mp3" files in a "Tags" window, the information in the "name" column next to the file defaults to the information in the "song" field in the file's ID3 tag.
    Is it possible to change have the "name" column display the actual FILE NAME instead?
    I did some research and found nothing.
    Long version
    Let's say I have a ".mp3" file named "Todd Rundgren - Hello It's Me.mp3"
    When I open the folder this ".mp3" is in and find the file, the "name" column will read "Todd Rundgren - Hello It's Me.mp3" (of course)
    Now, I tag the file "jams"
    Now I go to my "jams" tag view everything tagged "jams", the "name" column in that window DOES NOT say
    "Todd Rundgren - Hello It's Me.mp3" , but instead just "Hello It's Me"
    The finder seems to be pulling this information from the "name" field of the ".mp3" ID3 tag metadata (aka, the information that would be written in the "name" column when viewing the file in iTunes.)
    Ok, that's fine Mavericks, but I want to see the ACTUAL FILE NAME of my ".mp3", (which "tags" windows seems to do for most other things [documents, folders])
    Q: Is it possible to display the filename of a ".mp3" file when viewing a "tag window?"
    Tags are super useful, but this inconsistency makes it inefficient, distracting, and confusing to move freely between the window for a given "tag", and a normal "finder" window.
    Any help would be greatly appreciated, thanks!

    You are not alone…
    https://discussions.apple.com/message/24065588
    https://discussions.apple.com/thread/5762545
    I think you have to avoid editing inside the tags list with the 'metadata names'. Instead right click an item, select 'Open enclosing folder'.
    In 'real folders' you can enable the 'Title' in column via the 'Veiw Menu > show columns', that way you can see the file name & ID3/ EXIF titles.
    'Fake folders' (smart searches & the recent tags list) don't feel finished yet IMO.

  • PDF annotation(comments) in acrobat increase file size rather than reader

    Hi,
    When I annotating(comments) files in Acrobat Professional(7 or 9) will increase the file size where as if I open the same file in adobe reader I can easily edit the page within short times,Please suggest what is the mechanism used in Acrobat.
    Regards,
    MohamedFaisal.

    Hi MohamedFaisal,
    I am not sure, if i understood you correctly. The file size grows big in Acrobat and when the same file is opened in Reader the size is less?
    Also, please help us with the details mentioned below
    1) Exact version of Acrobat being used
    2) Exact version of Adobe Reader being used
    3) Size difference, when opened in Acrobat Vs When opened in Reader.
    4) How was the file Created.
    Thanks,
    Vikrantt Singh

  • When I add text to a PDF, I am forced to change the file name rather than just updating the current file.  Why?

    I have been doing the same process for months and until recently I could just add text to a pdf, click save, adobe would ask me if I wanted to replace the current file, I'd say yes and we would be done.  Now I get a message that says "The document could not be saved.  Cannot save to this filename. Please save the document with a different name or in a different folder." It does this about 70% of the time.  The rest of the time it works like it used to.

    You cannot skip arguments, you can either use the function with one
    argument (just the required argument), or you have to provide all of them.
    Also, it looks like you are trying to specify 20 parameters, even though
    the function only takes 19. Try the following:
    Call jso.addWaterMarkFromText("Test Text", jso.app.Constants.Align.Center,
    jso.Font.Helv, 16, _
        jso.Color.Black, 0, 0, True, True, True, _
        jso.app.Constants.Align.Center, jso.app.Constants.Align.Center, _
        100, 100, False, 1, False, 0, 1)
    I just typed this in without running it through the compiler, so there may
    be typos in the code, but you should get the idea of how the code is
    supposed to look like.
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    PDF Software Development, Training and More...
    [email protected]
    http://www.khkonsulting.com
    On Fri, Jul 26, 2013 at 1:55 PM, I Love Mustangs

  • Change the Finder search default to Find by Name (search by file name) rather than Find by Content

    I just discovered another way to set the finder Find option to default to "find by name" (search by file name). I'm using Mac OS X 10.8.5 Mountain Lion. I'm not sure if this works on other OS versions, but it probably does.
    Here's a step by step:
    #1: Open System Preferences
    #2: Click on "Keyboard"
    #3: Click on "Keyboard Shortcuts"
    #4: Click on "Application Shortcuts" (on my system this was the last item located on the left-hand side window)
    #5: Click the little "+" right below the right-hand side window
    #6: Click on the "Application" menu and choose "finder.app"
    #7: Click into the field "Menu Title:" and type "Find by Name..." (Type it exactly like that including the three dots. Don't type the quotes BTW.)
    #8: Click into the field "Keyboard Shortcut:" and press the command-key and F at the same time. It should look like this ⌘F
    #9: Close System Preferences
    That's it. Basically what you are doing is remapping the command-F key (⌘F) to "Find By Name".
    I tried to post this to other previous discussions asking this same question, but they were all locked.

    Apple doesn’t routinely monitor the discussions. These are mostly user to user discussions.
    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

  • Why is adobe indesign CC saving my file in the previous file path rather than current folder path?

    I've just updated to CC and when I go to 'save as' Indesign file it opens (auto remembers) the wrong folder/location. Can I make it remember the right folder to save to?

    This is as designed. I’m assuming that you are opening a file that was created in an older version. Once you save it as a CC file, a save as will go back to the folder it was saved in.

  • Why is adobe indesign cs6 saving my file in the previous file path rather than current folder path?

    I've just updated to CS6 and when I go to 'save as' Indesign file it opens (auto remembers) the wrong folder/location. Can I make it remember the right folder to save to?

    Are you converting old files (better to do that by exporting theoriginals to .inx/.idml from the original application, by the way)? ID treats conversions as new files, and all file operations on new files default to the last folder where that operation was executed. Once saved, though, it will default to the folder where the file is saved.

  • How can I convert an iphoto to a file rather than a picture?

    I have several friends who would rather get my email with a file attached rather than photos?  How can I do this with Iphoto?

    Try this:  in Mail's Composing preference pane set the format of the emails to plain text.  Then once the photos are in the email Control-click on them and select "Show as icon" in the contextual menu.
    That might let them see the photos as icons/attachments rather the view the photos.  A lot depends on how they have their email client setup. 
    The sure fire way is to zip/compress the photos and adding the zipped file to the email.
    The recipient will have to unzip the file at the other end to get the image files.
    OT

  • AppleScript "Add to File Names.scpt" (in Finder Scripts) adds "Prefix" to end of files rather than adding actual prefix?

    This may be a quirk with my setup, but when the file "Add to File Names.scpt" runs in Mavericks "Prefix" is appended to the end of filenames rather than the term I would like to be added as a prefix...unsure if this can be reproduced on other comptuers? Similarly, as a test, if a term is intended to be added as a suffix to a file name then "Suffix" is appended to the end of a file name - rather than the term.
    If this is a bug is there a fix?
    Thanks

    apparently this is a bug with a workaround as described here:
    https://discussions.apple.com/message/24085265#24085265

  • Temporary files rather than firefox.exe are running when starting firefox

    When I start firefox, it says the firefox is already running. Old firefox process needs to be stopped to start new one. When I see the firefox process and try to end it using end process option in windows task manager, it says access is denied. The properties of the said process show temporary file running rather than firefox,exe.

    Please try to follow these steps :
    [[http://mzl.la/1BAQRzf]]

  • SAP ISR -XI - SAP POS. File size more than 11 KB failing in Inbound

    Hi All,
    We are implementing SAP ISR- XI - POS Retail implementation using
    Standard Content Store Connectivity 2.0, GM Store Connectivity 1.0, and
    other contents.
    In our Inbound Scenario File-RFC , we are picking files from FTP server
    for sales and totals data and if the size of this sales data file in
    format *_XI_INPUT.DAT is greater than 11 kb , it is failing at XI
    Mapping level, saying Exception occurred during XSLT
    mapping "GMTLog2IXRetailPOSLog" of the application. We have tried and tested at mapping level no error found as this is processing files below 11 Kb successfully with same mappings, Also this is standard Mapping by SAP in form of XI Content Store connectivity 2.0.
    At XI Side we have processed the file of eg: 40 KB  by splitting the record data and making
    file size less than 11KB and it is being processed successfully, but file of 40 kb fails.
    XI Server: AIX  Server.
    There may be some memory setting missing or some basis problem also. Kindly let me know how to proceed.
    Regards,
    Surbhi Bhagat

    hi,
    this is hard to believe that such small files cannot be processed
    do your XI mappings work for any other flows with something more then 11kb?
    let me know about that and then we will know some more
    as this is realy very small size
    maybe your XI was installed in on PocketPC
    Regards,
    Michal Krawczyk

  • How do I duplicate hard links when copying with Finder rather than making two copies of the file?

    I have 1.6 TB of Video on one external drive. All of this was imported using iMovie and lives mostly in iMovie events. I then decided I wanted to use Final Cut Pro X for some additional flexibility.
    I opened FCPx and imported the iMovie events and movies. As I expected, FCPx made hard links to the files in the iMovie events rather than wholesale copying the events into the original content area. I have found that it is much easier to keep all movie content on one disk rather than having is spread all over creation, so I am trying to make a copy on another larger drive.
    I am trying to use Finder to copy the files rather than some other more obtrusive option using the actual applications. The problem is, when I use the finder Copy function, all files that had hard links in the file system are now phyiscally copied twice and are actually duplicated on the new disk. This doubles the size of the the content on the new disk and completely ruins the reason for moving the files in the first place.
    Now that I have finally figured out what is going on, I guess I can figure out the proper Unix style commands in the Terminal to make happen what I expect, but I would much rather have Finder duplicate a link if it finds a link. I really want to be able to use iMovie or FCPx on the Event content and only have one copy of the content unless I want to make a modification in one or the other.

    Mark,
    I have had a similar problem lately.  I use rsync to perform nightly backups from one internal drive to another.  I noticed (after I started using Final Cut Pro X) that my backup drive had 300G more disk space allocated.  It was only after a long and painful debugging process that I figured out that FCPX had created hard links to my iMovie Events.  I don't have a solution to this problem yet but I wanted to at least mention that I have run into the same challenge.
    Regards,
    Greg

  • How can I file at last location rather than location of current file?

    I have Abobe Reader X.  In the old Adobe, when I saved a file, it took me to the last folder I was in, not the location of the current file.  Thus far, I have not been able to find out how to get Adobe Reader X to do this.  I even asked work help desk for help and their solution to unclick 'Automatically save document changes to temp file' worked once. 
    Is it possible?  This is what I want.
    Example:
    I open file that is saved at Y:Scanned Files and save it at
    X:Dogs/Breeds/Hounds/Sighthounds/Basenjis.  I open the next file that is at Y:Scanned Files and click on File:Save As/PDF and window opens to save at Y:Scanned Files rather than at X:Dogs/Breeds/Hounds/Sighthounds/Basenjis, where I just was.  I want to save file at X:Dogs/Breeds/Hounds/Sighthounds/Afghans so instead of just one click, I now have to go through six.  Now imagine you have 30 or 40 documents you have to save.  That's minimum 180 clicks versus 30.  A big difference.  And if you multiply it further by daily and weekly, it's a lot.
    How can I get Adobe Reader X to open the 'save as' window at the last location rather than the current file's address?  I also have Adobe Acrobat, but can't figure out how to get it work in that either.
    I do not like Adobe Reader X.   Unfortunately, it got downloaded automatically at work. 
    Another complaint I have is when I have Adobe Acrobat open and I click on a pdf to open, rather than open in Adobe Acrobat, it opens in Adobe Reader X (which was not the case with the previous Reader).  If I want to open a doc in Acrobat, I have to go to Acrobat and File/Open, which is a pain.
    Another complaint is, why do you have 'save as' and then 'pdf' or 'text'?  This is another time consuming click I have to make.  Add it to the 180 I'm already making above and you can see why I'm extremely unhappy and frustated with this version of Adobe. 
    Please let me know if the above is feasible or not and if it is, how to do it.  If it isn't feasible, please make the above adjustments to Reader Y and put it out pronto.  Thank you.

    If you would like to contact one of the UK based BT Care Team who moderate this forum, they may be able to help you.
    They can be contacted using this link BT Care Team
    They normally respond by phone or e-mail, within three working days, however you should get an immediate confirmation, with a tracking number.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

Maybe you are looking for