Regression with tree.iconFunction: default icons have disapperead

I have a tree control, with icon function redifined.
However, for some items, I would like to use default tree
icons (folder, sheet,...)
In Flex 1.5, if returned null from the iconFunction, the
default icon was displayed.
In Flex 2.0, this does not work anymore. The doc says that
the icons are in Assets.swf, but how to reference and embed them in
my application ?

Here's a code snippet of one way to set Tree's icons:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
width="600" height="600">
<mx:Script>
<![CDATA[
[Bindable]
[Embed(source="smallU.jpg")]
public var redU:Class;
[Bindable]
public var treeArray:Object =
{ label:"Containers", children:
{ label:"DividedBoxClasses", children:
{ label:"BoxDivider", data:"BoxDivider.as" }
{ label:"GridClasses", children:
{ label:"GridRow", data:"GridRow.as" },
{ label:"GridItem", data:"GridItem.as" }
{ label:"Printing", children:
{ label:"PrintJob", data:"PrintJob.as"},
{ label:"PrintJob1", data:"PrintJob1.as" },
{ label:"PrintDataGrid", data:"PrintDataGrid.as" }
]]>
</mx:Script>
<mx:Tree dataProvider="{treeArray}"
disclosureClosedIcon="{redU}" />
</mx:Application>
There's a a style property mapping to each Tree icon (ex:
folderOpenIcon, defaultLeafIcon).
Hope that helps,
Belinda

Similar Messages

  • Issue with Tree view

    Hello experts,
    I am facing a very strange issue with tree view.
    I have created a custom component with a tree view. All data are coming in the tree view. But the strange thing is that the data is not getting displayed on the screen.
    I am sure about the data because, when I am selecting a line from the tree, the data from that line is coming to the main screen.
    Please help!!
    Regards
    Debolina

    Hi experts...
    Any pointers to this issue???
    Please help!
    Regards,
    Debolina

  • Screwed up my default icons with CandyBar - how to get 'em back??

    Hi,
    Okay, this was really dumb of me, I know - please be gentle...
    I registered Shapeshifter a couple of weeks ago and used it to change my theme and system icons to my liking.
    Then, today, I downloaded the CandyBar demo to see what that would do. Bad idea. I found that the Finder would display the CandyBar icons if ShapeShifter's icon setting was set to Aqua Default. (Seems that they change the icons in different ways.) At some point, Candy Bar complained that some of my icons weren't the system defaults and what did I want to do about the default backup? Whatever I did wasn't smart, because now I cannot get back to the Aqua System defaults. When I try to restore from CandyBar, it complains that it doesn't have the backup record. And when I try Aqua Defaults in Shapeshifter, it displays a mish-mash of "real" OX systems and (mostly) icons from the Icontainer that I installed via CandyBar.
    Where do the default Aqua icons reside, anyway? And is there any way to get back to them short of installing a clean system folder? Hope this makes sense...
    Thanks in advance,
    Steve
    PowerBook G4 17   Mac OS X (10.4.8)   1.5 GB RAM

    Well, I've thought of doing an "Archive and Install," which would give me a fresh "System" folder but leave my current accounts, Internet settings and email intact, and presumably, get all my default icons back. But then you have to laboriously transfer over a lot of Application Support files for your installed, 3rd-party apps, which can take hours. At this point, I have only a handful of messed up icons, and I'm thinking that I may be better off living with it until Leopard comes along and I can make a fresh start that way. What's so frustrating is that replacing that CoreTypes.bundle got nearly all my Aqua defaults back - but why are those few that won't revert so stubborn??
    I should add that I'm glad I didn't buy CandyBar. It seems to mess with your System folder in a way that Unsanity's "Shapeshifter" does not.
    Take care,
    Steve

  • Desktop Icons have vanished, have tried many solutions offered in forums with no results

    I'm at a complete loss as to what to do after searching high and low for answers to this problem.
    My desktop icons have mysteriously vanished as I switched it on last night. I had been using it with no issue earlier that day, but for some reason, switching it on last night, I was greeted with a completely clean desktop.
    This has happened once before, so I figured simply rebooting the computer (like the last time this occurred) would bring back the icons. No such luck, even after restarting it or shutting it down, and reopening it 15 minutes later. When this problem last occurred, I think I was using Snow Leopard; I'm now running Mountain Lion (if this makes any difference).
    I searched a few forums, and tried every solution listed in these topics with absolutely no success. List of things I've tried, as suggested by users on other forums (that seemed to work for people with similar problems):
    Checked to see if the "Desktop" folder was renamed to something else, it wasn't;
    Relaunched Finder several times
    Restarted the computer, shut it down for hours and restarted
    View>Clean up by/Sort by all tried, nothing happens
    Changed the resolution several times, nothing happens
    Quit iTunes, nothing happens
    Verified the disk in Disk Utility, no problems (so repair disk was greyed out);
    Verified the permissions, repaired the permissions successfully, nothing happened;
    Checked Macintosh HD>Users>(username)>Desktop, nothing in the folder (0kb when I check Get Info);
    Searched for and tried to remove via Terminal the following preferences: com.apple.finder.plist AND com.apple.FolderActions.plist but they are non-existant on my account OR guest account
    Booted in safe mode, still no icons
    Logged into guest account, no icons on administrator Desktop (I overrided permissions to see the desktop, and still no icons)..
    Tried to "killall Finder" in Terminal, no response.
    I did not recently:
    download any new software, games, etc (with the exception of FluidApp, which was installed 3 weeks ago and frankly I don't see how it would affect my computer weeks later);
    connect my MacBook to an external/additional monitor (have never done this, so icons can't be off-screen)
    Additional info:
    When in Finder, most functions in my View menu are greyed out. Available options: "Clean Up By", "Sort By", and "View Options". Selecting any of these do nothing.
    I checked this article (http://support.apple.com/kb/TS1916) and my Computer Name actually DID contain an illegal character (a dash) so I removed it; however it did not correct my problem even after reboot/logging out and in/relaunching Finder. (I'm running Mountain Lion though, so not sure if this even applies, but it was the closest thing I could find).
    Nothing but the contents of the desktop seem to have been compromised. I can open applications, install software, use any application, view/open/access files everywhere else on my computer.
    I can save new files on my desktop and they don't disappear.
    I can put files from other places in my computer on the desktop and they don't disappear.
    I DID do a system update to the latest version of Mountain Lion AFTER encountering this problem, in hopes it would correct the problem somehow, but it did not.
    I installed one application in hopes of figuring out a fix after the problem occurred (TinkerTool) but after playing with the options (and in the end, not changing anything) I still have the problem. The "Disable Desktop Features" thing was not checked. I checked it, relaunched finder, and what I put on the desktop disappeared, so I unchecked it and relaunched and they reappeared, but my old desktop did not.
    It's seriously as if someone did a "Select All > Delete", and overpassed the Trash bin somehow (because it still has a few items I had put in there previously).
    Does anyone have any other suggestions in how to retreive my lost desktop icons? I'm going crazy..

    If you have a backup, try restoring your Desktop folder from there.
    You should have a Finder and a FolderActions .plist. Have you tried looking in your user library folder manually instead of using Terminal?
    If you prefer to make your user library permanently visible, use the Terminal command found below.
    http://osxdaily.com/2011/07/04/show-library-directory-in-mac-os-x-lion/
    You might want to bookmark the command. I had to use it again after I installed 10.8.4. I have also been informed that if you drag the user library to Finder it will remain visible.

  • Can i have a check box in the hierarchical tree in the icons place, urgent!!! please

    Hi,
    I'am working on the Hierarchical Tree structure which should have three levels, I need to have a check box in the place of the icon & if i select a node that node & the child nodes should get selected.
    After this when i say move selected ( i'am trying to use picklist class also) the entire checked tree has to move to the display area to the right & should display as tree structure & after this if i save then the checked records which are moved to another text area should get saved!!
    How to achieve this? I have the tree structure ready but the check box part is the worrying factor! & then moving the checked records to the right using picklist class is the second problem & finally saving records to database.
    Any help in this regard will be deeply appreciated:)
    If check box is not possible then i will have to look at other methods, will the tree structure allow checkboxes????
    Thanks
    Mahesh

    No the tree will not allow checkboxes

  • Why does my application icons have a cirle with a slash on them?

    why does my application icons have a cirle with a slash on them?

    That means those applications cannot be run on your computer.
    There are many different reasons why that situation could arise, but without more information all we can do is speculate / guess. For example, you upgraded the OS and the apps will not run in the new OS.
    If you need more specific answers.ost back with more information, e.g. what version of Mac OS X? when did this first occur?

  • HT4623 My Iphone 4 is locked with the plug in icon and will not go away. My computer is not recognizing the device. I have tried to reboot it but it's frozen. I was updating it to the new software and it came up with an error and said it couldn't update

    I was updating my Iphone 4 with the new software and while it was doing the download and update, an error window appeared and it said it couldn't update and now my phone is frozen with the plug in icon. I have tried to reboot it, pushing the power button and the home button and nothing is working

    Try DFU Mode Restore. Open iTunes on computer. Connect iPhone to computer with USB cable. Hold both Home and Power button, after exactly 10 seconds release the Power Button, keep holding the Home button until iTunes recognizes iPhone in Recovery Mode, usually about 20 seconds time. If the iPhone screen is black, blank this is DFU Mode. Click the Restore button of iTunes.

  • I set up iCloud on my iMac with OS version 10.6.8 but I'm not able to have the icon show on my Dock with the other application icons. What do I do?

    I set up iCloud on my iMac with OS version 10.6.8 but I'm not able to have the iCloud icon show in my Dock with the other application icons. What can I do? Is it because iCloud is not part of the 10.6.8 version? I clicked System Preferences and I saw MobileMe and no iCloud.

    Thanks for your reply! Would my IMac be able to support the Mavericks (10.9) considering that I bought it in June 2011? Not sure if that even matters.

  • When I try to drag the iphoto library to the external disk a forbidden (circle with slash through it) icon appear. Why do you suppose it is preventing me from adding to external drive? These are pictures I have taken. I believe it cannot find the origina

    When I try to drag the iphoto library to the external disk a forbidden (circle with slash through it) icon appear. Why do you suppose it is preventing me from adding to external drive? These are pictures I have taken. I believe it cannot find the original file.  Please help.
    Thanks.

    What happens if you try to  Option-drag the library to the EHD?  The same icon?
    Make sure the EHD is formatted Mac OS X Extended (journaled) with Ownership set to be ignored:
    OT

  • I've lost half of my icons such as calculator, fonts, chess, automator,ichat,ical it it saying that you can use this version with the OSX.  You have version 4.04. And, there is no way to update them.  What do you do?

    I've lost half of my icons such as calculator, fonts, chess, automator,ichat,ical it it saying that you can use this version with the OSX.  You have version 4.04. And, there is no way to update them.  What do you do?

    If I'm understanding you correctly, those apps have stopped working and you are getting a message saying that they won't work with this version of Mac OS X when you try to open them. Is that right? If so, have you moved those apps out of their original locations? That is a bad idea, as it prevents them from being properly updated. If this is what has happened, what version of the system were you running before they stopped working, and what version are you running now, after installing the update that has made them stop working?

  • Icon was changed to default icon when editting a node on JTree

    I have a tree with icon on nodes. However, when I edit the node, the icon is changed to default icon.
    I don't known how to write the treeCellEditor to fix that one.
    The following is my code:
    package description.ui;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.ToolTipManager;
    import javax.swing.WindowConstants;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellEditor;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreePath;
    import javax.swing.tree.TreeSelectionModel;
    public class Tree extends javax.swing.JPanel {
         private JTree tree;
         private JScrollPane jScrollPane1;
         public static void main(String[] args) {
              JFrame frame = new JFrame();
              frame.getContentPane().add(new Tree());
              frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
              frame.pack();
              frame.show();
         public Tree() {
              super();
              initGUI();
         private void initGUI() {
              try {
                   BorderLayout thisLayout = new BorderLayout();
                   this.setLayout(thisLayout);
                   setPreferredSize(new Dimension(400, 300));
                    jScrollPane1 = new JScrollPane();
                    this.add(jScrollPane1, BorderLayout.CENTER);
                        DefaultMutableTreeNode rootNode = createNode();
                        tree = new JTree(rootNode);
                        tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
                        jScrollPane1.setViewportView(tree);
                        ToolTipManager.sharedInstance().registerComponent(tree);
                        MyCellRenderer cellRenderer = new MyCellRenderer();
                        tree.setCellRenderer(cellRenderer);
                        tree.setEditable(true);
                        tree.setCellEditor(new DefaultTreeCellEditor(tree, cellRenderer));
                        //tree.setCellEditor(new MyCellEditor(tree, cellRenderer));
              } catch (Exception e) {
                   e.printStackTrace();
         private void btRemoveActionPerformed(ActionEvent evt) {
             TreePath path = tree.getSelectionPath();
             DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)path.getLastPathComponent();
             ((DefaultTreeModel)tree.getModel()).removeNodeFromParent(selectedNode);
         private DefaultMutableTreeNode createNode() {
             DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Doc");
             DefaultMutableTreeNode ch1 = createChuongNode(rootNode, "Ch1");
             DefaultMutableTreeNode ch2 = createChuongNode(rootNode, "Ch2");
             createTextLeafNode(ch1, "title");
             return rootNode;
         private DefaultMutableTreeNode createChuongNode(DefaultMutableTreeNode parent, String name) {
             DefaultMutableTreeNode node = new DefaultMutableTreeNode(new ChapterNodeData(name));
             parent.add(node);
             return node;
         private DefaultMutableTreeNode createTextLeafNode(DefaultMutableTreeNode parent, String name) {
             DefaultMutableTreeNode node = new DefaultMutableTreeNode(new TitleNodeData(name));
             parent.add(node);
             return node;
          private class MyCellRenderer extends DefaultTreeCellRenderer {
                 ImageIcon titleIcon;
                 ImageIcon chapterIcon;
                 public MyCellRenderer() {
                     titleIcon = new ImageIcon(getClass().getClassLoader()
                            .getResource("description/ui/icons/Text16.gif"));
                     chapterIcon = new ImageIcon(getClass().getClassLoader()
                            .getResource("description/ui/icons/Element16.gif"));
                 public Component getTreeCellRendererComponent(
                                     JTree tree,
                                     Object value,
                                     boolean sel,
                                     boolean expanded,
                                     boolean leaf,
                                     int row,
                                     boolean hasFocus) {
                     super.getTreeCellRendererComponent(
                                     tree, value, sel,
                                     expanded, leaf, row,
                                     hasFocus);
                     if (isChapterNode(value)) {
                         setIcon(chapterIcon);
                         setToolTipText("chapter");
                     } else if (isTextLeafNode(value)) {
                         setIcon(titleIcon);
                         setToolTipText("title");
                     return this;
                 protected boolean isChapterNode(Object node) {
                     return ((DefaultMutableTreeNode)node).getUserObject() instanceof ChapterNodeData;
                 protected boolean isTextLeafNode(Object node) {
                     return ((DefaultMutableTreeNode)node).getUserObject() instanceof TitleNodeData;
          private class MyCellEditor extends DefaultTreeCellEditor {
                 ImageIcon titleIcon;
                 ImageIcon chapterIcon;
              public MyCellEditor(JTree tree, DefaultTreeCellRenderer renderer) {
                  super(tree, renderer);
                  titleIcon = new ImageIcon(getClass().getClassLoader()
                         .getResource("description/ui/icons/Text16.gif"));
                  titleIcon = new ImageIcon(getClass().getClassLoader()
                         .getResource("description/ui/icons/Element16.gif"));
              public Component getTreeCellEditorComponent(
                           JTree tree,
                           Object value,
                           boolean isSelected,
                           boolean expanded,
                           boolean leaf,
                           int row) {
                  super.getTreeCellEditorComponent(tree, value, isSelected, expanded, leaf, row);
                  return this.editingComponent;
          abstract class NodeData{
              String name;
              public NodeData(String name) {
                  this.name = name;
              public String getName() {
                  return name;
              public void setName(String name) {
                  this.name = name;
              public String toString() {
                  return name;
          class ChapterNodeData extends NodeData {
              public ChapterNodeData(String s) {
                  super(s);
          class TitleNodeData extends NodeData {
              public TitleNodeData(String attr) {
                  super(attr);
    }

    Arungeeth wrote:
    I know the name of the node... but i cant able to find that nodeHere is some sample code for searching and selecting a node:
        TreeModel model = jtemp.getModel();
        if (model != null) {
            Object root = model.getRoot();
            search(model, root, "Peter");//search for the name 'Peter'
            System.out.println(jtemp.getSelectionPath().getLastPathComponent());
        } else {
            System.out.println("Tree is empty.");
    private void search(TreeModel model, Object o, String argSearch) {
        int cc;
        cc = model.getChildCount(o);
        for (int i = 0; i < cc; i++) {
            DefaultMutableTreeNode child = (DefaultMutableTreeNode) model.getChild(o, i);
            if (model.isLeaf(child)) {
                TreeNode[] ar = child.getPath();
                String currentValue = Arrays.toString(ar);
                if (currentValue.contains(argSearch)) {
                    jtemp.setSelectionPath(new TreePath(ar));
            } else {
                search(model, child, argSearch);
    }

  • Hack Default Icons

    Hi,
    I wonder if there is any possibility to hack default icons for such elements as the tree element, since I am using my custom skin family with own-created CSS files;
    And if yes, how could this be done?
    Thanks in prior

    I have migrated my application to JDeveloper 10.1.3.3, now can anyone instruct or help me how is it possible to apply custom icons on Tree element, instead of default ones?

  • .m4v file icons have become solid white in Finder under iTunes 10.6.3

    Hi there,
    I just discovered this little annoyance... I thought I'd seen the last of it under a prior version of iTunes, but it may have come back.
    iTunes video files (.m4v container files) have suddenly defaulted to a plain white icon in the Finder - desktop, folders, etc. - upon updating to iTunes 10.6.3.  The generic blue "notes" icon with "M4V" has disappeared, and will not reappear upon attempting to clear out the icon during a Get Info.
    Strangely, if "Show icon preview" is checked under Finder's View Options, it will display any associated album art with the .m4v file correctly - it just so happens that something occurred with the default icons.
    I rebuilt the Launch Services just in case, and these files by default still open with iTunes as per usual.  Checked for corrupt .plist files (even trashed com.apple.finder.plist) and cleared some caches out, ran maintenance scripts, etc. to cover any possible loose ends, but this issue is still present.
    I recently upgraded to Lion 10.7.4 (long time SL holdout) but everything was normal under iTunes 10.6.2 - so I cannot determine whether this is a Lion issue or an iTunes issue.  I am going to post this in the iTunes forum as well, but has anyone else noticed this recently?  If so, what did you do to fix this?
    Thanks all,
    Steve

    That's the point to where I was getting - without icon previews, the default icon for .m4v files should be the following:
    (This was just taken from my wife's MacBook Pro, still on iTunes 10.6.2 but running Snow Leopard 10.6.8)
    Under Lion (10.7.4) and iTunes 10.6.3, the default icon (no previews) is empty white, which I do not believe should be - I had the above generic icon for .m4v files in Lion under 10.6.2.
    Yet iTunes-associated audio files are fine: (from my iMac)
    Strange, isn't it??
    Steve

  • How can i change the default icon of a new folder?

    what i mean is like every time i create a new folder instead of changing the icon after its created, can i somehow change the default icon on a new folder i create? so when i create a new folder its created with the icon i want it to have?
    and i want to do it manually i dont want to use programs for it
    thanks

    nemesio wrote:
    i know but i dont want to use candy bar, were do i go to do it manually?
    why not? use LiteIcon then. it's free and is MUCH safer than mucking with system files by hand. if you insist you can do it as follows. go to /system/library/coreservices. control-click on coretypes.bundle and select "show package contents". go to contents-> resources. change the file GenericFolderIcon.icns with your own .icns file. back up the original bundle first.

  • Change the default icon for unsatisfied node

    Is it possible to change the default icon for the unsatisfied node (unsatisfied indicator). I have checked the UI content element with the same name, but it does not have the source file setting in it, so I guess it is hard coded. I tried to change the source file with the name unsatisfied_status.gif to a different image and it works, but this will be a system wide change. I want to do this as a model specific change. Has anyone done this before? Thanks in advance.
    Cheers,
    Biju.
    [My Oracle Blog|http://oraclewithbiju.blogspot.com]

    Did you try changing image name in UI edit page?
    UI edit page lists few images which can be changed for each UI, like unsatisfied indicator, logic status icons etc.

Maybe you are looking for

  • Whats the best video converter?

    tell me the pros and cons and the conbersion speeds and what codes it can read, thanks.

  • How do I rid of jollywallet

    How do I get rid of Jollywallet, there is something in youtube video but it is hard to follow. I get all these commercials popping up all the time. I have tried finding the program to remove from my Control Panel and have removed software but nothing

  • Check required for Required Delivery date not to be copied in Billing date

    Hi Friends, We have a requirement by the client that if we change the required delivery date in the order,the billing date should not be changed at the sales order item level. Requirement comes from the fact that management decides a day on personal

  • Deadline loop not completed

    Hi,       I've created a deadline work item for latest start. In the deadline branch, I created a loop for sending mails at a specified intervals. and I created a wait step before each loop pass and when the condition reached, the loop will go for ne

  • A different sort of loop.

    I want to loop through a ListIterator doing "work" on each element but do some "special work" with just the first element. I can think of several inelegant solutions but can anyone think of a more graceful solution? Remember I'm trying to be efficien