diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/CompileContext.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/CompileContext.java index e39512e334f1..b2b4b95ac98e 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/CompileContext.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/CompileContext.java @@ -268,6 +268,10 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler myDelegateMessageHandler.processMessage(msg); } + public boolean errorsDetected() { + return myErrorsFound; + } + public void processFilesToRecompile(ModuleChunk chunk, FileProcessor processor) throws IOException { for (Module module : chunk.getModules()) { myFsState.processFilesToRecompile(this, module, processor); diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleLevelBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleLevelBuilder.java index 099eb993c267..d503e83bff8e 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleLevelBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleLevelBuilder.java @@ -56,6 +56,9 @@ public abstract class ModuleLevelBuilder extends Builder { * @throws Exception */ public final boolean updateMappings(CompileContext context, final Mappings delta, ModuleChunk chunk, Collection filesToCompile, Collection successfullyCompiled) throws IOException { + if (context.errorsDetected()) { + return false; + } try { boolean additionalPassRequired = false; diff --git a/platform/core-impl/src/com/intellij/openapi/editor/impl/CharArray.java b/platform/core-impl/src/com/intellij/openapi/editor/impl/CharArray.java index 08c65c2ac35f..437c4edac2a9 100644 --- a/platform/core-impl/src/com/intellij/openapi/editor/impl/CharArray.java +++ b/platform/core-impl/src/com/intellij/openapi/editor/impl/CharArray.java @@ -44,7 +44,7 @@ abstract class CharArray implements CharSequenceBackedByArray { private static final boolean DISABLE_DEFERRED_PROCESSING = Boolean.getBoolean("idea.document.deny.deferred.changes"); @SuppressWarnings("UseOfArchaicSystemPropertyAccessors") - private static final boolean DEBUG_DEFERRED_PROCESSING = LOG.isDebugEnabled() || Boolean.getBoolean("idea.document.debug.bulk.processing") || DocumentImpl.CHECK_DOCUMENT_CONSISTENCY; + private static final boolean DEBUG_DEFERRED_PROCESSING = LOG.isDebugEnabled() || Boolean.getBoolean("idea.document.debug.bulk.processing"); /** * We can't exclude possibility of situation when 'defer changes' state is {@link #setDeferredChangeMode(boolean) entered} * but not exited, hence, we want to perform automatic flushing if necessary in order to avoid memory leaks. This constant holds @@ -75,7 +75,7 @@ abstract class CharArray implements CharSequenceBackedByArray { private final boolean myDebug = isDebug(); boolean isDebug() { - return DEBUG_DEFERRED_PROCESSING; + return DEBUG_DEFERRED_PROCESSING || DocumentImpl.CHECK_DOCUMENT_CONSISTENCY; } /** @@ -180,6 +180,8 @@ abstract class CharArray implements CharSequenceBackedByArray { } private void assertConsistency() { + if (!myDebug) return; + if (isDeferredChangeMode()) { assert myOriginalSequence == null; } @@ -187,45 +189,48 @@ abstract class CharArray implements CharSequenceBackedByArray { int origLen = originalSequence == null ? -1 : originalSequence.length(); String string = myStringRef == null ? null : myStringRef.get(); int stringLen = string == null ? -1 : string.length(); - char[] array = myArray; assert origLen == stringLen || origLen==-1 || stringLen==-1; int count = myCount + myDeferredShift; assert count == origLen || origLen==-1; assert count == stringLen || stringLen==-1; - if (array != null) { - assert myCount <= array.length; + final String stringFromCharArray; + + if (myArray != null) { + assert myCount <= myArray.length; + stringFromCharArray = new String(myArray, myStart, myCount); + } else { + stringFromCharArray = null; } - if (myDebug) { - if (array != null && originalSequence != null) { - assert new String(array, myStart, myCount).equals(originalSequence); - } - if (!isDeferredChangeMode() && array != null && string != null) { - assert new String(array, myStart, myCount).equals(string); - } - if (originalSequence != null && string != null) { - assert string.equals(originalSequence.toString()); - } - myDebugArray.assertConsistency(); + if (stringFromCharArray != null && originalSequence != null) { + assert stringFromCharArray.equals(originalSequence); + } + if (!isDeferredChangeMode() && stringFromCharArray != null && string != null) { + assert stringFromCharArray.equals(string); + } + if (originalSequence != null && string != null) { + assert string.equals(originalSequence.toString()); + } - String str = myStringRef == null ? null : myStringRef.get(); - if (str == null) { - if (hasDeferredChanges()) { - str = doSubString(0, myCount + myDeferredShift).toString(); - } - else if (myOriginalSequence != null) { - str = myOriginalSequence.toString(); - } - else { - str = new String(myArray, myStart, myCount); - } + myDebugArray.assertConsistency(); + + String str = myStringRef == null ? null : myStringRef.get(); + if (str == null) { + if (hasDeferredChanges()) { + str = doSubString(0, myCount + myDeferredShift).toString(); } - assert count == str.length(); - if (isDeferredChangeMode()) { - String expected = myDebugArray.toString(); - checkStrings("toString()", expected, str); + else if (myOriginalSequence != null) { + str = myOriginalSequence.toString(); } + else { + str = stringFromCharArray; + } + } + assert count == str.length(); + if (isDeferredChangeMode()) { + String expected = myDebugArray.toString(); + checkStrings("toString()", expected, str); } } diff --git a/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java b/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java index 62fbff7a3740..c3c45db3336f 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java +++ b/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java @@ -135,7 +135,7 @@ public class FileStructurePopup implements Disposable { else { myTreeActionsOwner = null; myTreeModel = structureViewModel; - } + } myTreeStructure = new SmartTreeStructure(project, myTreeModel){ public void rebuildTree() { @@ -233,7 +233,7 @@ public class FileStructurePopup implements Disposable { } }) .createPopup(); - + myTree.addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(TreeSelectionEvent e) { @@ -255,6 +255,7 @@ public class FileStructurePopup implements Disposable { } } }); + myTree.getEmptyText().setText("Loading..."); final Point location = DimensionService.getInstance().getLocation(getDimensionServiceKey(), myProject); if (location != null) { myPopup.showInScreenCoordinates(myEditor.getContentComponent(), location); @@ -267,29 +268,24 @@ public class FileStructurePopup implements Disposable { myPopup.setSize(new Dimension(myPreferredWidth + 10, myPopup.getSize().height)); } - //final long cur = System.currentTimeMillis(); - final Runnable expandIsDone = new Runnable() { + IdeFocusManager.getInstance(myProject).requestFocus(myTree, true); + myAbstractTreeBuilder.queueUpdate().doWhenDone(new Runnable() { @Override public void run() { - //System.out.println(System.currentTimeMillis() - cur); - IdeFocusManager.getInstance(myProject).requestFocus(myTree, true); - myAbstractTreeBuilder.queueUpdate().doWhenDone(new Runnable() { - @Override + myTreeHasBuilt.setDone(); + ApplicationManager.getApplication().invokeLater(new Runnable() { public void run() { - selectPsiElement(myInitialPsiElement); - myTreeHasBuilt.setDone(); - //long t = System.currentTimeMillis() - time; - //System.out.println("Shown in " + t + "ms"); + myFilteringStructure.rebuild(); + myAbstractTreeBuilder.queueUpdate(true).doWhenDone(new Runnable() { + @Override + public void run() { + selectPsiElement(myInitialPsiElement); + } + }); } }); } - }; - - //if (myTree.isAlwaysExpanded() || true) { - expandIsDone.run(); - //} else { - // myAbstractTreeBuilder.expandAll(expandIsDone); - //} + }); if (!ApplicationManager.getApplication().isUnitTestMode()) { final Alarm alarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD, myPopup); @@ -457,11 +453,11 @@ public class FileStructurePopup implements Disposable { } } }.registerCustomShortcutSet(CustomShortcutSet.fromString("ESCAPE"), myTree); - + myTree.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { - if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1) { + if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1) { navigateSelectedElement(); } } @@ -497,7 +493,7 @@ public class FileStructurePopup implements Disposable { return null; } }); - myFilteringStructure.rebuild(); + return panel; } @@ -566,7 +562,7 @@ public class FileStructurePopup implements Disposable { private void addCheckbox(final JPanel panel, final TreeAction action) { String text = action instanceof FileStructureFilter ? ((FileStructureFilter)action).getCheckBoxText() : - action instanceof FileStructureNodeProvider ? ((FileStructureNodeProvider)action).getCheckBoxText() : null; + action instanceof FileStructureNodeProvider ? ((FileStructureNodeProvider)action).getCheckBoxText() : null; if (text == null) return; @@ -574,7 +570,7 @@ public class FileStructurePopup implements Disposable { ((FileStructureFilter)action).getShortcut() : ((FileStructureNodeProvider)action).getShortcut(); - + final JCheckBox chkFilter = new JCheckBox(); final boolean selected = getDefaultValue(action); chkFilter.setSelected(selected); @@ -592,7 +588,7 @@ public class FileStructurePopup implements Disposable { } myTreeStructure.rebuildTree(); myFilteringStructure.rebuild(); - + final Object sel = selection; final Runnable runnable = new Runnable() { public void run() { @@ -745,8 +741,8 @@ public class FileStructurePopup implements Disposable { } else { return false; } - - } + + } return true; } diff --git a/platform/platform-api/src/com/intellij/ide/ui/UISettings.java b/platform/platform-api/src/com/intellij/ide/ui/UISettings.java index c25837f09326..00facabfd373 100644 --- a/platform/platform-api/src/com/intellij/ide/ui/UISettings.java +++ b/platform/platform-api/src/com/intellij/ide/ui/UISettings.java @@ -300,7 +300,7 @@ public class UISettings implements PersistentStateComponent, Exporta UISettings uiSettings=getInstance(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF); - GraphicsUtil.setupAntialiasing(g2d, uiSettings == null || uiSettings.ANTIALIASING_IN_EDITOR); + GraphicsUtil.setupAntialiasing(g2d, uiSettings == null || uiSettings.ANTIALIASING_IN_EDITOR, true); } /** diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowHeader.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowHeader.java index 00988b058f35..f400145531e6 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowHeader.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowHeader.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/content/ToolWindowContentUi.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/content/ToolWindowContentUi.java index 5e7d5534e91f..460b3ffe3810 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/content/ToolWindowContentUi.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/content/ToolWindowContentUi.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -303,16 +303,22 @@ public class ToolWindowContentUi extends JPanel implements ContentUI, PropertyCh }); c.addMouseListener(new MouseAdapter() { - public void mouseReleased(final MouseEvent e) { + public void mousePressed(final MouseEvent e) { myLastPoint[0] = e.getPoint(); SwingUtilities.convertPointToScreen(myLastPoint[0], c); + if (!e.isPopupTrigger()) { + if (!UIUtil.isCloseClick(e)) { + ui.myWindow.fireActivated(); + } + } + } + + @Override + public void mouseReleased(MouseEvent e) { if (!e.isPopupTrigger()) { if (UIUtil.isCloseClick(e, MouseEvent.MOUSE_RELEASED)) { ui.processHide(e); } - else { - ui.myWindow.fireActivated(); - } } } }); diff --git a/platform/platform-resources-en/src/misc/registry.properties b/platform/platform-resources-en/src/misc/registry.properties index aff3e62f4693..bef41869798c 100644 --- a/platform/platform-resources-en/src/misc/registry.properties +++ b/platform/platform-resources-en/src/misc/registry.properties @@ -200,4 +200,6 @@ editor.dumb.mode.available=true enable.animation.on.dialogs=false vcs.remote.management.ready=false type.ahead.logging.enabled=false -fast.tree.expand.in.structure.view=false \ No newline at end of file +fast.tree.expand.in.structure.view=false + +python.exported.names.local.cache=false diff --git a/platform/util/src/com/intellij/util/ui/GraphicsUtil.java b/platform/util/src/com/intellij/util/ui/GraphicsUtil.java index 5b7e74947dad..560b5decae5a 100644 --- a/platform/util/src/com/intellij/util/ui/GraphicsUtil.java +++ b/platform/util/src/com/intellij/util/ui/GraphicsUtil.java @@ -25,21 +25,21 @@ import java.util.Map; */ public class GraphicsUtil { public static void setupAntialiasing(@NotNull Graphics g2) { - setupAntialiasing(g2, true); + setupAntialiasing(g2, true, false); } - public static void setupAntialiasing(Graphics g2, boolean enable) { + public static void setupAntialiasing(Graphics g2, boolean enableAA, boolean ignoreSystemSettings) { if (g2 instanceof Graphics2D) { Graphics2D g = (Graphics2D)g2; Toolkit tk = Toolkit.getDefaultToolkit(); //noinspection HardCodedStringLiteral Map map = (Map)tk.getDesktopProperty("awt.font.desktophints"); - if (map != null) { + if (map != null && !ignoreSystemSettings) { g.addRenderingHints(map); } else { g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, - enable ? RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF); + enableAA ? RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HBGR : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } } }