Custom file chooser

Hello,
I need to design a custom file chooser. Infact, I cannot call it a file
chooser, because this is not accessing local system files. I am uploading
some files into a directory using ASP and I keep that file name in the database.
I can even upload directores and directores with files too into the database.
I need to display those files and folders in the "what is called as file chooser".
The List should work as it works in file chooser. i.e when I click on a folder,
it should show the files inside it. When I click on the file, the file should
be selected. Infact there is nothing in the file. Its all virtual only. Its only
the name that is selected.
I should be given an option to select "directories only" also.
The "file chooser" should not have show files of type, just the file name
text field only. The combobox should display "user added" string message. And
this is only one item in the combobox. I should be able to create folders, show
lists,etc... as it appears in the file chooser. (buttons beside the combobox)
Any ideas would be greatly appreciated.
Thanks

ok, this is just an example....you'll probably need a different constructor and additional methods....
public class VirtualFile{
  private String file ;
  private VirtualFile[] children;
  private VirtualFile parent;
  public VirtualFile(String file,VirtualFile parent,VirtualFiles[]children){
     this.file = file;
     this.parent = parent;
     this.children = children;
  public boolean isRoot(){
    return parent == null;
  public boolean isDirectory(){
    return children = null || children.length==0;
  public VirtualFile[] getChildren){
    return children;
}

Similar Messages

  • Custom file chooser or color chooser?

    Hello
    Can I change standard text appearing panels of file chooser or color chooser or change icons in file chooser?.
    Cheers

    In the future, Swing related questions should be posted in the Swing forum.
    The [url http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]Swing Tutorial has sections on using a Color Chooser and File Chooser.

  • Custom File Renaming Template Keeps Changing

    I'm having issues when creating a custom file naming template in Tiger with LR 1.3.1.
    When importing files, I created a custom template to rename the files with YYMMDD_{original file suffix}{Master}.tif to get this: 071217_12056Master.tif. The first import goes fine. But when I import another batch of files and choose the template all I get is 071217_Master.tif.
    I tried creating the template by hitting F2 to rename the photo and get the same results. The really odd thing is that some of the other templates have their characteristics jumbled around so that what I thought was the "orig file-name" template might actually produce something like 071217_.tif.
    The original file suffix suffers the worst in terms of disappearing without cause. This behavior was occurring in the 1.2 ver. as well. I've deleted every single template thru the editor, recreated them again and still get the errors.
    Hopefully someone here can provide some clues?
    Thank you!

    It sounds as though your import preset either isn't working or wasn't setup correctly.
    Using the full screen import panel, make sure Copy or Move is selected and then select your Import Preset....what does the File Renaming panel look like? "Rename Files" should be ticked, Template should read "Custom Settings" (or the specific rename preset if you've saved it) and the sample should show the correct rename format, like so:
    So does yours look like this, or different?

  • How to add custom file icons on SharePoint 2010 document library?

    Hi there,
    In a document library SharePoint shows the PDF and Word etc icons all fine - however we have a custom file format with a custom icon. Is this possible to add this custom icon for our custom extension? How?
    Thank you so much.

    Hi,
    You could accomplish your requirement by using jQuery with these steps, and this code is using jQuery to modify it on the current page, if you would like to make it work on all library, you need to choose the former method or add this JQuery script on all
    library pages manually:
    Upload a custom icon to file “14\ Template\Images” or your SharePoint document library.
    Add this code below in the document library that you want to extend your custom icon, you could add code by following these: Click edit page in the document library -> add a web part -> choose Content Editor -> click edit source in the Ribbon ->
    add the source below -> click OK.
    <script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script><script type="text/javascript">
    $(document).ready(function(){
    var fileObject = $("[title$='docx']");
    for(var i=0; i < fileObject.length; i++){
    //fileObject[i].outerHTML="<img width=\"16\" height=\"16\" title=\"test.docx\" alt=\"test.docx\" src=\"/_layouts/15/images/custom.png\" border=\"0\">"; // upload your custom icon to file ” 14\ Template\Images”, replace your src URL
    fileObject[i].outerHTML="<img width=\"16\" height=\"16\" title=\"test.docx\" alt=\"test.docx\" src=\"/sites/sharepoint2013/Shared%20Documents/custom.png\" border=\"0\">"; // upload your custom icon to SharePoint document library, replace your src URL
    </script>
    The screenshot below is my result:
    Best Regards
    Vincent Han
    TechNet Community Support

  • File chooser

    Im using file chooser to select the location and a file to save some text to, the question i need help with is can you allocation you own customer file extension to a new file ie text.kelvinstext
    thanks,
    kelvin

    Sorry if taht came across wrong it was suppose to be
    a little heart remark,No need to apologize although the thank you I'm sure is appreciated all round.
    For the most part most veterans answering questions here have pretty thick skins. We do however sometimes get frustrated when answering the same questions over and over. It's not your (ie newb / OP / not just u specifically) fault; we're just trying to train you all so that hopefully you'll be able to find your answers independently in the future.

  • Custom File Name Format in B2B Console

    Hi,
    Please let me know if we can have a customized File Name Format in the B2B Console for the X12 EDI/XML Files.
    I have read the Oracle doc and only the following formats are mentioned:
    %FROM_PARTY%
    %TO_PARTY%
    %DOCTYPE_NAME%
    %DOCTYPE_REVISION%
    %MSG_ID%
    %TIMESTAMP%
    Is there a way to have a PO# (From the Trading Partner Payload) in the filename format?
    You help is appreciated.
    Thanks
    Priyanka G

    no. It has the format which helps B2B in identifying the agreement

  • How to create a custom file dialog box/vi (win)??

    Hello,
    I'd like to create a custom file dialog box to handle the reading of my tdms files. Basicly I want to extend the existing file select dialog box with a graphical preview of the data in the selected file. I know I can create all the logic for file selection by hand and use a list box to display the filelist, but I would rather prefer to somehow use the existing windows controls. So is it possible to get the windows file selector on the front panel of a vi and react to the user selection? If so, is there any example available on how to do this? Any other options? I'm using labview 8.2
    thanks for your input!
    klaus

    Klaus,
    I wouldn't know that Microsoft provides access to the controls that Explorer and file dialog consist of.
    There might be a different and more powerful solution though. The
    WINDOWS Explorer / file dialog have a plugin API that allows you to
    associate your own application for thumbnail creation with a particular
    file extension. That way, TDMS thumbnails will show in any instance of
    Explorer and
    File Dialog without you having to make your own dialog. Basically, you
    would need to compile the VI that creates the thumbnail into a
    LabVIEW-built DLL and then wrap this DLL with some C++ boilerplate code
    that Microsoft provides. You might want to have a look at the bottom of
    this article to get an idea of how the whole thing works:
    http://msdn.microsoft.com/msdnmag/issues/0600/w2kui2/default.aspx.
    Hope that helps,
    Herbert

  • Can I create an automatic custom file save name/path once I click digital signature field?

    Hi,
    What I'm trying to do is once I click on a digital signature and I add my digital signature it requires me to sign it.  I want to know if there's a workaround to where once I click it it will automatically save to a file name based on a field and to a pre-determined directory?  Say, if I want it to save to a users desktop.  My supervisor is wanting to eliminate his employees having to change the file name to the format he wants and selecting the save location and make it automatic for everyone to have it saved at the same location on their computers. 
    Will likely have everyone in the office create a folder named 'Leave Requests'.  This will be the location on the desktop where all these automatically saved files would go.  The custom file name would be Emp_Name + "Leave Request" + Date where Emp_Name and Date are 2 variables that are user inputted field values on the form.  I have looked around but there doesn't seem to be too much on this one.  I do realize I can't create a custom 'Save As' location and path name but I have read a little about creating a custom automatic save feature and wanted to know if I could implement that.  Here is the information I read about:
    http://acrobatusers.com/tutorials/print/how-save-pdf-acrobat-javascript
    I appreciate all help any of you can give me in this matter.  Thanks!!!

    This tutorial is great!
    http://mydesignpad.com/create-a-complex-html-email-signature-for-mail-on-mac-os- x-10-9-mavericks

  • DW CS3 - custom file extension no longer working correctly

    Hi - for a particular job, I needed to use a custom file
    extension .htmx and it has been working fine.
    However, I went into DW CS3 today, and the file opens in the
    DW editor, but the code coloring and code hints etc seem to be
    broken.
    I've checked the Extensions.txt and MMDocumentTypes.xml
    files, and all seems present and correct - see
    this screencast to
    see the problem.
    Any ideas why it's not working? (I'm on Vista Business, but
    it has definitely been working and now isn't....)
    Mike

    Well, I managed to fix it by overwriting my
    MMDocumentTypes.xml file with a clean version from another machine.
    Weird.

  • How to find if the user has selected one or many files using a file chooser

    I have a file chooser but want it to return either a file or file array depending on whether more than one file is selected but there doesn't seem to be any way to find out if that is the case or not. I want it to look something like:
                if(fileChooser.getSelectedFile().isDirectory()==true)
                    selectedFile=fileChooser.getCurrentDirectory();
                else if(fileChooser.multipleFilesSelected())
                    fileChooser.getSelectedFiles();//we have more than one file selected
                else   
                    fileChooser.getSelectedFile();    //if we have one file selected
                }am I going about dealing with this in the right way?

    OK, I scoured the API again and found I could avoid the problem altogether by using
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JFileChooser.html#isMultiSelectionEnabled()
    and
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JFileChooser.html#setFileSelectionMode(int)

  • Custom File Accesor implementation in 6.1 MP1

    I have made an custom file accessor (IPTCustomFileAccessor) using the Portal Server API for a crawler that is crawling a news website. I found example of the implementation of a custom file accessor to ALI version 5 but it seems that it does not go the same way in version 6.1.
    Here is what I have done:
    1. copied my custom accessor .jar file to <PORTAL_HOME>\accessors\customfa.jar2. Created accesors.xml to <PORTAL_HOME>\settings\config with following content:
    <accessorlibs>
    <accessorlib name="sampleaccessor" path="accessors/" />
    </accessorlibs>3. After that restarted the Portal. When the portal is starting it gives me some error about 5.0 configs not suitable in 6.1
    After that I tried to use the 6.1's dynamic loads:
    1. I created a new folder named accessors to <PT_HOME>\settings\portal\dynamicloads and moved the accessors.xml to that location
    2. Restarted the portal and then I get an error message:
    1559     portal.xxxx.xxx     8-22-2007     10:57:56.250     Fatal     UI_Infrastructure     Thread-0     com.plumtree.uiinfrastructure.application.startup.LoadCustomLoads     Fatal Exception loading lib file: c:\bea\alui\settings\portal\dynamicloads\Accessors\accessors.xml
    com.plumtree.openfoundation.util.XPNullPointerException: XPDynamicDiscovery failed to find all needed information in the xml file: c:\bea\alui\settings\portal\dynamicloads\Accessors\accessors.xml. Please make sure that the file is formatted correctly.Does anyone have a clue how should the accessors.xml be formatted? Thanks in advance!
    Greets,
    Nils-Erik Siren

    SSO info - as well as most other portal config info that used to be in various XML files - was moved to $PT_HOME/settings/portal/portalconfig.xml in G6.
    john

  • Action hard codes custom file name

    I recorded an action to crop and save for web. I have done this 1000's of times over the years, but in CS6 it is hardcoding a Custom File Name, and in the wrong format too boot.
    I am saving as JPG only and accepting the default name, which should leave me with an action that has no custom name, yet it does, and the custom name is of an HTML file name.
    So, when I run my action, it names every single file the same name, and never creates a jpg.
    This is a new bug in CS6. It wasn't here before.
    I can't figure out how to get around it????
    Kirk

    Figured out a way to work around this, but it is irritating. Instead of my action doing this:
    Flatten
    Crop (user interaction)
    Save For Web
    Close (without saving)
    I have to do this:
    Flatten
    Save as JPG (in same directory where I want the Web file to go)
    Crop (user interaction)
    Save For Web (Over top last saved file)
    Close (without saving)
    For some reason, when I use the save as JPG, it doesn't custom code the file name and when I save for web in the same place it also doesn't custom code the file name.
    I never had to do this before in all the years of using this type of action, and I use it ALOT!
    I have found that it sometimes does not hardcode the file name, but there seems to be no rhyme or reason.
    Kirk
    Photoshop CS6 on Windows7-64, haven't tested this on my MBP

  • Need help adding a default file name in a file chooser of save dialog type

    I need to create a file chooser with save dialog type, how can I add a highlighted default file name into the File Name textfield? As in Microsoft Word, when you want to save a document, a default file name Doc1.doc will appear in the File name text field of the file chooser even when you change to other directories.

    For JRE 1.4.0 you can use this fix:
    public class FileChooserFix implements PropertyChangeListener {
      private String fileName;
       * @see PropertyChangeListener
      public void propertyChange(PropertyChangeEvent ev) {
        JFileChooser chooser = (JFileChooser)ev.getSource();
        if (JFileChooser.FILES_ONLY == chooser.getFileSelectionMode()) {
          if (JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(ev.getPropertyName())) {
            File selectedFile = (File)ev.getNewValue();
            if (selectedFile != null) {
              // remember fileName of selected file
              fileName = selectedFile.getName();
          if (fileName != null &&
              JFileChooser.DIRECTORY_CHANGED_PROPERTY.equals(ev.getPropertyName())) {
            // reset selected file
            File directory = (File)ev.getNewValue();
            chooser.setSelectedFile(new File(directory, fileName));
       * Convenience method to create a fixed file chooser.
       * @return      fixed file chooser
      public static JFileChooser create() {
        JFileChooser chooser = new JFileChooser();
        chooser.addPropertyChangeListener(new FileChooserFix());
        return chooser;

  • File chooser to buffered image

    Hi all,
    Sorry about the total newbie question; I'm trying to figure out how to convert a jpg into a buffered image, while using the file chooser to select it. I'd like to do all this in a scrollpane. Does anyone have some sample code for this, at least so I can play around? I have ideas, but I'm getting tons of errors while trying things like:
    public class ImProc extends JComponent{
    private BufferedImage source, destination;
    private JComboBox options;
    public ImProc( BufferedImage image){
    source = destination = image;
    setBackground(Color.white);
    setLayout( new BorderLayout());
    JPanel controls = new JPanel();
    options = new JComboBox(
    new String[] {"[source]", "brighten", "darken", "rotate", "scale" }
    options.addItemListener(new ItemListener(){
    public void itemStateChanged( ItemEvent ie){
    String option = (String)options.getSelectedItem();
    BufferedImageOp op = null;
    if(option.equals("[source]"))
    destination = source;
    else if(option.equals("brighten"))
    op = new RescaleOp(1.5f, 0, null);
    else if(option.equals("darken"))
    op = new RescaleOp(0.5f, 0, null);
    else if (option.equals("rotate"))
    op = new AffineTransformOp(
    AffineTransform.getRotateInstance(Math.PI / 6), null);
    else if (option.equals("scale"))
    op = new AffineTransformOp(
    AffineTransform.getScaleInstance(.5, .5), null);
    if(op != null) destination = op.filter(source, null);
    repaint();
    controls.add(options);
    add(controls, BorderLayout.SOUTH);
    public void paintComponent(Graphics g){
    int imageWidth = destination.getWidth();
    int imageHeight = destination.getHeight();
    int width = getSize().width;
    int height = getSize().height;
    g.drawImage(destination,
    (width - imageWidth) / 2, (height - imageHeight) / 2, null);
    public static void main(String[] args){
    JFileChooser chooser = new JFileChooser();
    String filename = chooser.getName();
    ImageIcon icon = new ImageIcon(filename);
    Image i = icon.getImage();
    int w = i.getWidth(null), h = i.getHeight(null);
    BufferedImage buffImage = new BufferedImage(w, h,
    BufferedImage.TYPE_INT_RGB);
    Graphics2D imageGraphics = buffImage.createGraphics();
    imageGraphics.drawImage(i, 0, 0, null);
    JFrame frame = new JFrame("Image");
    frame.getContentPane().add(new ImProc(buffImage));
    frame.setSize(buffImage.getWidth(), buffImage.getHeight());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    So, I'm stuck. Any help from anyone is appreciated.
    Thanks,
    Joe

    Now, with:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    import java.io.*;
    import javax.imageio.*;
    public class ImProc extends JComponent{
    private BufferedImage source, destination;
    private JComboBox options;
    public ImProc( BufferedImage image){
    source = destination = image;
    setBackground(Color.white);
    setLayout( new BorderLayout());
    JPanel controls = new JPanel();
    options = new JComboBox(
    new String[] {"[source]", "brighten", "darken", "rotate", "scale" }
    options.addItemListener(new ItemListener(){
    public void itemStateChanged( ItemEvent ie){
    String option = (String)options.getSelectedItem();
    BufferedImageOp op = null;
    if(option.equals("[source]"))
    destination = source;
    else if(option.equals("brighten"))
    op = new RescaleOp(1.5f, 0, null);
    else if(option.equals("darken"))
    op = new RescaleOp(0.5f, 0, null);
    else if (option.equals("rotate"))
    op = new AffineTransformOp(
    AffineTransform.getRotateInstance(Math.PI / 6), null);
    else if (option.equals("scale"))
    op = new AffineTransformOp(
    AffineTransform.getScaleInstance(.5, .5), null);
    if(op != null) destination = op.filter(source, null);
    repaint();
    controls.add(options);
    add(controls, BorderLayout.SOUTH);
    public void paintComponent(Graphics g){
    int imageWidth = destination.getWidth();
    int imageHeight = destination.getHeight();
    int width = getSize().width;
    int height = getSize().height;
    g.drawImage(destination,
    (width - imageWidth) / 2, (height - imageHeight) / 2, null);
    public static void main(String[] args){
    JFrame frame = new JFrame("Image");
    frame.setSize(300, 300);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    JFileChooser chooser = new JFileChooser();
    //String filename = chooser.getName();
    File f = chooser.getSelectedFile();
    //String filename = f.getName();
    //ImageIcon icon = new ImageIcon(filename);
    //Image i = ImageIO.read(f);
    //int w = i.getWidth(null), h = i.getHeight(null);
    //BufferedImage buffImage = null;
    try{
    BufferedImage buffImage = ImageIO.read(f);
    catch (IOException e){
    System.out.println("Error: " + e.getMessage());
    frame.getContentPane().add(new ImProc(buffImage));
    Graphics2D imageGraphics = buffImage.createGraphics();
    imageGraphics.drawImage(buffImage, 0, 0, null);
    With this, it doesn't seem to find my variable buffImage. However, it complains if I don't use the try{} catch{}. Am I not declaring something properly?

  • Default settings for File Chooser dialog

    I reach the file chooser dialog by selecting File-Open File.
    Under the toolbar-options menu in the Open File Dialog, I can select to have a bookmark icon appear on the toolbar.
    How do I set a default to have the Bookmark icon always appear?
    Firefox 11 on openSuSE 12.1

    I don't think so, if I hide the Menu bar I don't see a Bookmarks Menu.
    In this picture http://dl.dropbox.com/u/50261731/Open_File%20Menu%20.png an arrow points to an Options menu button. Select that Button and a list of options opens, one of which is "Show Bookmarks". I would like the Show Bookmarks option to be "ON" by default.
    Be aware that I am running SuSE 12.1 and I believe this Menu is provided by KDE integration "kmozillahelper", so my menu may be different from the default Firefox menu.

Maybe you are looking for