diff --git a/platform/lang-impl/src/com/intellij/execution/ProgramRunnerUtil.java b/platform/lang-impl/src/com/intellij/execution/ProgramRunnerUtil.java index f974986590be..61e535774ca6 100644 --- a/platform/lang-impl/src/com/intellij/execution/ProgramRunnerUtil.java +++ b/platform/lang-impl/src/com/intellij/execution/ProgramRunnerUtil.java @@ -48,7 +48,7 @@ public class ProgramRunnerUtil { } public static void executeConfiguration(@NotNull final Project project, @NotNull final RunnerAndConfigurationSettings configuration, - @NotNull final Executor executor) { + @NotNull final Executor executor, final boolean showSettings) { ProgramRunner runner = getRunner(executor.getId(), configuration); if (runner == null) { LOG.error("Runner MUST not be null! Cannot find runner for " + executor.getId() + " and " + configuration.getConfiguration().getFactory().getName()); @@ -58,7 +58,7 @@ public class ProgramRunnerUtil { return; } - if (!RunManagerImpl.canRunConfiguration(configuration, executor) || RunManagerImpl.isEditBeforeRun(configuration)) { + if (!RunManagerImpl.canRunConfiguration(configuration, executor) || (showSettings && RunManagerImpl.isEditBeforeRun(configuration))) { final boolean result = RunDialog.editConfiguration(project, configuration, "Edit configuration", executor.getActionName(), executor.getIcon()); if (!result) { return; @@ -84,6 +84,11 @@ public class ProgramRunnerUtil { } } + public static void executeConfiguration(@NotNull final Project project, @NotNull final RunnerAndConfigurationSettings configuration, + @NotNull final Executor executor) { + executeConfiguration(project, configuration, executor, true); + } + public static Icon getConfigurationIcon(final Project project, final RunnerAndConfigurationSettings settings, final boolean invalid) { final RunManager runManager = RunManager.getInstance(project); return getConfigurationIcon(settings, invalid, runManager.isTemporary(settings.getConfiguration())); diff --git a/platform/lang-impl/src/com/intellij/execution/actions/ChooseRunConfigurationAction.java b/platform/lang-impl/src/com/intellij/execution/actions/ChooseRunConfigurationAction.java index b8beb5b94ec6..95485e768ff4 100644 --- a/platform/lang-impl/src/com/intellij/execution/actions/ChooseRunConfigurationAction.java +++ b/platform/lang-impl/src/com/intellij/execution/actions/ChooseRunConfigurationAction.java @@ -220,7 +220,7 @@ public class ChooseRunConfigurationAction extends AnAction { PropertiesComponent.getInstance().setValue("run.configuration.edit.ad", Boolean.toString(true)); if (RunDialog.editConfiguration(project, configuration, "Edit configuration settings", executor.getActionName(), executor.getIcon())) { RunManagerEx.getInstanceEx(project).setSelectedConfiguration(configuration); - ProgramRunnerUtil.executeConfiguration(project, configuration, executor); + ProgramRunnerUtil.executeConfiguration(project, configuration, executor, false); } } diff --git a/platform/lang-impl/src/com/intellij/ide/util/MemberChooser.java b/platform/lang-impl/src/com/intellij/ide/util/MemberChooser.java index 1e68dc68ca00..8b7cdc07aad5 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/MemberChooser.java +++ b/platform/lang-impl/src/com/intellij/ide/util/MemberChooser.java @@ -300,7 +300,9 @@ public class MemberChooser extends DialogWrapper implemen final TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(myTree, new Convertor() { @Nullable public String convert(TreePath path) { - final MemberChooserObject delegate = ((ElementNode)path.getLastPathComponent()).getDelegate(); + final ElementNode lastPathComponent = (ElementNode)path.getLastPathComponent(); + if (lastPathComponent == null) return null; + final MemberChooserObject delegate = lastPathComponent.getDelegate(); return delegate.getText(); } }); diff --git a/platform/platform-api/src/com/intellij/openapi/ui/NamedItemsListEditor.java b/platform/platform-api/src/com/intellij/openapi/ui/NamedItemsListEditor.java index 19d51954a087..a31e681be63d 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/NamedItemsListEditor.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/NamedItemsListEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2010 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,15 @@ public abstract class NamedItemsListEditor extends MasterDetailsComponent { Cloner cloner, Equality comparer, List items) { + this(namer, factory, cloner, comparer, items, true); + } + + protected NamedItemsListEditor(Namer namer, + Factory factory, + Cloner cloner, + Equality comparer, + List items, + boolean initInConstructor) { myNamer = namer; myFactory = factory; myCloner = cloner; @@ -62,9 +71,10 @@ public abstract class NamedItemsListEditor extends MasterDetailsComponent { myOriginalItems = items; myResultItems = items; - reset(); - - initTree(); + if (initInConstructor) { + reset(); + initTree(); + } } public void reset() { diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java index 5ebf68925382..419124118200 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java @@ -1207,6 +1207,8 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat return; } + if (IdeFocusManager.getInstance(null).isFocusBeingTransferred()) return; + final int lastEventCount = myLastTimePerformed; myLastTimePerformed = ActivityTracker.getInstance().getCount(); @@ -1230,18 +1232,14 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat private void notifyListeners(final List timerListeners, final Set notified) { final TimerListener[] listeners = timerListeners.toArray(new TimerListener[timerListeners.size()]); - IdeFocusManager.getInstance(null).doWhenFocusSettlesDown(new Runnable() { - public void run() { - for (TimerListener listener : listeners) { - if (timerListeners.contains(listener)) { - if (!notified.contains(listener)) { - notified.add(listener); - runListenerAction(listener); - } - } + for (TimerListener listener : listeners) { + if (timerListeners.contains(listener)) { + if (!notified.contains(listener)) { + notified.add(listener); + runListenerAction(listener); } } - }); + } } private void runListenerAction(final TimerListener listener) { diff --git a/platform/platform-impl/src/com/intellij/openapi/diff/impl/external/CompositeDiffTool.java b/platform/platform-impl/src/com/intellij/openapi/diff/impl/external/CompositeDiffTool.java index 58b430f4247f..851a9d06b290 100644 --- a/platform/platform-impl/src/com/intellij/openapi/diff/impl/external/CompositeDiffTool.java +++ b/platform/platform-impl/src/com/intellij/openapi/diff/impl/external/CompositeDiffTool.java @@ -56,7 +56,7 @@ class CompositeDiffTool implements DiffTool { private static void checkDiffData(@NotNull DiffRequest data) { DiffContent[] contents = data.getContents(); for (DiffContent content : contents) { - LOG.assertTrue(content != null); + LOG.assertTrue(content != null, "Null content in diff request"); } } } diff --git a/platform/platform-resources/src/idea/Keymap_Eclipse.xml b/platform/platform-resources/src/idea/Keymap_Eclipse.xml index 6f749a03b42b..58bb8d87dbce 100644 --- a/platform/platform-resources/src/idea/Keymap_Eclipse.xml +++ b/platform/platform-resources/src/idea/Keymap_Eclipse.xml @@ -65,6 +65,7 @@ + diff --git a/plugins/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxSymbolIndex.java b/plugins/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxSymbolIndex.java index 2f198f753b72..5b0797666832 100644 --- a/plugins/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxSymbolIndex.java +++ b/plugins/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxSymbolIndex.java @@ -88,7 +88,7 @@ public class RelaxSymbolIndex extends ScalarIndexExtension { attributeHandler = new NanoXmlUtil.IXMLBuilderAdapter() { @Override public void addAttribute(String key, String nsPrefix, String nsURI, String value, String type) throws Exception { - if ("name".equals(key) && (nsURI == null || nsURI.length() == 0)) { + if ("name".equals(key) && (nsURI == null || nsURI.length() == 0) && value != null) { map.put(value, null); } } @@ -112,7 +112,10 @@ public class RelaxSymbolIndex extends ScalarIndexExtension { grammar.acceptChildren(new CommonElement.Visitor() { @Override public void visitDefine(Define define) { - map.put(define.getName(), null); + final String name = define.getName(); + if (name != null) { + map.put(name, null); + } } }); } diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/actions/PreviewFormAction.java b/plugins/ui-designer/src/com/intellij/uiDesigner/actions/PreviewFormAction.java index 388dcb62e816..23697196e7b8 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/actions/PreviewFormAction.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/actions/PreviewFormAction.java @@ -29,7 +29,6 @@ import com.intellij.lang.properties.PropertiesReferenceManager; import com.intellij.lang.properties.psi.PropertiesFile; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.compiler.CompileContext; import com.intellij.openapi.compiler.CompileStatusNotification; @@ -87,7 +86,7 @@ public final class PreviewFormAction extends AnAction{ public void actionPerformed(final AnActionEvent e) { final GuiEditor editor = FormEditingUtil.getActiveEditor(e.getDataContext()); if (editor != null) { - showPreviewFrame(editor.getModule(), editor.getFile(), e.getDataContext(), editor.getStringDescriptorLocale()); + showPreviewFrame(editor.getModule(), editor.getFile(), editor.getStringDescriptorLocale()); } } @@ -107,7 +106,7 @@ public final class PreviewFormAction extends AnAction{ } private static void showPreviewFrame(@NotNull final Module module, @NotNull final VirtualFile formFile, - final DataContext dataContext, @Nullable final Locale stringDescriptorLocale) { + @Nullable final Locale stringDescriptorLocale) { final String tempPath; try { final File tempDirectory = FileUtil.createTempDirectory("FormPreview", ""); @@ -222,21 +221,24 @@ public final class PreviewFormAction extends AnAction{ for(String bundleName: bundleSet) { for(PropertiesFile propFile: manager.findPropertiesFiles(module, bundleName)) { virtualFiles.add(propFile.getVirtualFile()); - modules.add(ModuleUtil.findModuleForFile(propFile.getVirtualFile(), module.getProject())); + final Module moduleForFile = ModuleUtil.findModuleForFile(propFile.getVirtualFile(), module.getProject()); + if (moduleForFile != null) { + modules.add(moduleForFile); + } } } - FileSetCompileScope scope = new FileSetCompileScope(virtualFiles, modules.toArray(new Module[]{})); + FileSetCompileScope scope = new FileSetCompileScope(virtualFiles, modules.toArray(new Module[modules.size()])); CompilerManager.getInstance(module.getProject()).make(scope, new CompileStatusNotification() { public void finished(boolean aborted, int errors, int warnings, final CompileContext compileContext) { if (!aborted && errors == 0) { - runPreviewProcess(tempPath, sources, module, formFile, dataContext, stringDescriptorLocale); + runPreviewProcess(tempPath, sources, module, formFile, stringDescriptorLocale); } } }); } else { - runPreviewProcess(tempPath, sources, module, formFile, dataContext, stringDescriptorLocale); + runPreviewProcess(tempPath, sources, module, formFile, stringDescriptorLocale); } } @@ -259,7 +261,7 @@ public final class PreviewFormAction extends AnAction{ } private static void runPreviewProcess(final String tempPath, final PathsList sources, final Module module, final VirtualFile formFile, - final DataContext dataContext, @Nullable final Locale stringDescriptorLocale) { + @Nullable final Locale stringDescriptorLocale) { // 3. Now we are ready to launch Java process final JavaParameters parameters = new JavaParameters(); parameters.getClassPath().add(tempPath); diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/componentTree/ComponentTree.java b/plugins/ui-designer/src/com/intellij/uiDesigner/componentTree/ComponentTree.java index 5f5d7b40226e..462a50121e48 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/componentTree/ComponentTree.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/componentTree/ComponentTree.java @@ -216,8 +216,7 @@ public final class ComponentTree extends Tree implements DataProvider { final ArrayList result = new ArrayList(paths.length); for (TreePath path : paths) { final DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent(); - LOG.assertTrue(node != null); - if (node.getUserObject() instanceof ComponentPtrDescriptor) { + if (node != null && node.getUserObject() instanceof ComponentPtrDescriptor) { final ComponentPtrDescriptor descriptor = (ComponentPtrDescriptor)node.getUserObject(); final ComponentPtr ptr = descriptor.getElement(); if (ptr != null && ptr.isValid()) { diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/componentTree/ComponentTreeStructure.java b/plugins/ui-designer/src/com/intellij/uiDesigner/componentTree/ComponentTreeStructure.java index 4ef7b4424250..a7b0d9124234 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/componentTree/ComponentTreeStructure.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/componentTree/ComponentTreeStructure.java @@ -42,7 +42,12 @@ final class ComponentTreeStructure extends AbstractTreeStructure{ private final GuiEditor myEditor; public ComponentTreeStructure(@NotNull final GuiEditor editor){ - myRootElement=new Object(); + myRootElement=new Object() { + @Override + public String toString() { + return "root of component tree structure " + ComponentTreeStructure.this.toString(); + } + }; myEditor=editor; } diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltSymbolIndex.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltSymbolIndex.java index a6f7a518c616..0619a641db7b 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltSymbolIndex.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltSymbolIndex.java @@ -181,7 +181,7 @@ public class XsltSymbolIndex extends FileBasedIndexExtension