More adjustments to recent NB proper changes
authorJan Lahoda <jlahoda@netbeans.org>
Wed, 01 May 2013 21:53:41 +0200
changeset 953d4587f6e7b02
parent 952 4c4b5ec2c7de
child 954 6cf93365638c
More adjustments to recent NB proper changes
cmdline/compiler/src/org/netbeans/modules/jackpot30/compiler/HintsAnnotationProcessing.java
cmdline/lib/src/org/netbeans/modules/jackpot30/cmdline/lib/NonNBComputer.java
cmdline/lib/src/org/netbeans/modules/jackpot30/cmdline/lib/StandaloneTools.java
language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/API.java
     1.1 --- a/cmdline/compiler/src/org/netbeans/modules/jackpot30/compiler/HintsAnnotationProcessing.java	Sun Apr 28 21:55:14 2013 +0200
     1.2 +++ b/cmdline/compiler/src/org/netbeans/modules/jackpot30/compiler/HintsAnnotationProcessing.java	Wed May 01 21:53:41 2013 +0200
     1.3 @@ -304,9 +304,10 @@
     1.4      private static final class SettingsBasedChecker implements ContainsChecker<String> {
     1.5          private static final Set<String> enabled = new HashSet<String>();
     1.6          public SettingsBasedChecker() {
     1.7 +            HintsSettings hintsSettings = HintsSettings.getGlobalSettings();
     1.8              for (HintMetadata hm : RulesManager.getInstance().readHints(null, null, null).keySet()) {
     1.9 -                if (   HintsSettings.isEnabled(hm)
    1.10 -                    && HintsSettings.getSeverity(hm, HintsSettings.getPreferences(hm.id, HintsSettings.getCurrentProfileId())) != Severity.HINT) {
    1.11 +                if (   hintsSettings.isEnabled(hm)
    1.12 +                    && hintsSettings.getSeverity(hm) != Severity.HINT) {
    1.13                      enabled.add(hm.id);
    1.14                  }
    1.15              }
     2.1 --- a/cmdline/lib/src/org/netbeans/modules/jackpot30/cmdline/lib/NonNBComputer.java	Sun Apr 28 21:55:14 2013 +0200
     2.2 +++ b/cmdline/lib/src/org/netbeans/modules/jackpot30/cmdline/lib/NonNBComputer.java	Wed May 01 21:53:41 2013 +0200
     2.3 @@ -57,6 +57,7 @@
     2.4  import org.netbeans.api.java.source.JavaSource;
     2.5  import org.netbeans.api.java.source.Task;
     2.6  import org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker;
     2.7 +import org.netbeans.modules.java.hints.spiimpl.options.HintsSettings;
     2.8  import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
     2.9  import org.netbeans.spi.editor.hints.ErrorDescription;
    2.10  import org.netbeans.spi.java.classpath.support.ClassPathSupport;
    2.11 @@ -92,7 +93,7 @@
    2.12                      return;
    2.13                  }
    2.14  
    2.15 -                List<ErrorDescription> eds = new HintsInvoker(parameter, cancel).computeHints(parameter);
    2.16 +                List<ErrorDescription> eds = new HintsInvoker(HintsSettings.getSettingsFor(parameter.getFileObject()), cancel).computeHints(parameter);
    2.17                  List<List<Object>> currentResult = new LinkedList<List<Object>>();
    2.18  
    2.19                  if (eds != null) {
     3.1 --- a/cmdline/lib/src/org/netbeans/modules/jackpot30/cmdline/lib/StandaloneTools.java	Sun Apr 28 21:55:14 2013 +0200
     3.2 +++ b/cmdline/lib/src/org/netbeans/modules/jackpot30/cmdline/lib/StandaloneTools.java	Wed May 01 21:53:41 2013 +0200
     3.3 @@ -59,6 +59,7 @@
     3.4  import org.netbeans.api.java.queries.SourceForBinaryQuery;
     3.5  import org.netbeans.api.java.source.ClasspathInfo;
     3.6  import org.netbeans.modules.java.hints.spiimpl.Utilities.SPI;
     3.7 +import org.netbeans.modules.java.hints.spiimpl.options.HintsSettings.GlobalSettingsProvider;
     3.8  import org.netbeans.modules.java.source.indexing.JavaCustomIndexer;
     3.9  import org.netbeans.modules.java.source.parsing.JavacParser;
    3.10  import org.netbeans.modules.java.source.parsing.JavacParserFactory;
    3.11 @@ -100,7 +101,7 @@
    3.12  
    3.13      public static final class StandaloneMimeDataProviderImpl implements MimeDataProvider {
    3.14  
    3.15 -        private static final Lookup L = Lookups.fixed(NbPreferences.forModule(StandaloneTools.class), new JavacParserFactory(), new JavaCustomIndexer.Factory());
    3.16 +        private static final Lookup L = Lookups.fixed(NbPreferences.forModule(StandaloneTools.class), new JavacParserFactory(), new JavaCustomIndexer.Factory(), new GlobalSettingsProvider());
    3.17  
    3.18          public Lookup getLookup(MimePath mimePath) {
    3.19              if ("text/x-java".equals(mimePath.getPath()))
     4.1 --- a/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/API.java	Sun Apr 28 21:55:14 2013 +0200
     4.2 +++ b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/API.java	Wed May 01 21:53:41 2013 +0200
     4.3 @@ -76,6 +76,7 @@
     4.4  import org.netbeans.modules.java.hints.providers.spi.Trigger.PatternDescription;
     4.5  import org.netbeans.modules.java.hints.spiimpl.Utilities;
     4.6  import org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker;
     4.7 +import org.netbeans.modules.java.hints.spiimpl.options.HintsSettings;
     4.8  import org.netbeans.modules.java.hints.spiimpl.pm.BulkSearch;
     4.9  import org.netbeans.modules.java.hints.spiimpl.pm.BulkSearch.BulkPattern;
    4.10  import org.netbeans.spi.editor.hints.ErrorDescription;
    4.11 @@ -106,7 +107,7 @@
    4.12              if (validate) {
    4.13                  CompilationInfo resolvedInfo = ResolveService.parse(segment, candidate);
    4.14                  CompilationInfoHack info = new CompilationInfoHack(resolvedInfo);
    4.15 -                List<ErrorDescription> computedHints = new HintsInvoker(info, new AtomicBoolean()).computeHints(info, hints);
    4.16 +                List<ErrorDescription> computedHints = new HintsInvoker(HintsSettings.getGlobalSettings(), new AtomicBoolean()).computeHints(info, hints);
    4.17  
    4.18                  if (computedHints.isEmpty()) continue;
    4.19              }
    4.20 @@ -127,7 +128,7 @@
    4.21          CompilationInfoHack info = new CompilationInfoHack(resolvedInfo);
    4.22          Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern);
    4.23  
    4.24 -        List<ErrorDescription> computedHints = new HintsInvoker(info, new AtomicBoolean()).computeHints(info, hints);
    4.25 +        List<ErrorDescription> computedHints = new HintsInvoker(HintsSettings.getGlobalSettings(), new AtomicBoolean()).computeHints(info, hints);
    4.26  
    4.27          for (ErrorDescription ed : computedHints) {
    4.28              if (!ed.getFile().equals(info.getFileObject())) continue;