diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TypedHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TypedHandler.java index 2766197c3a00..d3912d4b71df 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TypedHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TypedHandler.java @@ -21,6 +21,7 @@ import com.intellij.codeInsight.CodeInsightSettings; import com.intellij.codeInsight.highlighting.BraceMatcher; import com.intellij.codeInsight.highlighting.BraceMatchingUtil; import com.intellij.codeInsight.highlighting.NontrivialBraceMatcher; +import com.intellij.codeInsight.template.impl.editorActions.TypedActionHandlerBase; import com.intellij.injected.editor.DocumentWindow; import com.intellij.lang.ASTNode; import com.intellij.lang.Language; @@ -61,18 +62,16 @@ import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.Map; -public class TypedHandler implements TypedActionHandler { +public class TypedHandler extends TypedActionHandlerBase { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.editorActions.TypedHandler"); - private final TypedActionHandler myOriginalHandler; - private static final Map quoteHandlers = new HashMap(); private static final Map, QuoteHandler> ourBaseLanguageQuoteHandlers = new HashMap, QuoteHandler>(); public TypedHandler(TypedActionHandler originalHandler){ - myOriginalHandler = originalHandler; + super(originalHandler); } @Nullable diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/TypedHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/TypedHandler.java index c9ee62c3ba98..c9552348013d 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/TypedHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/TypedHandler.java @@ -25,6 +25,7 @@ import com.intellij.codeInsight.editorActions.CompletionAutoPopupHandler; import com.intellij.codeInsight.lookup.CharFilter; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupManager; +import com.intellij.codeInsight.template.impl.editorActions.TypedActionHandlerBase; import com.intellij.featureStatistics.FeatureUsageTracker; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.editor.Document; @@ -38,12 +39,11 @@ import org.jetbrains.annotations.Nullable; import java.util.Arrays; -public class TypedHandler implements TypedActionHandler { - private final TypedActionHandler myOriginalHandler; +public class TypedHandler extends TypedActionHandlerBase { private static boolean inside = false; public TypedHandler(TypedActionHandler originalHandler){ - myOriginalHandler = originalHandler; + super(originalHandler); } public void execute(@NotNull final Editor editor, final char charTyped, @NotNull final DataContext dataContext){ @@ -52,7 +52,7 @@ public class TypedHandler implements TypedActionHandler { try { final LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(editor); if (lookup == null){ - myOriginalHandler.execute(editor, charTyped, dataContext); + if (myOriginalHandler != null) myOriginalHandler.execute(editor, charTyped, dataContext); return; } @@ -100,7 +100,7 @@ public class TypedHandler implements TypedActionHandler { } lookup.hide(); - myOriginalHandler.execute(editor, charTyped, dataContext); + if (myOriginalHandler != null) myOriginalHandler.execute(editor, charTyped, dataContext); } finally { inside = false; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java index 91a11bdad166..06dd0747e39b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java @@ -17,8 +17,9 @@ package com.intellij.codeInsight.navigation; import com.intellij.codeInsight.CodeInsightBundle; -import com.intellij.codeInsight.hint.HintUtil; import com.intellij.codeInsight.hint.HintManagerImpl; +import com.intellij.codeInsight.hint.HintUtil; +import com.intellij.codeInsight.template.impl.editorActions.TypedActionHandlerBase; import com.intellij.featureStatistics.FeatureUsageTracker; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.actionSystem.IdeActions; @@ -45,6 +46,7 @@ import com.intellij.util.text.StringSearcher; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; @@ -343,17 +345,15 @@ public class IncrementalSearchHandler { } } - public static class MyTypedHandler implements TypedActionHandler { - private final TypedActionHandler myOriginalHandler; - - public MyTypedHandler(TypedActionHandler originalAction) { - myOriginalHandler = originalAction; + public static class MyTypedHandler extends TypedActionHandlerBase { + public MyTypedHandler(@Nullable TypedActionHandler originalHandler) { + super(originalHandler); } public void execute(@NotNull Editor editor, char charTyped, @NotNull DataContext dataContext) { PerEditorSearchData data = editor.getUserData(SEARCH_DATA_IN_EDITOR_VIEW_KEY); if (data == null || data.hint == null){ - myOriginalHandler.execute(editor, charTyped, dataContext); + if (myOriginalHandler != null) myOriginalHandler.execute(editor, charTyped, dataContext); } else{ LightweightHint hint = data.hint; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/SpaceHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/SpaceHandler.java index 532052ae3978..5b81d9acc6ca 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/SpaceHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/SpaceHandler.java @@ -16,37 +16,36 @@ package com.intellij.codeInsight.template.impl.editorActions; -import com.intellij.openapi.editor.actionSystem.TypedActionHandler; -import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.actionSystem.DataContext; -import com.intellij.openapi.actionSystem.PlatformDataKeys; -import com.intellij.openapi.project.Project; +import com.intellij.codeInsight.template.TemplateManager; import com.intellij.codeInsight.template.impl.TemplateManagerImpl; import com.intellij.codeInsight.template.impl.TemplateSettings; +import com.intellij.openapi.actionSystem.DataContext; +import com.intellij.openapi.actionSystem.PlatformDataKeys; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.editor.actionSystem.TypedActionHandler; +import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; -public class SpaceHandler implements TypedActionHandler { - private final TypedActionHandler myOriginalHandler; - +public class SpaceHandler extends TypedActionHandlerBase { public SpaceHandler(TypedActionHandler originalHandler) { - myOriginalHandler = originalHandler; + super(originalHandler); } public void execute(@NotNull Editor editor, char charTyped, @NotNull DataContext dataContext) { if (charTyped != ' ') { - myOriginalHandler.execute(editor, charTyped, dataContext); + if (myOriginalHandler != null) myOriginalHandler.execute(editor, charTyped, dataContext); return; } Project project = PlatformDataKeys.PROJECT.getData(dataContext); if (project == null) { - myOriginalHandler.execute(editor, charTyped, dataContext); + if (myOriginalHandler != null) myOriginalHandler.execute(editor, charTyped, dataContext); return; } - TemplateManagerImpl templateManager = (TemplateManagerImpl) TemplateManagerImpl.getInstance(project); + TemplateManagerImpl templateManager = (TemplateManagerImpl)TemplateManager.getInstance(project); if (!templateManager.startTemplate(editor, TemplateSettings.SPACE_CHAR)) { - myOriginalHandler.execute(editor, charTyped, dataContext); + if (myOriginalHandler != null) myOriginalHandler.execute(editor, charTyped, dataContext); } } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/TypedActionHandlerBase.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/TypedActionHandlerBase.java new file mode 100644 index 000000000000..aa932ce6711e --- /dev/null +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/TypedActionHandlerBase.java @@ -0,0 +1,28 @@ +/* + * Copyright 2000-2011 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.intellij.codeInsight.template.impl.editorActions; + +import com.intellij.openapi.editor.actionSystem.TypedActionHandler; +import org.jetbrains.annotations.Nullable; + +public abstract class TypedActionHandlerBase implements TypedActionHandler { + @Nullable protected final TypedActionHandler myOriginalHandler; + + public TypedActionHandlerBase(@Nullable TypedActionHandler originalHandler) { + myOriginalHandler = originalHandler; + } +} diff --git a/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java b/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java index de97746dcd77..569747269246 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java @@ -17,6 +17,7 @@ package com.intellij.execution.impl; import com.intellij.codeInsight.navigation.IncrementalSearchHandler; +import com.intellij.codeInsight.template.impl.editorActions.TypedActionHandlerBase; import com.intellij.execution.ConsoleFolding; import com.intellij.execution.ExecutionBundle; import com.intellij.execution.actions.ConsoleActionsPostProcessor; @@ -1000,17 +1001,16 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo return myTokens.size(); } - private static class MyTypedHandler implements TypedActionHandler { - private final TypedActionHandler myOriginalHandler; + private static class MyTypedHandler extends TypedActionHandlerBase { private MyTypedHandler(final TypedActionHandler originalAction) { - myOriginalHandler = originalAction; + super(originalAction); } public void execute(@NotNull final Editor editor, final char charTyped, @NotNull final DataContext dataContext) { final ConsoleViewImpl consoleView = editor.getUserData(CONSOLE_VIEW_IN_EDITOR_VIEW); if (consoleView == null || !consoleView.myState.isRunning() || consoleView.isViewer) { - myOriginalHandler.execute(editor, charTyped, dataContext); + if (myOriginalHandler != null) myOriginalHandler.execute(editor, charTyped, dataContext); } else { final String s = String.valueOf(charTyped); diff --git a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java index f2fa60f6d658..3d8f597f2f34 100644 --- a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java +++ b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java @@ -1078,6 +1078,21 @@ public class FileUtil { return found; } + @NotNull + public static List findFilesOrDirsByMask(@NotNull Pattern pattern, @NotNull File dir) { + final ArrayList found = new ArrayList(); + for (File file : dir.listFiles()) { + if (file.isDirectory()) { + found.addAll(findFilesOrDirsByMask(pattern, file)); + } + + if (pattern.matcher(file.getName()).matches()) { + found.add(file); + } + } + return found; + } + /** * Returns empty string for empty path. * First checks whether provided path is a path of a file with sought-for name. diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java index 941243d0edea..97b1d30b3d0e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java @@ -202,9 +202,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec synchronized (myDataLock) { listCopy = getChangeListsCopy(); } - if (! listCopy.isEmpty()) { - myProject.getMessageBus().syncPublisher(LISTS_LOADED).processLoadedLists(listCopy); - } + myProject.getMessageBus().syncPublisher(LISTS_LOADED).processLoadedLists(listCopy); } private void initializeForNewProject() { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java index 74b12112475b..615b62120a17 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java @@ -99,6 +99,7 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro // todo group somewhere private JPanel myNoDetailsPanel; private JPanel myNothingSelected; + private JPanel myNotLoadedYet; private boolean myDetailsOn; private ChangesViewManager.MyFileListener myFileListener; private final SLRUMap> myDetailsCache; @@ -106,6 +107,8 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro private final MyDocumentListener myDocumentListener; private ZipperUpdater myDetailsUpdater; private Runnable myUpdateDetails; + private MessageBusConnection myConnection; + private ChangesViewManager.ToggleDetailsAction myToggleDetailsAction; public static ChangesViewI getInstance(Project project) { return PeriodicalTasksCloser.getInstance().safeGetComponent(project, ChangesViewI.class); @@ -118,6 +121,7 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro myView = new ChangesListView(project); myNoDetailsPanel = VcsChangeDetailsManager.errorPanel("No details available", false); myNothingSelected = VcsChangeDetailsManager.errorPanel("Nothing selected", false); + myNotLoadedYet = VcsChangeDetailsManager.errorPanel("Changes content is not loaded yet", false); Disposer.register(project, myView); myRepaintAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD, project); @@ -154,8 +158,8 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro myContentManager.addContent(content); scheduleRefresh(); - final MessageBusConnection connection = myProject.getMessageBus().connect(myProject); - connection.subscribe(RemoteRevisionsCache.REMOTE_VERSION_CHANGED, new Runnable() { + myConnection = myProject.getMessageBus().connect(myProject); + myConnection.subscribe(RemoteRevisionsCache.REMOTE_VERSION_CHANGED, new Runnable() { public void run() { ApplicationManager.getApplication().invokeLater(new Runnable() { public void run() { @@ -167,6 +171,7 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro } public void projectClosed() { + myConnection.disconnect(); myDetailsCache.clear(); myDisposed = true; myRepaintAlarm.cancelAllRequests(); @@ -210,7 +215,8 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro visualActionsGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_COPY)); visualActionsGroup.add(new ToggleShowIgnoredAction()); visualActionsGroup.add(new IgnoredSettingsAction()); - visualActionsGroup.add(new ToggleDetailsAction()); + myToggleDetailsAction = new ToggleDetailsAction(); + visualActionsGroup.add(myToggleDetailsAction); visualActionsGroup.add(new ContextHelpAction(ChangesListView.ourHelpId)); toolbarPanel.add(createToolbarComponent(visualActionsGroup), BorderLayout.CENTER); @@ -257,6 +263,12 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro Pair details = null; FilePath filePath = null; for (Change change : selectedChanges) { + if (change.getBeforeRevision() instanceof FakeRevision || change.getAfterRevision() instanceof FakeRevision) { + mySplitter.setSecondComponent(myNotLoadedYet); + mySplitter.revalidate(); + mySplitter.repaint(); + return; + } filePath = ChangesUtil.getFilePath(change); details = myDetailsCache.get(filePath); if (details != null) break; diff --git a/plugins/devkit/src/run/PluginRunConfiguration.java b/plugins/devkit/src/run/PluginRunConfiguration.java index 4b0d6a7e0072..9dff21bb8474 100644 --- a/plugins/devkit/src/run/PluginRunConfiguration.java +++ b/plugins/devkit/src/run/PluginRunConfiguration.java @@ -110,15 +110,7 @@ public class PluginRunConfiguration extends RunConfigurationBase implements Modu fillParameterList(vm, VM_PARAMETERS); fillParameterList(params.getProgramParametersList(), PROGRAM_PARAMETERS); - if (!VM_PARAMETERS.contains("-Xms")) { - vm.add("-Xms128m"); - } - if (!VM_PARAMETERS.contains("-Xmx")) { - vm.add("-Xmx512m"); - } - if (!VM_PARAMETERS.contains("-XX:MaxPermSize")) { - vm.add("-XX:MaxPermSize=250m"); - } + @NonNls String libPath = ideaJdk.getHomePath() + File.separator + "lib"; vm.add("-Xbootclasspath/a:" + libPath + File.separator + "boot.jar"); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java index 2af01498dfab..9dfe90ff0bd9 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java @@ -274,6 +274,7 @@ public class SvnVcs extends AbstractVcs { final MessageBusConnection connection = bus.connect(); connection.subscribe(ChangeListManagerImpl.LISTS_LOADED, new LocalChangeListsLoadedListener() { public void processLoadedLists(final List lists) { + if (lists.isEmpty()) return; SvnConfiguration.SvnSupportOptions supportOptions = null; try { ChangeListManager.getInstance(myProject).setReadOnly(SvnChangeProvider.ourDefaultListName, true); diff --git a/resources/src/idea/RunManager.xml b/resources/src/idea/RunManager.xml index c78566298d1f..2e036187e6c8 100644 --- a/resources/src/idea/RunManager.xml +++ b/resources/src/idea/RunManager.xml @@ -22,7 +22,7 @@ @@ -34,6 +34,10 @@