fixes for #199538 and #199862 release70
authorMartin Fousek <marfous@netbeans.org>
Fri, 08 Jul 2011 10:46:40 +0200
branchrelease70
changeset 1751210ffafd12a23
parent 17508 bce3697ad52a
child 17552 4f9e2be2a410
fixes for #199538 and #199862
php.smarty/nbproject/project.properties
php.smarty/src/org/netbeans/modules/php/smarty/SmartyPhpFrameworkProvider.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/indent/TplIndenter.java
     1.1 --- a/php.smarty/nbproject/project.properties	Tue Jun 21 14:47:52 2011 +0200
     1.2 +++ b/php.smarty/nbproject/project.properties	Fri Jul 08 10:46:40 2011 +0200
     1.3 @@ -2,4 +2,5 @@
     1.4  javac.compilerargs=-Xlint -Xlint:-serial
     1.5  nbm.homepage=http://wiki.netbeans.org/PhpSmartyFrameworkPlugin
     1.6  nbm.module.author=Martin Fousek
     1.7 -spec.version.base.fatal.warning=false
     1.8 +spec.version.base=1.50
     1.9 +#spec.version.base.fatal.warning=false
    1.10 \ No newline at end of file
     2.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/SmartyPhpFrameworkProvider.java	Tue Jun 21 14:47:52 2011 +0200
     2.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/SmartyPhpFrameworkProvider.java	Fri Jul 08 10:46:40 2011 +0200
     2.3 @@ -39,6 +39,7 @@
     2.4  package org.netbeans.modules.php.smarty;
     2.5  
     2.6  import java.io.File;
     2.7 +import java.util.concurrent.atomic.AtomicBoolean;
     2.8  import java.util.logging.Level;
     2.9  import java.util.logging.Logger;
    2.10  import org.netbeans.api.progress.ProgressUtils;
    2.11 @@ -150,7 +151,7 @@
    2.12              if (fs.isFound()) {
    2.13                  return true;
    2.14              } else {
    2.15 -                ProgressUtils.showProgressDialogAndRun(new Runnable() {
    2.16 +                ProgressUtils.runOffEventDispatchThread(new Runnable() {
    2.17                      @Override
    2.18                      public void run() {
    2.19                          FileObject sourceDirectory = phpModule.getSourceDirectory();
    2.20 @@ -159,8 +160,8 @@
    2.21                              fs.setFound(true);
    2.22                          }
    2.23                      }
    2.24 -                }, NbBundle.getMessage(SmartyPhpFrameworkProvider.class, "MSG_SearchingForSmartyExt"));
    2.25 -                
    2.26 +                }, NbBundle.getMessage(SmartyPhpFrameworkProvider.class, "MSG_SearchingForSmartyExt"), 
    2.27 +                new AtomicBoolean(false), false, 1000, 10000);
    2.28              }
    2.29              return fs.isFound();
    2.30          } finally {
     3.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/editor/indent/TplIndenter.java	Tue Jun 21 14:47:52 2011 +0200
     3.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/editor/indent/TplIndenter.java	Fri Jul 08 10:46:40 2011 +0200
     3.3 @@ -321,16 +321,19 @@
     3.4  
     3.5      private boolean isBodyCommand(String tplToken, IndenterContextData<TplTopTokenId> context) {
     3.6          String tokenText = tplToken.toLowerCase();
     3.7 +        if (tokenText.isEmpty()) return false;
     3.8          return bodyCommands.contains(tokenText) || bodyCommands.contains(tokenText.substring(1));
     3.9      }
    3.10  
    3.11      private boolean isElseCommand(String tplToken) {
    3.12          String tokenText = tplToken.toLowerCase();
    3.13 +        if (tokenText.isEmpty()) return false;
    3.14          return elseCommands.contains(tokenText) || elseCommands.contains(tokenText.substring(1));
    3.15      }
    3.16  
    3.17      private boolean isInRelatedCommand(String actualString, String comparingString) {
    3.18          if (comparingString != null && actualString != null) {
    3.19 +            if (actualString.isEmpty()) return false;
    3.20              return actualString.substring(1).equals(comparingString)
    3.21                      || (relatedCommands.get(comparingString) != null
    3.22                      && relatedCommands.get(comparingString).contains(actualString));