History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RUBY-1083
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Oleg Shpynov
Reporter: Mike Aizatsky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Ruby

Rails plugin should use the same method for calculating file icon as IDEA does for Java

Created: 24 Oct 07 16:59   Updated: 27 Oct 07 18:22
Component/s: None
Fix Version/s: 1.0

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
          if (psiFile instanceof PsiClassOwner) {
            PsiClass[] classes = ((PsiClassOwner)psiFile).getClasses();
            if (classes.length > 0) {
              // prefer icon of the class named after file
              final String fileName = file.getNameWithoutExtension();
              Icon classIcon = null;
              for (PsiClass aClass : classes) {
                if (Comparing.strEqual(aClass.getName(), fileName)) {
                  classIcon = aClass.getIcon(flags);
                  break;
                }
              }
              if (classIcon == null) classIcon = classes[classes.length - 1].getIcon(flags);
              icon = classIcon;
            }
          }


 All   Comments   Work Log   Change History      Sort Order:
Oleg Shpynov - 27 Oct 07 18:22
fixed