hide feature not yet ready for the prime time
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 18 Nov 2009 13:58:09 +0000 (16:58 +0300)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 18 Nov 2009 13:58:09 +0000 (16:58 +0300)
platform/lang-impl/src/com/intellij/find/EditorSearchComponent.java
platform/lang-impl/src/com/intellij/find/impl/FindDialog.java
platform/lang-impl/src/com/intellij/find/impl/FindManagerImpl.java

index d1a83f1cd3e4a199da026371facf7f5693a96017..61f52f2ea074980dc6617126003597cc4378878e 100644 (file)
@@ -22,9 +22,11 @@ package com.intellij.find;
 import com.intellij.codeInsight.highlighting.HighlightManager;
 import com.intellij.codeInsight.highlighting.HighlightManagerImpl;
 import com.intellij.featureStatistics.FeatureUsageTracker;
+import com.intellij.find.impl.FindManagerImpl;
 import com.intellij.ide.ui.LafManager;
 import com.intellij.ide.ui.UISettings;
 import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.application.ex.ApplicationManagerEx;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.ScrollType;
 import com.intellij.openapi.editor.SelectionModel;
@@ -157,8 +159,10 @@ public class EditorSearchComponent extends JPanel implements DataProvider {
     leadPanel.add(cbMatchCase);
     leadPanel.add(myCbWholeWords);
     leadPanel.add(myCbRegexp);
-    leadPanel.add(myCbInComments);
-    leadPanel.add(myCbInLiterals);
+    if (FindManagerImpl.ourHasSearchInCommentsAndLiterals) {
+      leadPanel.add(myCbInComments);
+      leadPanel.add(myCbInLiterals);
+    }
 
     cbMatchCase.setSelected(isCaseSensitive());
     myCbWholeWords.setSelected(isWholeWords());
index a4f3838459db21cbf6000a0dcde5d1e4a5b3e904..0124bd5c3335069e684bcc3b036eac15ecb11496 100644 (file)
@@ -322,13 +322,23 @@ final class FindDialog extends DialogWrapper {
 
     topOptionsPanel.add(createFindOptionsPanel());
     if (!myModel.isMultipleFiles()){
-      JPanel leftOptionsPanel = new JPanel();
-      leftOptionsPanel.setLayout(new GridLayout(3, 1, 0, 4));
-
-      leftOptionsPanel.add(createDirectionPanel());
-      leftOptionsPanel.add(createOriginPanel());
-      leftOptionsPanel.add(createScopePanel());
-      topOptionsPanel.add(leftOptionsPanel);
+      if (FindManagerImpl.ourHasSearchInCommentsAndLiterals) {
+        JPanel leftOptionsPanel = new JPanel();
+        leftOptionsPanel.setLayout(new GridLayout(3, 1, 0, 4));
+
+        leftOptionsPanel.add(createDirectionPanel());
+        leftOptionsPanel.add(createOriginPanel());
+        leftOptionsPanel.add(createScopePanel());
+        topOptionsPanel.add(leftOptionsPanel);
+      } else {
+        topOptionsPanel.add(createDirectionPanel());
+        gbConstraints.gridwidth = GridBagConstraints.RELATIVE;
+        JPanel bottomOptionsPanel = new JPanel();
+        bottomOptionsPanel.setLayout(new GridLayout(1, 2, 8, 0));
+        optionsPanel.add(bottomOptionsPanel, gbConstraints);
+        bottomOptionsPanel.add(createScopePanel());
+        bottomOptionsPanel.add(createOriginPanel());
+      }
     }
     else{
       optionsPanel.add(createGlobalScopePanel(), gbConstraints);
@@ -511,13 +521,12 @@ final class FindDialog extends DialogWrapper {
     findOptionsPanel.add(myCbRegularExpressions);
 
     myCbInCommentsOnly = createCheckbox(FindBundle.message("find.options.comments.only"));
-
-    findOptionsPanel.add(myCbInCommentsOnly);
-
     myCbInStringLiteralsOnly = createCheckbox(FindBundle.message("find.options.string.literals.only"));
 
-    findOptionsPanel.add(myCbInStringLiteralsOnly);
-
+    if (FindManagerImpl.ourHasSearchInCommentsAndLiterals) {
+      findOptionsPanel.add(myCbInCommentsOnly);
+      findOptionsPanel.add(myCbInStringLiteralsOnly);
+    }
 
     ActionListener actionListener = new ActionListener() {
       public void actionPerformed(ActionEvent e) {
index e1c101d37fa535bf26f32632acd2beca6760b6a7..84f78c39142689972171117c50d7b391d63102ac 100644 (file)
@@ -32,6 +32,7 @@ import com.intellij.openapi.actionSystem.ActionManager;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.IdeActions;
 import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.ex.ApplicationManagerEx;
 import com.intellij.openapi.components.PersistentStateComponent;
 import com.intellij.openapi.components.State;
 import com.intellij.openapi.components.Storage;
@@ -97,6 +98,7 @@ public class FindManagerImpl extends FindManager implements PersistentStateCompo
   private final MessageBus myBus;
   private static final Key<Boolean> HIGHLIGHTER_WAS_NOT_FOUND_KEY = Key.create("com.intellij.find.impl.FindManagerImpl.HighlighterNotFoundKey");
   @NonNls private static final String FIND_USAGES_MANAGER_ELEMENT = "FindUsagesManager";
+  public static final boolean ourHasSearchInCommentsAndLiterals = ApplicationManagerEx.getApplicationEx().isInternal(); // TODO: maxim
 
   public FindManagerImpl(Project project, FindSettings findSettings, UsageViewManager anotherManager, MessageBus bus) {
     myProject = project;