This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 216856
Collapse All | Expand All

(-)a/code.analysis/src/org/netbeans/modules/analysis/RunAnalysisPanel.java (-1 / +31 lines)
Lines 154-168 Link Here
154
        Icon currentProjectIcon = null;
154
        Icon currentProjectIcon = null;
155
        NonRecursiveFolder pack = context.lookup(NonRecursiveFolder.class);
155
        NonRecursiveFolder pack = context.lookup(NonRecursiveFolder.class);
156
        FileObject currentFile = context.lookup(FileObject.class);
156
        FileObject currentFile = context.lookup(FileObject.class);
157
        DataFolder folder = context.lookup(DataFolder.class);
157
158
158
        if (currentFile != null && currentFile.isData()) {
159
        if (currentFile != null && currentFile.isData()) {
159
            scopes.add(new FileScopeDescription(currentFile));
160
            scopes.add(new FileScopeDescription(currentFile));
160
        }
161
        }
161
        
162
        
163
        if (folder != null) {
164
            scopes.add(new FolderScopeDescription(folder));
165
        }
166
        
162
        if (pack != null && currentFile == null) {
167
        if (pack != null && currentFile == null) {
163
            currentFile = pack.getFolder();
168
            currentFile = pack.getFolder();
164
        }
169
        }
165
        
170
166
        if (currentFile != null) {
171
        if (currentFile != null) {
167
            Project p = FileOwnerQuery.getOwner(currentFile);
172
            Project p = FileOwnerQuery.getOwner(currentFile);
168
173
Lines 962-967 Link Here
962
        }
967
        }
963
    }
968
    }
964
969
970
    private static final class FolderScopeDescription implements ScopeDescription {
971
        private final DataFolder folder;
972
        public FolderScopeDescription(DataFolder folder) {
973
            this.folder = folder;
974
        }
975
        @Override
976
        @Messages({"# {0} - folder display name", "DN_CurrentFolder=Current Folder ({0})"})
977
        public String getDisplayName() {
978
            return Bundle.DN_CurrentFolder(folder.getName());
979
        }
980
        @Override
981
        public Icon getIcon() {
982
            return ImageUtilities.image2Icon(folder.getNodeDelegate().getIcon(1));
983
        }
984
985
        @Override
986
        public Scope getScope(AtomicBoolean cancel) {
987
            return Scope.create(null, null, folder.files());
988
        }
989
        
990
        public String getId() {
991
            return "*currentFolder"; // NOI18N
992
        }
993
    }
994
965
    private static final class FileScopeDescription implements ScopeDescription {
995
    private static final class FileScopeDescription implements ScopeDescription {
966
        private static final Logger LOG = Logger.getLogger(FileScopeDescription.class.getName());
996
        private static final Logger LOG = Logger.getLogger(FileScopeDescription.class.getName());
967
        private final FileObject file;
997
        private final FileObject file;

Return to bug 216856