diff options
Diffstat (limited to 'plugins/xpath')
5 files changed, 30 insertions, 34 deletions
diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/HighlightingOutputConsole.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/HighlightingOutputConsole.java index 350973b4369d..90f088d86ad6 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/HighlightingOutputConsole.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/HighlightingOutputConsole.java @@ -29,6 +29,7 @@ import com.intellij.openapi.fileTypes.FileTypeEditorHighlighterProviders; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Disposer; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -107,6 +108,7 @@ public class HighlightingOutputConsole extends AdditionalTabComponent implements } } + @NotNull public String getTabTitle() { return TAB_TITLE; } diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunConfiguration.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunConfiguration.java index b45a08825d01..8cf2c67d4bc9 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunConfiguration.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunConfiguration.java @@ -15,7 +15,6 @@ */ package org.intellij.lang.xpath.xslt.run; -import com.intellij.diagnostic.logging.DebuggerLogConsoleManager; import com.intellij.execution.ExecutionException; import com.intellij.execution.Executor; import com.intellij.execution.configurations.*; @@ -140,32 +139,29 @@ public final class XsltRunConfiguration extends LocatableConfigurationBase imple return state; } - //invoke before run/debug tabs are shown. - //Should be overriden to add additional tabs for run/debug toolwindow @Override public void createAdditionalTabComponents(final AdditionalTabComponentManager manager, ProcessHandler startedProcess) { - if (myOutputType == OutputType.CONSOLE) { - final HighlightingOutputConsole console = new HighlightingOutputConsole(getProject(), myFileType); - - final List<XsltRunnerExtension> extensions = XsltRunnerExtension.getExtensions(this, manager instanceof DebuggerLogConsoleManager); - boolean consoleTabAdded = false; - for (XsltRunnerExtension extension : extensions) { - if (extension.createTabs(getProject(), manager, console, startedProcess)) { - consoleTabAdded = true; - } - } - if (!consoleTabAdded) { - manager.addAdditionalTabComponent(console, console.getTabTitle()); // TODO: verify parameter - } - - final OutputTabAdapter listener = new OutputTabAdapter(startedProcess, console); + if (myOutputType == OutputType.CONSOLE) { + final HighlightingOutputConsole console = new HighlightingOutputConsole(getProject(), myFileType); + + boolean consoleTabAdded = false; + for (XsltRunnerExtension extension : XsltRunnerExtension.getExtensions(this, false /* doesn't matter, xslt debugger uses own flag */)) { + if (extension.createTabs(getProject(), manager, console, startedProcess)) { + consoleTabAdded = true; + } + } + if (!consoleTabAdded) { + manager.addAdditionalTabComponent(console, console.getTabTitle()); // TODO: verify parameter + } - if (startedProcess.isStartNotified()) { - listener.startNotified(new ProcessEvent(startedProcess)); - } else { - startedProcess.addProcessListener(listener); - } + final OutputTabAdapter listener = new OutputTabAdapter(startedProcess, console); + if (startedProcess.isStartNotified()) { + listener.startNotified(new ProcessEvent(startedProcess)); + } + else { + startedProcess.addProcessListener(listener); } + } } @Override diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ShowXPathAction.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ShowXPathAction.java index 8423fe767e1a..748a7063b200 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ShowXPathAction.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ShowXPathAction.java @@ -51,7 +51,7 @@ public class ShowXPathAction extends XPathAction { super.update(event); final Presentation presentation = event.getPresentation(); - if (ActionPlaces.MAIN_MENU.equals(event.getPlace()) && presentation.getText().startsWith("Show ")) { + if (ActionPlaces.isMainMenuOrActionSearch(event.getPlace()) && presentation.getText().startsWith("Show ")) { final String text = presentation.getText().substring("Show ".length()); presentation.setText(Character.toUpperCase(text.charAt(0)) + text.substring(1)); } diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathAction.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathAction.java index 20e3597c8f2f..734ec9efe9a4 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathAction.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathAction.java @@ -41,10 +41,11 @@ public abstract class XPathAction extends AnAction { // provide icon for toolbar if (ActionPlaces.MAIN_TOOLBAR.equals(event.getPlace())) { updateToolbar(event); - } else if (ActionPlaces.MAIN_MENU.equals(event.getPlace())) { - updateMainMenu(event); - } else if (ActionPlaces.EDITOR_POPUP.equals(event.getPlace())) { - presentation.setVisible(presentation.isEnabled()); + } else if (ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) { + updateMainMenu(event); + } + else if (ActionPlaces.EDITOR_POPUP.equals(event.getPlace())) { + presentation.setVisible(presentation.isEnabled()); } } diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/SearchScope.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/SearchScope.java index 775d90280d07..4c42e86f5f58 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/SearchScope.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/SearchScope.java @@ -22,10 +22,7 @@ import com.intellij.openapi.roots.ContentIterator; import com.intellij.openapi.roots.ModuleRootManager; import com.intellij.openapi.roots.OrderEnumerator; import com.intellij.openapi.roots.ProjectRootManager; -import com.intellij.openapi.util.Condition; -import com.intellij.openapi.util.InvalidDataException; -import com.intellij.openapi.util.JDOMExternalizable; -import com.intellij.openapi.util.WriteExternalException; +import com.intellij.openapi.util.*; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; @@ -189,12 +186,12 @@ public class SearchScope implements JDOMExternalizable { switch (getScopeType()) { case PROJECT: //noinspection unchecked - ProjectRootManager.getInstance(project).getFileIndex().iterateContent(new MyFileIterator(processor, Condition.TRUE)); + ProjectRootManager.getInstance(project).getFileIndex().iterateContent(new MyFileIterator(processor, Conditions.<VirtualFile>alwaysTrue())); break; case MODULE: final Module module = ModuleManager.getInstance(project).findModuleByName(getModuleName()); //noinspection unchecked - ModuleRootManager.getInstance(module).getFileIndex().iterateContent(new MyFileIterator(processor, Condition.TRUE)); + ModuleRootManager.getInstance(module).getFileIndex().iterateContent(new MyFileIterator(processor, Conditions.<VirtualFile>alwaysTrue())); break; case DIRECTORY: final String dirName = getPath(); |