Flex Tree Folder/File Leaf/Branch icons

Hello Everyone ,
  I have an object which implements ITreeDataDescriptor and I stuff the objects into a Tree.  The objects are being shown in the tree , however  , they are all shown with the folder icon.  Is there a way I can tell this tree that some things should be represented by folders and that others should be represented by files ?  I have attached the disastrous code.  It has everything you need to see the damage. In the xml , the nodes are either labeled "Directory" , "Topdirectory" or "File"
P.S
For some reason the adobe flex forum wont let me attach ... Flex files ?  Here is the FileModel that implements the ITreeDataDescriptor and the tree mxml
Tree mxml
<mx:Tree id="Tree" itemClick="{thingClicked(event)}" labelField="name" width="100%" height="100%" dataProvider="{collection}" />
FileModel.as
package {
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;
    import mx.collections.ArrayCollection;
    import mx.collections.ICollectionView;
    import mx.controls.treeClasses.ITreeDataDescriptor;
    import mx.core.IUID;
    public class FileModel extends EventDispatcher implements ITreeDataDescriptor, IUID
        public var userId:String;
        public var name:String;
        public var fileId:String;
        public var parentId:String;
        public var modified:String;
        public var description:String;
        public var type:String;
        public var children:ArrayCollection;
        public function FileModel(target:IEventDispatcher=null)
            super(target);
            children = new ArrayCollection();
        public function getChildren(node:Object, model:Object=null):ICollectionView
            return children;
        public function hasChildren(node:Object, model:Object=null):Boolean
            if(children.length > 0)
            {return true;}
            else
            {return false;}
        public function isBranch(node:Object, model:Object=null):Boolean
             if(type == "DIRECTORY" || type=="TOPDIRECTORY")
            {return true;}
            else
            {return false;}
        public function getData(node:Object, model:Object=null):Object
            return this;
        public function addChildAt(parent:Object, newChild:Object, index:int, model:Object=null):Boolean
            return false;
        public function removeChildAt(parent:Object, child:Object, index:int, model:Object=null):Boolean
            return false;
        public function get uid():String
            return fileId;
        public function set uid(value:String):void
        public function addChild(childModel:FileModel):void
            children.addItem(childModel);

Thanks pm.  I finally got it to work.  Apparently the functions implemented when using ITreeDataDescriptor don't always make sense.  To get something to be seen as a leaf and not a branch.  item.isBranch can't be the only to show false.  The item.getChildren call must also return a null ICollectionView or something crazy like that , otherwise , your leaves will have disclosure symbols beside them.

Similar Messages

  • How to Flex tree control using folder click event  to pass coldfusion to get data from dynamiclly ?

    Hi friends.........
                Iam using flex tree control data coming from coldfusion file to display grid. As i click the tree folder to change the data from dynamic from grid.
    How to pass the folder id from coldfusion file.. Is it possible ?.. Means give any example please....
    Any One Help Me......
    With Regards.,
    Lingu.......

    When you set the dataProvider for your tree control, you actually pass an array or arraycollection or whatever to that property. The array contains objects coming from your server, right? Each object should contain a property with the folder id, something like:
    var arr:Array = [{id: 1, folderID: 34, name: "..."}, {id: 2, folderID: 4, name: "..."}, ...];
    Now, when you click an item in your tree or your dataGrid, you can access the folder id by:
    myTree.selectedItem.folderID
    Hope this helps
    Dany

  • Create folder / file icon with automator

    Guys,
    I know very little about using Automator.
    I was wondering if there is a way to create folder / file icons using automator to take an image of the contents of the file (maybe an image file / autodesk or sketchup drawing etc). The process would be similar to the way image files such as jpeg etc display the image as the file icon automatically.
    Hope this makes sense.
    Cheers....Scotty

    Have you considered using rsync?  This has the benefit of only copying only changed files on subsequent backups.
    Here's rsync wrapped in Applescript:
    set SrcDir to (choose folder with prompt "Please select Source directory")
    set DestDir to (choose folder with prompt "Please select Destination directory")
    set SrcDir to text items 1 thru -2 of POSIX path of SrcDir
    do shell script "/usr/bin/rsync -aHE --delete --exclude=\"*.mpg\" " & space & SrcDir & space & POSIX path of DestDir
    For a list of rsync options, in Terminal, enter: man rsync.

  • Folder/ file icons are different sizes from one window to another!

    Hi there
    I am having an extremely annoying problem where all my folders and files (in icon view) are totally different sizes from each other from one window to another. For example, I might click on a folder that's icon is small sized (64x64), but when that folder opens up, the icons of the subfolders inside are huge (276x276) and need to instantly be resized and re-arranged. Then if i continue to open one of these subfolders, the file icons inside it are now medium sized (96x96). Each new folder that I go into on my hard drive will be differently sized and I end up spending ages resizing and re-arranging them before I can do my work. This problem never happened in Leopard and Im despairing of what to do.
    Is there a way of setting a default icon size and spacing that can then be applied to every folder and file on the hard drive? I have used the 'Use as defaults' option on the 'View options' window but this doesn't apply it to anywhere else besides the current window you are on.
    Surely, Im doing something wrong as Apple could never have overlooked such an obvious problem like this?
    Can anyone advise?
    Many thanks
    Dan

    The Finder will (theoretically) remember the view settings for each individual folder that you visit. If you have not opened a particular folder before, you should get the default view settings, but once you have changed the view then that is what you will get on subsequent visits. You can erase the previous settings by deleting the (normally invisible) .DS_Store file that is created in a folder when it is opened, but this file can contain other Finder metadata.

  • How do I apply a custom folder/file icon in Yosemite?

    How do I apply a custom folder/file icon in Yosemite?

    Select the image you wish to use and press COMMAND-C to copy it. Select the folder/file icon. Press COMMAND-I to open the Get Info window. Click in the icon image in the top left corner, then press COMMAND-V to paste your image.

  • Edit node name in flex tree

    I want to edit a node in flex tree. Editable property of the
    tree makes all nodes editable based on "SELECT" action . But now
    based on my custom selection I want to edit a particular node. I
    thought of custom item renderer and item editor but that applies to
    all the nodes on "SELECT" action. Please let me know how to edit
    particular nodes based on particular action.
    Ex: On click of a button i want to edit the name of node
    (Node is just text with folder icon).
    Tx..
    Flextron

    Flextron,
    I was trying to find an answer to the same issue. After
    walking through the Tree and List class a bit I came up with this.
    Here is an example where the Tree is not editable and double
    clicking a node will allow you to rename it.
    tree.addEventListener( ListEvent.ITEM_DOUBLE_CLICK,
    itemDoubleClick );
    tree.addEventListener( ListEvent.ITEM_EDIT_END, itemEditEnd
    private function itemDoubleClick( event:ListEvent=null
    ):void
    tree.editable = true;
    tree.editedItemPosition = {rowIndex:tree.selectedIndex};
    private function itemEditEnd( event:ListEvent=null ):void
    tree.editable = false;
    - Jank

  • Some files in "DOCUMENTS" icon in dock won't open. Get msg saying You need a newer version of Pages to open this document." Have Pages 4.1 installed.  Same files will open ok from Finder, Pages App. Recently sync'd with ipad2 (Pages) after iOS5 installed.

    Some files in "DOCUMENTS" icon in dock won't open. Get msg saying "You need a newer version of Pages to open this document." Already have Pages 4.1 installed.  Same files will open ok from Finder/Pages App./selected file. Prob not noted until recently after sync'd with ipad2 (Pages) when I installed iOS5. Anyone-- please?!

    You have 2 versions of Pages on your Mac.
    Pages 5.2 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5.2 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Older versions of Pages 5 can not open files from later versions of Pages 5.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud and opened in a newer version of Pages is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has removed almost 100 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Rate/review Pages 5.2 in the App Store.
    Peter

  • When opening a folder with "items as icons" view, a millisecond fast random image appears in place

    Hi,
    since I updated to Yosemite (but cannot assure it's related or started exactly that moment) I've been experienced a weird issue.
    When I open a folder to navigate it, and it's set on "show items as icons", I see all the icons, for just less than a second, replaced by random images.
    It's like if while the proper folder/file icon it's loading, that space is temporarily occupied by the impression of another one (or parts of it), coming from my computer. Sometimes is a photo, sometimes another folder icon not related, sometime is the icon of a software.
    The picture then goes away (it stays less than a second) and the icon for the file/folder is then the appropriate one.
    I have a Macbook Pro 15-inc, mid 2010.
    Is it a known issue? If yes, how can I solve, if possible, this?
    Hope can be helpful to others too.
    Many Thanks

    First off, I do not recommend looking at your time machine while it is running.  You can tell if it is running by making sure its menubar icon is shown in Apple menu -> System Preferences -> Time Machine.  If the icon is moving, it is running.   You can manually backup, which I recommend over automatic backup, as automatic backup can get in your way.   Spotlight, if it is indexing (check the menu in the upper right that looks like a magnifying glass), will also slow matters down, and adding things you don't want Spotlight to search to your Apple menu -> System Preferences -> Spotlight -> Privacy pane will help.  Note this affects areas you can search in Time Machine as well.  If searching content of files is of little interest to you, I find Find Any File much quicker for finding by file name.   Backup when you aren't doing anything else, as otherwise, you may find yourself backing up files that haven't had the opportunity to close.
      Time Machine also works best if your destination drive is at least twice as capacious as your source drive.   Otherwise it is spending a lot of time trying to find places for the archived files, and barely is more archival than a simple clone.

  • Populate Flex Tree from Java Code (Database)

    Hi
    Can someone please help me? I'm very new to using flex. I'm
    basically trying to create a tree that is populated from data in my
    database. I am using hibernate to fetch that data.
    The plan is to basically create the tree in Java code (since
    I don't want any processing done on the client PC) and then pass
    this to the flex tree (or an actionscript data structure that is
    compatible as the tree datasource)
    I am creating the java tree using DocumentImpl. Is this
    correct? What class would work?
    Element e = null;
    Node n = null;
    Document xmldoc= new DocumentImpl();
    Element root = xmldoc.createElement("USERS");

    quote:
    Originally posted by:
    ntsiii
    Stop running and get a map (read the documents)
    This is hardly a useful comment and must discourage new users
    from asking questions. If you think the documentation relating to
    the use of the tree control is straightforward then I beg to
    differ.
    If you are aware of a clear example of how to use the data
    tree with a php backend returning a remote data object please
    enlighten me. Meanwhile I continue my search but not within the
    livedocs.
    One site I have found that may be of use is
    http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
    Not everyone is an expert.

  • Changing "Icon size" causes .ARW thumbnail image in folder to disappear and icon to appear

    Is this a bug everyone is getting?
    Have  .ARW files in a folder and it shows  thumbnail images of the .ARW files, but if I increase or decrease the slider to different sizes (to view better), a icon will appear instead of the . ARW preview image. Out of all the sizes on the slider only 2 or 3 sizes will show the .ARW thumbnail image.
    Any ideas? known issue?
    thanks

    The method I use is to open the jpeg file Command+A (select all) then Command+c (copy) close the jpeg preview window. Select the small icon on the top left corner of the get info window for the perspective folder. Command+v (paste) puts the copied image in and it then becomes the icon. If you want to use the drag and drop method you will need to convert the image file to an icon which can be done with automator. The icon however is less clear when you do that.

  • Dataprovider for Flex Tree

    how do you dynamically populate nodes in the Flex tree with data from a database?
    For example... if I have a node for Groups and a database for names of groups... how would I populate the child nodes of the Groups folder with the names of the groups in the database?

    alright i'll experiment. you may be able to help me understand why this isn't working though... this is the route i was going down:
    i wanted to convert this mxml to actionscript and bind it to the tree (so i can add results from my dataprovider):
        <mx:XMLListCollection id="treeData">
            <mx:source>
          <mx:XMLList>
                  <node label="Items">
                      <node label="Open"/>
                      <node label="In Progress"/>
                  </node>
          </mx:XMLList>
            </mx:source>
        </mx:XMLListCollection>
    and i was trying this code to make it bindable:
    var stringData:String = '<node label="Items">' + '<node label="Open"/>' + '<node label="In Progress"/>'
    + '</node>';
    var treeData= new XMLList(stringData);
    but when i use actionscript to create the treeData variable... and use {treeData} as the binding data... nothing shows in my tree.

  • [svn] 3037: Update flex-config. xml files used by the team and qa webapps to use the {targetPlayerMajorVersion} token instead of a hardcoded player version in the library-path and external-library-path .

    Revision: 3037
    Author: [email protected]
    Date: 2008-08-29 06:54:15 -0700 (Fri, 29 Aug 2008)
    Log Message:
    Update flex-config.xml files used by the team and qa webapps to use the {targetPlayerMajorVersion} token instead of a hardcoded player version in the library-path and external-library-path. This will allow the correct playerglobal.swc to be located when the target player version is set in the flex-config.xml or passed to mxmlc or compc.
    Modified Paths:
    blazeds/trunk/apps/team/WEB-INF/flex/flex-config.xml
    blazeds/trunk/qa/resources/config/flex-config.xml

    Unfortunately I don't have the
    "org.eclipse.swt.win32.win32.x86_3.1.2.jar" file. On my computer
    the folder is not set up the same way (C:\Program Files\Adobe\Flex
    Builder 2\plugins) instead it is set up as (C:\Program
    Files\Adobe\Flex Builder 2\metadata\plugins) but I've looked in
    everything and that file just isn't in there. I've re downloaded it
    twice. Still not there. Is there anything else i can do.

  • Change the root of Flex Tree dynamically

    I have a Flex Tree constructed dynamically. The dataprovider is xmllistcollection.The user clciks on a button to add an item(node) to the tree.
    when user tries to add 2nd item to the tree I want to create root(with a button) at the top automatically.
    So  a Root need to be created dynamically after 2nd item is added.
    Can someone please help me in getting this.
    I am using MXTreeItemrender  as Itemrender and was able to add nodes. But I could not get the third item(I am taking this xml node as Branch and adding) added to the top of the tree.
    Any help is very much appreciated

    Or in APEX 4.0 this can be done using a Dynamic Action that executes JavaScript code to change the region title.
    Give the region a static region ID for use in a jQuery selector.
    As solutions may be dependent on APEX version&mdash;among other factors&mdash;always specify the following information in your initial post:
    <li>APEX version
    <li>DB version and edition
    <li>Web server architecture (EPG, OHS or APEX listener)
    <li>Browser(s) used
    <li>Theme
    <li>Templates
    <li>Region type

  • Flex and php file uploader cross browser problems

    Hi, I have a problem in flex and php file uploader. It was
    working fine in Internet Explorer, but nothing would work in
    Firefox and in other browsers. Firefox and other browsers was not
    sending the session with the file upload and was producing a login
    error. On IE the session cookie is picked up and the upload request
    uses the authenticated session, no login error. I'm newbie in flex.
    Please help me. Thanks in advance!
    Here's my code:
    bgupload.mxml

    Hello, I am Gamaliel Arredondo, i have solved this problem, the error is in the code, you have a mistake in your code, check it out.
    The way to run the flex applications, in my case, i installed xampp, in the htdoc directory i put the folder with the files of the application and all is working very well, only when the apache is running because if it is stoped the application show error, please review your code and if you have problems you can contact me by e-mail ([email protected]) i also fought with that problem but i could find the solution, i hope to help you.

  • Can't get rid of the folder and exclamation mark icon

    i got given a new ipod nano (1st generation) to replace my old ipod mini, i installed the new software but got the folder and exclamation mark icon, i removed all itunes and quicktime software just in case it had anything to do with an old version of something and reinstalled the software...still got the icon. then i installed the updater from the website but still can't get rid of the icon...any advice? please help!
    ipod nano (first generation)   Windows XP  

    Windows users having trouble with their iPods should locate a Mac user. In many cases when an iPod won't show up on a PC that it will show up on the Mac. Then it can be restored. When the PC user returns to his computer the iPod will be recognized by the PC, reformatted for the PC, and usable again. By the way, it works in reverse too. A Mac user often can get his iPod back by connecting it to a PC and restoring it.
    Tips
    a. It does not matter whether the format is completed or not, the key is to erase (or partly) the corrupted firmware files on the Hard Drive of the iPod. After that, when the iPod re-connected with a computer, it will be recognized as an fresh external hard drive, it will show up on the iTunes 7.
    b. It is not a difficult issue for a Mac user to find a window base computer, for a PC user, if they can’t find any Mac user, they can go to a nearest Apple Shop for a favor.
    c. You may need to switch around the PC and Mac, try to do several attempts between “Format” and “Restore”

Maybe you are looking for

  • Smc fan control or let the apple decides to control the fan?

    intel core 2 duo mac book goes about the temperature of 54-60 C...hmm is that normal or should i use a third party application , just to minimized the heat? 1. does it wear out the fan fast if i run about 2,838 rpm or 3,500 rpm? let me know guys!!..t

  • Digital multimeter in LabVIEW?

    I am wondering if it is possible to design a digital multimeter using LabVIEW. If so are there any pointers here that anybody can give me? Such as how to convert voltage into current and other things?

  • 10.4.3 Update foze my mac HELP!

    I am not a proficent mac expert so I don't recal the specific language of the prompts but this is what happend I ran software update so I could get 10.4.3, came back a few minutes later and the instillation had timed out. Said to quit instillation, d

  • Pls explain this

    Hi response.setHeader("Expires","-1"); response.setHeader("Cache-Control","no-store, no-cache"); response.setHeader("Pragma","no-cache");So many times i heard about the above lines. But I cannot understand the meaning of these lines correctly. Can an

  • Messed up screen.

    I have a problem, probably with the computer, not the OS. Whenever the computer wakes up from sleep, the screen becomes all "messed" up. The keyboard still works, because I can enter my password, but the screen just moves to a different state of "jum