refs;
- // in case of injected file, use host file to highlight all occurences of the target in each injected file
+ // in case of injected file, use host file to highlight all occurrences of the target in each injected file
PsiFile context = InjectedLanguageUtil.getTopLevelFile(file);
SearchScope searchScope = new LocalSearchScope(context);
if (handler != null) {
diff --git a/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java b/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java
index 40d6b71065cb..de1142c26a7d 100644
--- a/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java
+++ b/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java
@@ -942,6 +942,7 @@ class FindDialog extends DialogWrapper {
model.setModuleName(null);
model.setCustomScopeName(null);
model.setCustomScope(null);
+ model.setCustomScope(false);
if (myRbDirectory.isSelected()) {
String directory = getDirectory();
@@ -957,6 +958,7 @@ class FindDialog extends DialogWrapper {
String customScopeName = selectedScope == null ? null : selectedScope.getDisplayName();
model.setCustomScopeName(customScopeName);
model.setCustomScope(selectedScope == null ? null : selectedScope);
+ model.setCustomScope(true);
findSettings.setCustomScope(customScopeName);
}
}
@@ -983,8 +985,17 @@ class FindDialog extends DialogWrapper {
}
}
}
+ if (myModel.isCustomScope()) {
+ myRbCustomScope.setSelected(true);
- if (myModel.isProjectScope()) {
+ myScopeCombo.setEnabled(true);
+ myScopeCombo.init(myProject, true, true, myModel.getCustomScopeName());
+
+ myCbWithSubdirectories.setEnabled(false);
+ myDirectoryComboBox.setEnabled(false);
+ mySelectDirectoryButton.setEnabled(false);
+ myModuleComboBox.setEnabled(false);
+ } else if (myModel.isProjectScope()) {
myRbProject.setSelected(true);
myCbWithSubdirectories.setEnabled(false);
@@ -1015,17 +1026,6 @@ class FindDialog extends DialogWrapper {
myRbModule.setVisible(true);
myModuleComboBox.setVisible(true);
}
- else if (myModel.getCustomScopeName() != null) {
- myRbCustomScope.setSelected(true);
-
- myScopeCombo.setEnabled(true);
- myScopeCombo.init(myProject, true, true, myModel.getCustomScopeName());
-
- myCbWithSubdirectories.setEnabled(false);
- myDirectoryComboBox.setEnabled(false);
- mySelectDirectoryButton.setEnabled(false);
- myModuleComboBox.setEnabled(false);
- }
else {
assert false;
}
diff --git a/platform/lang-impl/src/com/intellij/formatting/AbstractBlockWrapper.java b/platform/lang-impl/src/com/intellij/formatting/AbstractBlockWrapper.java
index 4a6afb5f9c23..6b3bddec876c 100644
--- a/platform/lang-impl/src/com/intellij/formatting/AbstractBlockWrapper.java
+++ b/platform/lang-impl/src/com/intellij/formatting/AbstractBlockWrapper.java
@@ -200,7 +200,12 @@ public abstract class AbstractBlockWrapper {
return childIndent.add(myParent.getChildOffset(this, options, tokenBlockStartOffset));
}
} else if (!getWhiteSpace().containsLineFeeds()) {
- return childIndent.add(myParent.getChildOffset(this, options, tokenBlockStartOffset));
+ if (isIndentAffectedAlignment(child)) {
+ return createAlignmentIndent(childIndent, child);
+ }
+ else {
+ return childIndent.add(myParent.getChildOffset(this, options, tokenBlockStartOffset));
+ }
} else {
if (myParent == null) return childIndent.add(getWhiteSpace());
if (getIndent().isAbsolute()) {
@@ -212,7 +217,12 @@ public abstract class AbstractBlockWrapper {
}
}
if ((myFlags & CAN_USE_FIRST_CHILD_INDENT_AS_BLOCK_INDENT) != 0) {
- return childIndent.add(getWhiteSpace());
+ if (isIndentAffectedAlignment(child)) {
+ return createAlignmentIndent(childIndent, child);
+ }
+ else {
+ return childIndent.add(getWhiteSpace());
+ }
}
else {
return childIndent.add(myParent.getChildOffset(this, options, tokenBlockStartOffset));
@@ -229,6 +239,21 @@ public abstract class AbstractBlockWrapper {
*/
protected abstract boolean indentAlreadyUsedBefore(final AbstractBlockWrapper child);
+ /**
+ * Allows to retrieve object that encapsulates information about number of symbols before the current block starting
+ * from the line start. I.e. all symbols (either white space or not) between start of the line where current block begins
+ * and the block itself are count and returned.
+ *
+ * @return object that encapsulates information about number of symbols before the current block
+ */
+ protected abstract IndentData getNumberOfSymbolsBeforeBlock();
+
+ /**
+ * @return previous block for the current block if any; null otherwise
+ */
+ @Nullable
+ protected abstract AbstractBlockWrapper getPreviousBlock();
+
protected final void setCanUseFirstChildIndentAsBlockIndent(final boolean newValue) {
if (newValue) myFlags |= CAN_USE_FIRST_CHILD_INDENT_AS_BLOCK_INDENT;
else myFlags &= ~CAN_USE_FIRST_CHILD_INDENT_AS_BLOCK_INDENT;
@@ -261,6 +286,89 @@ public abstract class AbstractBlockWrapper {
}
+ /**
+ * Allows to answer if indent for the given child block should be calculated
+ *
+ * @param child
+ * @return
+ */
+ private boolean isIndentAffectedAlignment(AbstractBlockWrapper child) {
+ if (!child.getWhiteSpace().containsLineFeeds()) {
+ return false;
+ }
+ AlignmentImpl alignment = getAlignmentAtStartOffset();
+ if (alignment == null || alignment == child.getAlignment()) {
+ return false;
+ }
+
+ LeafBlockWrapper anchorOffsetBlock = alignment.getOffsetRespBlockBefore(child);
+ return anchorOffsetBlock == null || anchorOffsetBlock.getStartOffset() >= getStartOffset();
+ }
+
+ /**
+ * Allows to retrieve alignment applied to any block that conforms to the following conditions:
+ *
+ *
+ * - that block is current block or its ancestor (direct or indirect parent);
+ * - that block starts at the same offset as the current one;
+ *
+ *
+ * @return alignment of the current block or it's ancestor that starts at the same offset as the current if any;
+ * null otherwise
+ */
+ @Nullable
+ private AlignmentImpl getAlignmentAtStartOffset() {
+ for (AbstractBlockWrapper block = this; block != null && block.getStartOffset() == getStartOffset(); block = block.getParent()) {
+ if (block.getAlignment() != null) {
+ return block.getAlignment();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Allows to construct indent for the block that is affected by aligning rules. E.g. there is a possible case that the user
+ * configures method call arguments to be aligned and single parameter expression spans more than one line:
+ *
+ *
+ * public void test(String s1, String s2) {}
+ *
+ * public void foo() {
+ * test("11"
+ * + "12"
+ * + "13",
+ * "21"
+ * + "22");
+ * }
+ *
+ *
+ * Here both composite blocks ("11" + "12" + "13" and "21" + "22") are aligned as method call argument but their
+ * sub-blocks that are located on new lines should also be indented to the point of composite block start.
+ *
+ * This method takes care about constructing target absolute indent of the given child block assuming that it's parent
+ * (referenced by 'this') or it's ancestor that starts at the same offset is aligned. I.e. it assumes
+ * that {@link #isIndentAffectedAlignment(AbstractBlockWrapper)} returns true for the given child block.
+ *
+ * @param indentFromParent basic indent of given child from the current parent block
+ * @param child child block of the current aligned composite block
+ * @return absolute indent to use for the given child block of the current composite block
+ */
+ private IndentData createAlignmentIndent(IndentData indentFromParent, AbstractBlockWrapper child) {
+ AbstractBlockWrapper previous = child.getPreviousBlock();
+
+ // There is no point in continuing processing if given child is the first block, i.e. there is no alignment-implied
+ // offset to add to the given 'indent from parent'.
+ if (previous == null) {
+ return indentFromParent;
+ }
+
+ IndentData symbolsBeforeCurrent = getNumberOfSymbolsBeforeBlock();
+
+ // Result is calculated as a number of symbols between the current composite parent block plus given 'indent from parent'.
+ int indentSpaces = symbolsBeforeCurrent.getIndentSpaces() + indentFromParent.getSpaces() + indentFromParent.getIndentSpaces();
+ return new IndentData(indentSpaces, symbolsBeforeCurrent.getSpaces());
+ }
+
private static IndentData getIndent(final CodeStyleSettings.IndentOptions options, final int index, IndentImpl indent) {
if (indent.getType() == IndentImpl.Type.CONTINUATION) {
return new IndentData(options.CONTINUATION_INDENT_SIZE);
diff --git a/platform/lang-impl/src/com/intellij/formatting/AlignmentImpl.java b/platform/lang-impl/src/com/intellij/formatting/AlignmentImpl.java
index 0171c1336ea9..0d98a10e543c 100644
--- a/platform/lang-impl/src/com/intellij/formatting/AlignmentImpl.java
+++ b/platform/lang-impl/src/com/intellij/formatting/AlignmentImpl.java
@@ -16,14 +16,13 @@
package com.intellij.formatting;
+import org.jetbrains.annotations.Nullable;
+
import java.util.*;
class AlignmentImpl extends Alignment {
private static final List EMPTY = Collections.unmodifiableList(new ArrayList(0));
private Collection myOffsetRespBlocks = EMPTY;
- private final int myFlags;
- private static int ourId = 0;
- private static final int ID_SHIFT = 1;
private AlignmentImpl myParentAlignment;
public String getId() {
@@ -38,18 +37,6 @@ class AlignmentImpl extends Alignment {
myParentAlignment = (AlignmentImpl)base;
}
- static enum Type{
- FULL,NORMAL
- }
-
- public AlignmentImpl(final Type type) {
- myFlags = ((ourId++) >> ID_SHIFT) | type.ordinal();
- }
-
- final Type getType() {
- return Type.values()[myFlags & 1];
- }
-
/**
* Selects target wrapped block by the following algorithm:
*
@@ -82,7 +69,8 @@ class AlignmentImpl extends Alignment {
* @return block {@link #setOffsetRespBlock(LeafBlockWrapper) registered} for the current alignment object or
* {@link #setParent(Alignment) its parent} using the algorithm above if any; null otherwise
*/
- LeafBlockWrapper getOffsetRespBlockBefore(final LeafBlockWrapper block) {
+ @Nullable
+ LeafBlockWrapper getOffsetRespBlockBefore(final AbstractBlockWrapper block) {
LeafBlockWrapper result = null;
if (myOffsetRespBlocks != EMPTY) {
LeafBlockWrapper lastBlockAfterLineFeed = null;
@@ -116,20 +104,20 @@ class AlignmentImpl extends Alignment {
result = lastAlignedBlock;
}
}
+
if (result == null && myParentAlignment != null) {
return myParentAlignment.getOffsetRespBlockBefore(block);
}
else {
return result;
}
-
}
/**
* Registers wrapped block within the current alignment in order to use it for further
- * {@link #getOffsetRespBlockBefore(LeafBlockWrapper)} calls processing.
+ * {@link #getOffsetRespBlockBefore(AbstractBlockWrapper)} calls processing.
*
- * @param block wrapped block to register within the curretn alignmnent object
+ * @param block wrapped block to register within the current alignment object
*/
void setOffsetRespBlock(final LeafBlockWrapper block) {
if (myOffsetRespBlocks == EMPTY) myOffsetRespBlocks = new LinkedHashSet(1);
diff --git a/platform/lang-impl/src/com/intellij/formatting/BlockDebugUtil.java b/platform/lang-impl/src/com/intellij/formatting/BlockDebugUtil.java
index fc39a126d0a6..f76e2eb14be1 100644
--- a/platform/lang-impl/src/com/intellij/formatting/BlockDebugUtil.java
+++ b/platform/lang-impl/src/com/intellij/formatting/BlockDebugUtil.java
@@ -36,11 +36,21 @@ public class BlockDebugUtil {
*/
public static void dumpBlockTree(PrintStream out, Block block) {
out.println("--- BLOCK TREE DUMP ---");
- dumpBlockTree(out, block, "");
+ dumpBlockTree(out, block, "", true);
out.println("--- END OF DUMP ---\n\n");
}
- private static void dumpBlockTree(PrintStream out, Block block, String indent) {
+
+ /**
+ * Print out a single block info without child blocks.
+ * @param out The output stream.
+ * @param block The block to print the info for.
+ */
+ public static void dumpBlock(PrintStream out, Block block) {
+ dumpBlockTree(out, block, "", false);
+ }
+
+ private static void dumpBlockTree(PrintStream out, Block block, String indent, boolean withChildren) {
if (block == null) return;
out.print(indent + block.getClass().getSimpleName());
if (block.getIndent() != null) {
@@ -49,6 +59,7 @@ public class BlockDebugUtil {
else {
out.print(" ");
}
+ out.print(" " + block.getTextRange() + " ");
if (block instanceof ASTBlock) {
ASTNode node = ((ASTBlock)block).getNode();
if (node != null) {
@@ -61,20 +72,20 @@ public class BlockDebugUtil {
out.print(" \"" + text + "\"");
}
}
- System.out.println();
- List subBlocks = getSubBlocks(block);
- if (subBlocks != null && subBlocks.size() > 0) {
- out.println(indent + "{");
- for (Block child : subBlocks) {
- dumpBlockTree(out, child, indent + " ");
+ out.println();
+ if (withChildren) {
+ List subBlocks = getSubBlocks(block);
+ if (subBlocks != null && subBlocks.size() > 0) {
+ out.println(indent + "{");
+ for (Block child : subBlocks) {
+ dumpBlockTree(out, child, indent + " ", true);
+ }
+ out.println(indent + "}");
}
- out.println(indent + "}");
}
}
private static List getSubBlocks(Block root) {
- if (root instanceof AbstractBlock) return ((AbstractBlock)root).getSubBlocks();
- if (root instanceof DataLanguageBlockWrapper) return ((DataLanguageBlockWrapper)root).getSubBlocks();
- return null;
+ return root.getSubBlocks();
}
}
diff --git a/platform/lang-impl/src/com/intellij/formatting/CompositeBlockWrapper.java b/platform/lang-impl/src/com/intellij/formatting/CompositeBlockWrapper.java
index 84959f84dc2e..805bbf49aff0 100644
--- a/platform/lang-impl/src/com/intellij/formatting/CompositeBlockWrapper.java
+++ b/platform/lang-impl/src/com/intellij/formatting/CompositeBlockWrapper.java
@@ -57,6 +57,7 @@ public class CompositeBlockWrapper extends AbstractBlockWrapper{
}
}
+ @Override
protected boolean indentAlreadyUsedBefore(final AbstractBlockWrapper child) {
for (AbstractBlockWrapper childBefore : myChildren) {
if (childBefore == child) return false;
@@ -65,6 +66,22 @@ public class CompositeBlockWrapper extends AbstractBlockWrapper{
return false;
}
+ @Override
+ protected IndentData getNumberOfSymbolsBeforeBlock() {
+ if (myChildren == null || myChildren.isEmpty()) {
+ return new IndentData(0, 0);
+ }
+ return myChildren.get(0).getNumberOfSymbolsBeforeBlock();
+ }
+
+ @Override
+ protected AbstractBlockWrapper getPreviousBlock() {
+ if (myChildren == null || myChildren.isEmpty()) {
+ return null;
+ }
+ return myChildren.get(0).getPreviousBlock();
+ }
+
public void dispose() {
super.dispose();
myChildren = null;
diff --git a/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java b/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java
index da607feaca2e..96f38eef28cf 100644
--- a/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java
+++ b/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java
@@ -61,11 +61,11 @@ public class FormatterImpl extends FormatterEx
}
public Alignment createAlignment() {
- return new AlignmentImpl(AlignmentImpl.Type.NORMAL);
+ return new AlignmentImpl();
}
public Alignment createChildAlignment(final Alignment base) {
- AlignmentImpl result = new AlignmentImpl(AlignmentImpl.Type.NORMAL);
+ AlignmentImpl result = new AlignmentImpl();
result.setParent(base);
return result;
}
diff --git a/platform/lang-impl/src/com/intellij/formatting/LeafBlockWrapper.java b/platform/lang-impl/src/com/intellij/formatting/LeafBlockWrapper.java
index 171ac65b1357..1c5b96d8cf6b 100644
--- a/platform/lang-impl/src/com/intellij/formatting/LeafBlockWrapper.java
+++ b/platform/lang-impl/src/com/intellij/formatting/LeafBlockWrapper.java
@@ -90,6 +90,7 @@ class LeafBlockWrapper extends AbstractBlockWrapper {
return mySymbolsAtTheLastLine;
}
+ @Override
public LeafBlockWrapper getPreviousBlock() {
return myPreviousBlock;
}
@@ -102,10 +103,33 @@ class LeafBlockWrapper extends AbstractBlockWrapper {
myNextBlock = nextBlock;
}
+ @Override
protected boolean indentAlreadyUsedBefore(final AbstractBlockWrapper child) {
return false;
}
+ @Override
+ protected IndentData getNumberOfSymbolsBeforeBlock() {
+ int spaces = getWhiteSpace().getSpaces();
+ int indentSpaces = getWhiteSpace().getIndentSpaces();
+
+ if (getWhiteSpace().containsLineFeeds()) {
+ return new IndentData(indentSpaces, spaces);
+ }
+
+ for (LeafBlockWrapper current = this.getPreviousBlock(); current != null; current = current.getPreviousBlock()) {
+ spaces += current.getWhiteSpace().getSpaces();
+ spaces += current.getSymbolsAtTheLastLine();
+ indentSpaces += current.getWhiteSpace().getIndentSpaces();
+ if (current.getWhiteSpace().containsLineFeeds()) {
+ break;
+ }
+ }
+ return new IndentData(indentSpaces, spaces);
+ }
+
+
+
public void dispose() {
super.dispose();
myPreviousBlock = null;
diff --git a/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlock.java b/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlock.java
index 7d1575c24fb8..92e084325957 100644
--- a/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlock.java
+++ b/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlock.java
@@ -64,7 +64,8 @@ public abstract class TemplateLanguageBlock extends AbstractBlock implements Blo
for (ASTNode childNode = getNode().getFirstChildNode(); childNode != null; childNode = childNode.getTreeNext()) {
if (FormatterUtil.containsWhiteSpacesOnly(childNode)) continue;
if (shouldBuildBlockFor(childNode)) {
- final TemplateLanguageBlock childBlock = myBlockFactory.createTemplateLanguageBlock(childNode, createChildWrap(childNode), null, mySettings);
+ final TemplateLanguageBlock childBlock = myBlockFactory
+ .createTemplateLanguageBlock(childNode, createChildWrap(childNode), createChildAlignment(childNode), null, mySettings);
childBlock.setParent(this);
tlChildren.add(childBlock);
}
@@ -133,5 +134,9 @@ public abstract class TemplateLanguageBlock extends AbstractBlock implements Blo
protected Wrap createChildWrap(ASTNode child) {
return Wrap.createWrap(Wrap.NONE, false);
}
+
+ protected Alignment createChildAlignment(ASTNode child) {
+ return null;
+ }
}
diff --git a/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlockFactory.java b/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlockFactory.java
index cecc32749d6b..c6f2a3a80148 100644
--- a/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlockFactory.java
+++ b/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlockFactory.java
@@ -15,6 +15,7 @@
*/
package com.intellij.formatting.templateLanguages;
+import com.intellij.formatting.Alignment;
import com.intellij.formatting.Wrap;
import com.intellij.lang.ASTNode;
import com.intellij.psi.codeStyle.CodeStyleSettings;
@@ -31,6 +32,7 @@ import java.util.List;
public interface TemplateLanguageBlockFactory {
TemplateLanguageBlock createTemplateLanguageBlock(@NotNull ASTNode node,
@Nullable Wrap wrap,
+ @Nullable Alignment alignment,
@Nullable List foreignChildren,
@NotNull CodeStyleSettings codeStyleSettings);
}
diff --git a/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageFormattingModelBuilder.java b/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageFormattingModelBuilder.java
index da82a98880f3..a6027b2104a1 100644
--- a/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageFormattingModelBuilder.java
+++ b/platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageFormattingModelBuilder.java
@@ -59,14 +59,14 @@ public abstract class TemplateLanguageFormattingModelBuilder implements Delegati
return createDummyBlock(node);
}
if (builder == null) {
- return createTemplateLanguageBlock(node, Wrap.createWrap(WrapType.NONE, false), Collections.emptyList(), settings);
+ return createTemplateLanguageBlock(node, Wrap.createWrap(WrapType.NONE, false), null, Collections.emptyList(), settings);
}
final FormattingModel model = builder.createModel(viewProvider.getPsi(dataLanguage), settings);
List childWrappers = buildChildWrappers(model.getRootBlock());
if (childWrappers.size() == 1) {
childWrappers = buildChildWrappers(childWrappers.get(0).getOriginal());
}
- return createTemplateLanguageBlock(node, Wrap.createWrap(WrapType.NONE, false), filterBlocksByRange(childWrappers, node.getTextRange()), settings);
+ return createTemplateLanguageBlock(node, Wrap.createWrap(WrapType.NONE, false), null, filterBlocksByRange(childWrappers, node.getTextRange()), settings);
}
protected AbstractBlock createDummyBlock(final ASTNode node) {
diff --git a/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java b/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java
index 553bd6be00de..2fef940b3b23 100644
--- a/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java
+++ b/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java
@@ -734,6 +734,8 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre
return value == null ? this : value;
}
+
+
@NotNull
public Collection getChildren() {
if (ourSettingsModificationCount != modificationCountForChildren) {
@@ -762,7 +764,7 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre
if (getElementInfoProvider() != null) {
return getElementInfoProvider().isAlwaysShowsPlus((StructureViewTreeElement)getValue());
}
- return getValue().getChildren().length > 0;
+ return true;
}
@Override
@@ -771,7 +773,7 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre
return getElementInfoProvider().isAlwaysLeaf((StructureViewTreeElement)getValue());
}
- return getValue().getChildren().length == 0;
+ return false;
}
private StructureViewModel.ElementInfoProvider getElementInfoProvider() {
@@ -791,6 +793,11 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre
return new StructureViewTreeElementWrapper(myProject, child, myTreeModel);
}
+ @Override
+ protected GroupWrapper createGroupWrapper(final Project project, Group group, final TreeModel treeModel) {
+ return new StructureViewGroup(project, group, treeModel);
+ }
+
public boolean equals(Object o) {
if (o instanceof StructureViewTreeElementWrapper) {
return Comparing.equal(
@@ -820,6 +827,28 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre
return o != null ? o.hashCode() : 0;
}
+
+ private class StructureViewGroup extends GroupWrapper {
+ public StructureViewGroup(Project project, Group group, TreeModel treeModel) {
+ super(project, group, treeModel);
+ }
+
+ @Override
+ protected TreeElementWrapper createChildNode(TreeElement child) {
+ return new StructureViewTreeElementWrapper(getProject(), child, myTreeModel);
+ }
+
+
+ @Override
+ protected GroupWrapper createGroupWrapper(Project project, Group group, TreeModel treeModel) {
+ return new StructureViewGroup(project, group, treeModel);
+ }
+
+ @Override
+ public boolean isAlwaysShowPlus() {
+ return true;
+ }
+ }
}
public String getHelpID() {
diff --git a/platform/lang-impl/src/com/intellij/ide/util/DirectoryChooser.java b/platform/lang-impl/src/com/intellij/ide/util/DirectoryChooser.java
index a7e74e8059f1..12f7e05815b8 100644
--- a/platform/lang-impl/src/com/intellij/ide/util/DirectoryChooser.java
+++ b/platform/lang-impl/src/com/intellij/ide/util/DirectoryChooser.java
@@ -233,10 +233,10 @@ public class DirectoryChooser extends DialogWrapper {
if (myDirectory != null) {
VirtualFile virtualFile = myDirectory.getVirtualFile();
if (fileIndex.isInTestSourceContent(virtualFile)){
- return Icons.TEST_SOURCE_FOLDER;
+ return Icons.MODULES_TEST_SOURCE_FOLDER;
}
else if (fileIndex.isInSourceContent(virtualFile)){
- return Icons.SOURCE_FOLDERS_ICON;
+ return Icons.MODULES_SOURCE_FOLDERS_ICON;
}
}
return Icons.FOLDER_ICON;
diff --git a/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/CachingChildrenTreeNode.java b/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/CachingChildrenTreeNode.java
index 5b4d1e7f2a2b..6cfd68b2228f 100644
--- a/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/CachingChildrenTreeNode.java
+++ b/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/CachingChildrenTreeNode.java
@@ -155,7 +155,7 @@ public abstract class CachingChildrenTreeNode extends AbstractTreeNode children = group.getChildren();
for (TreeElement node : children) {
- CachingChildrenTreeNode child = new TreeElementWrapper(getProject(), node, myTreeModel);
+ CachingChildrenTreeNode child = createChildNode(node);
groupWrapper.addSubElement(child);
AbstractTreeNode abstractTreeNode = ungroupedObjects.get(node);
abstractTreeNode.setParent(groupWrapper);
@@ -163,6 +163,10 @@ public abstract class CachingChildrenTreeNode extends AbstractTreeNode collectValues(List> ungrouped) {
Map objects = new LinkedHashMap();
for (final AbstractTreeNode node : ungrouped) {
@@ -174,11 +178,15 @@ public abstract class CachingChildrenTreeNode extends AbstractTreeNode createGroupNodes(Collection groups) {
Map result = new THashMap();
for (Group group : groups) {
- result.put(group, new GroupWrapper(getProject(), group, myTreeModel));
+ result.put(group, createGroupWrapper(getProject(), group, myTreeModel));
}
return result;
}
+ protected GroupWrapper createGroupWrapper(final Project project, Group group, final TreeModel treeModel) {
+ return new GroupWrapper(project, group, treeModel);
+ }
+
private void rebuildSubtree() {
initChildren();
diff --git a/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/GroupWrapper.java b/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/GroupWrapper.java
index ab25f9da1e17..8596ba395653 100644
--- a/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/GroupWrapper.java
+++ b/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/GroupWrapper.java
@@ -21,7 +21,7 @@ import com.intellij.openapi.project.Project;
import java.util.Collection;
-class GroupWrapper extends CachingChildrenTreeNode {
+public class GroupWrapper extends CachingChildrenTreeNode {
public GroupWrapper(Project project, Group value, TreeModel treeModel) {
super(project, value, treeModel);
clearChildren();
@@ -41,12 +41,11 @@ class GroupWrapper extends CachingChildrenTreeNode {
clearChildren();
Collection children = getValue().getChildren();
for (TreeElement child : children) {
- TreeElementWrapper childNode = new TreeElementWrapper(getProject(), child, myTreeModel);
+ TreeElementWrapper childNode = createChildNode(child);
addSubElement(childNode);
}
}
-
protected void performTreeActions() {
filterChildren(myTreeModel.getFilters());
groupChildren(myTreeModel.getGroupers());
diff --git a/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/TreeElementWrapper.java b/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/TreeElementWrapper.java
index df4029513e31..dab90df455ff 100644
--- a/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/TreeElementWrapper.java
+++ b/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/TreeElementWrapper.java
@@ -41,10 +41,6 @@ public class TreeElementWrapper extends CachingChildrenTreeNode{
}
}
- protected TreeElementWrapper createChildNode(final TreeElement child) {
- return new TreeElementWrapper(getProject(), child, myTreeModel);
- }
-
protected void performTreeActions() {
filterChildren(myTreeModel.getFilters());
groupChildren(myTreeModel.getGroupers());
diff --git a/platform/lang-impl/src/com/intellij/injected/editor/EditorWindow.java b/platform/lang-impl/src/com/intellij/injected/editor/EditorWindow.java
index 5f01a469f3e2..b9eef1d30246 100644
--- a/platform/lang-impl/src/com/intellij/injected/editor/EditorWindow.java
+++ b/platform/lang-impl/src/com/intellij/injected/editor/EditorWindow.java
@@ -222,7 +222,7 @@ public class EditorWindow implements EditorEx, UserDataHolderEx {
public EditorHighlighter getHighlighter() {
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
- EditorHighlighter highlighter = HighlighterFactory.createHighlighter(myInjectedFile.getFileType(), scheme, getProject());
+ EditorHighlighter highlighter = HighlighterFactory.createHighlighter(myInjectedFile.getVirtualFile(), scheme, getProject());
highlighter.setText(getDocument().getText());
return highlighter;
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java
index 0f72d83b9c20..ce2a0fc2e04e 100644
--- a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java
+++ b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java
@@ -102,6 +102,7 @@ public class GeneralColorsPage implements ColorSettingsPage {
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.selected.folding.outline"), EditorColors.SELECTED_FOLDING_TREE_COLOR, ColorDescriptor.Kind.FOREGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.added.lines"), EditorColors.ADDED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.modified.lines"), EditorColors.MODIFIED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND),
+ new ColorDescriptor(OptionsBundle.message("options.java.color.descriptor.method.separator.color"), CodeInsightColors.METHOD_SEPARATORS_COLOR, ColorDescriptor.Kind.FOREGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.console.background"), ConsoleViewContentType.CONSOLE_BACKGROUND_KEY, ColorDescriptor.Kind.BACKGROUND),
};
diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SdkConfigurationUtil.java b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SdkConfigurationUtil.java
index 0c860a3ff64b..861611e4ff47 100644
--- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SdkConfigurationUtil.java
+++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SdkConfigurationUtil.java
@@ -104,26 +104,26 @@ public class SdkConfigurationUtil {
@Nullable
public static Sdk setupSdk(final VirtualFile homeDir, final SdkType sdkType, final boolean silent) {
+ final Sdk[] sdks = ProjectJdkTable.getInstance().getAllJdks();
+ final ProjectJdkImpl projectJdk;
+ try {
+ final String sdkName = createUniqueSdkName(sdkType, homeDir.getPath(), Arrays.asList(sdks));
+ projectJdk = new ProjectJdkImpl(sdkName, sdkType);
+ projectJdk.setHomePath(homeDir.getPath());
+ sdkType.setupSdkPaths(projectJdk);
+ }
+ catch (Exception e) {
+ if (!silent) {
+ Messages.showErrorDialog("Error configuring SDK: " +
+ e.getMessage() +
+ ".\nPlease make sure that " +
+ FileUtil.toSystemDependentName(homeDir.getPath()) +
+ " is a valid home path for this SDK type.", "Error configuring SDK");
+ }
+ return null;
+ }
return ApplicationManager.getApplication().runWriteAction(new NullableComputable() {
public Sdk compute() {
- final Sdk[] sdks = ProjectJdkTable.getInstance().getAllJdks();
- ProjectJdkImpl projectJdk;
- try {
- final String sdkName = createUniqueSdkName(sdkType, homeDir.getPath(), Arrays.asList(sdks));
- projectJdk = new ProjectJdkImpl(sdkName, sdkType);
- projectJdk.setHomePath(homeDir.getPath());
- sdkType.setupSdkPaths(projectJdk);
- }
- catch (Exception e) {
- if (!silent) {
- Messages.showErrorDialog("Error configuring SDK: " +
- e.getMessage() +
- ".\nPlease make sure that " +
- FileUtil.toSystemDependentName(homeDir.getPath()) +
- " is a valid home path for this SDK type.", "Error configuring SDK");
- }
- return null;
- }
ProjectJdkTable.getInstance().addJdk(projectJdk);
return projectJdk;
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/vcs/impl/ModuleVcsDetector.java b/platform/lang-impl/src/com/intellij/openapi/vcs/impl/ModuleVcsDetector.java
index 7fec28d15608..ae9d4e74dc73 100644
--- a/platform/lang-impl/src/com/intellij/openapi/vcs/impl/ModuleVcsDetector.java
+++ b/platform/lang-impl/src/com/intellij/openapi/vcs/impl/ModuleVcsDetector.java
@@ -29,6 +29,7 @@ import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
@@ -82,10 +83,16 @@ public class ModuleVcsDetector implements ProjectComponent {
}
private class MyModulesListener extends ModuleAdapter implements ModuleRootListener {
+ private final List> myMappingsForRemovedModules = new ArrayList>();
+
public void beforeRootsChange(ModuleRootEvent event) {
+ myMappingsForRemovedModules.clear();
}
public void rootsChanged(ModuleRootEvent event) {
+ for (Pair mapping : myMappingsForRemovedModules) {
+ promptRemoveMapping(mapping.first, mapping.second);
+ }
// the check calculates to true only before user has done any change to mappings, i.e. in case modules are detected/added automatically
// on start etc (look inside)
if (myVcsManager.needAutodetectMappings()) {
@@ -94,11 +101,12 @@ public class ModuleVcsDetector implements ProjectComponent {
}
public void moduleAdded(final Project project, final Module module) {
+ myMappingsForRemovedModules.removeAll(getMappings(module));
autoDetectModuleVcsMapping(module);
}
public void beforeModuleRemoved(final Project project, final Module module) {
- checkRemoveVcsRoot(module);
+ myMappingsForRemovedModules.addAll(getMappings(module));
}
}
@@ -183,27 +191,31 @@ public class ModuleVcsDetector implements ProjectComponent {
}
}
- private void checkRemoveVcsRoot(final Module module) {
+ private List> getMappings(final Module module) {
+ List> result = new ArrayList>();
final VirtualFile[] files = ModuleRootManager.getInstance(module).getContentRoots();
final String moduleName = module.getName();
for(final VirtualFile file: files) {
for(final VcsDirectoryMapping mapping: myVcsManager.getDirectoryMappings()) {
if (FileUtil.toSystemIndependentName(mapping.getDirectory()).equals(file.getPath())) {
- ApplicationManager.getApplication().invokeLater(new Runnable() {
- public void run() {
- if (myProject.isDisposed()) return;
- final String msg = VcsBundle.message("vcs.root.remove.prompt", FileUtil.toSystemDependentName(file.getPath()), moduleName);
- int rc = Messages.showYesNoDialog(myProject, msg, VcsBundle.message("vcs.root.remove.title"), Messages.getQuestionIcon());
- if (rc == 0) {
- myVcsManager.removeDirectoryMapping(mapping);
- }
- }
- }, ModalityState.NON_MODAL);
+ result.add(new Pair(moduleName, mapping));
break;
}
}
}
+ return result;
}
-
+ private void promptRemoveMapping(final String moduleName, final VcsDirectoryMapping mapping) {
+ ApplicationManager.getApplication().invokeLater(new Runnable() {
+ public void run() {
+ if (myProject.isDisposed()) return;
+ final String msg = VcsBundle.message("vcs.root.remove.prompt", FileUtil.toSystemDependentName(mapping.getDirectory()), moduleName);
+ int rc = Messages.showYesNoDialog(myProject, msg, VcsBundle.message("vcs.root.remove.title"), Messages.getQuestionIcon());
+ if (rc == 0) {
+ myVcsManager.removeDirectoryMapping(mapping);
+ }
+ }
+ }, ModalityState.NON_MODAL);
+ }
}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java
index de48efbb8eed..ad3b8aa5eb0a 100644
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java
@@ -456,7 +456,7 @@ public class SingleInspectionProfilePanel extends JPanel {
myTree.setCellRenderer(renderer);
- myTree.setRootVisible(true);
+ myTree.setRootVisible(false);
myTree.setShowsRootHandles(true);
UIUtil.setLineStyleAngled(myTree);
TreeToolTipHandler.install(myTree);
diff --git a/platform/lang-impl/src/com/intellij/psi/impl/PsiDocumentManagerImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/PsiDocumentManagerImpl.java
index a4c463c9b29d..b2151518a7b1 100644
--- a/platform/lang-impl/src/com/intellij/psi/impl/PsiDocumentManagerImpl.java
+++ b/platform/lang-impl/src/com/intellij/psi/impl/PsiDocumentManagerImpl.java
@@ -520,29 +520,28 @@ public class PsiDocumentManagerImpl extends PsiDocumentManager implements Projec
public void documentChanged(DocumentEvent event) {
final Document document = event.getDocument();
final FileViewProvider viewProvider = getCachedViewProvider(document);
- if (viewProvider != null) {
- if (viewProvider.getVirtualFile().getFileType().isBinary()) return;
+ if (viewProvider == null) return;
+ if (viewProvider.getVirtualFile().getFileType().isBinary()) return;
- final List files = viewProvider.getAllFiles();
- boolean commitNecessary = false;
- for (PsiFile file : files) {
- if (file == null || file instanceof PsiFileImpl && ((PsiFileImpl)file).getTreeElement() == null) continue;
- final TextBlock textBlock = getTextBlock(document, file);
- if (textBlock.isLocked()) continue;
+ final List files = viewProvider.getAllFiles();
+ boolean commitNecessary = false;
+ for (PsiFile file : files) {
+ if (file == null || file instanceof PsiFileImpl && ((PsiFileImpl)file).getTreeElement() == null) continue;
+ final TextBlock textBlock = getTextBlock(document, file);
+ if (textBlock.isLocked()) continue;
- if (mySmartPointerManager != null) { // mock tests
- SmartPointerManagerImpl.unfastenBelts(file);
- }
-
- textBlock.documentChanged(event);
- assert file instanceof PsiFileImpl : event + "; file="+file+"; allFiles="+files+"; viewProvider="+viewProvider;
- myUncommittedDocuments.add(document);
- commitNecessary = true;
+ if (mySmartPointerManager != null) { // mock tests
+ SmartPointerManagerImpl.unfastenBelts(file);
}
- if (commitNecessary && ApplicationManager.getApplication().getCurrentWriteAction(ExternalChangeAction.class) != null){
- commitDocument(document);
- }
+ textBlock.documentChanged(event);
+ assert file instanceof PsiFileImpl : event + "; file="+file+"; allFiles="+files+"; viewProvider="+viewProvider;
+ myUncommittedDocuments.add(document);
+ commitNecessary = true;
+ }
+
+ if (commitNecessary && ApplicationManager.getApplication().getCurrentWriteAction(ExternalChangeAction.class) != null){
+ commitDocument(document);
}
}
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/BasePlatformRefactoringAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/BasePlatformRefactoringAction.java
new file mode 100644
index 000000000000..9880e9d21e12
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/BasePlatformRefactoringAction.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ * 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.refactoring.actions;
+
+import com.intellij.lang.Language;
+import com.intellij.lang.LanguageRefactoringSupport;
+import com.intellij.lang.refactoring.RefactoringSupportProvider;
+import com.intellij.openapi.extensions.ExtensionPointListener;
+import com.intellij.openapi.extensions.PluginDescriptor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author yole
+ */
+public abstract class BasePlatformRefactoringAction extends BaseRefactoringAction {
+ private Boolean myHidden = null;
+
+ public BasePlatformRefactoringAction() {
+ LanguageRefactoringSupport.INSTANCE.addListener(new ExtensionPointListener() {
+ public void extensionAdded(RefactoringSupportProvider extension, @Nullable PluginDescriptor pluginDescriptor) {
+ myHidden = null;
+ }
+
+ public void extensionRemoved(RefactoringSupportProvider extension, @Nullable PluginDescriptor pluginDescriptor) {
+ myHidden = null;
+ }
+ });
+ }
+
+ @Override
+ protected boolean isHidden() {
+ if (myHidden == null) {
+ myHidden = calcHidden();
+ }
+ return myHidden.booleanValue();
+ }
+
+ private boolean calcHidden() {
+ for(Language l: Language.getRegisteredLanguages()) {
+ if (isAvailableForLanguage(l)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/BaseRefactoringAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/BaseRefactoringAction.java
index 54e76c51dc97..9744892bed7e 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/BaseRefactoringAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/BaseRefactoringAction.java
@@ -87,6 +87,10 @@ public abstract class BaseRefactoringAction extends AnAction {
disableAction(e);
return;
}
+ if (isHidden()) {
+ e.getPresentation().setVisible(false);
+ return;
+ }
Editor editor = e.getData(PlatformDataKeys.EDITOR);
PsiFile file = e.getData(LangDataKeys.PSI_FILE);
@@ -127,6 +131,10 @@ public abstract class BaseRefactoringAction extends AnAction {
}
}
+ protected boolean isHidden() {
+ return false;
+ }
+
public static PsiElement getElementAtCaret(final Editor editor, final PsiFile file) {
final int offset = fixCaretOffset(editor);
PsiElement element = file.findElementAt(offset);
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/ExtractMethodAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/ExtractMethodAction.java
index 882cb12af038..5a91122c1c35 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/ExtractMethodAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/ExtractMethodAction.java
@@ -23,10 +23,7 @@ import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.psi.PsiElement;
import com.intellij.refactoring.RefactoringActionHandler;
-/**
- *
- */
-public class ExtractMethodAction extends BaseRefactoringAction {
+public class ExtractMethodAction extends BasePlatformRefactoringAction {
public ExtractMethodAction() {
setInjectedContext(true);
}
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/ExtractSuperclassAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/ExtractSuperclassAction.java
index 14e313eb8095..02290346a898 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/ExtractSuperclassAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/ExtractSuperclassAction.java
@@ -26,7 +26,7 @@ import com.intellij.psi.PsiFile;
import com.intellij.refactoring.RefactoringActionHandler;
import com.intellij.refactoring.lang.ElementsHandler;
-public class ExtractSuperclassAction extends BaseRefactoringAction {
+public class ExtractSuperclassAction extends BasePlatformRefactoringAction {
public boolean isAvailableInEditorOnly() {
return false;
}
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/InlineAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/InlineAction.java
index bdf332d44c63..a38458fca56e 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/InlineAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/InlineAction.java
@@ -33,7 +33,7 @@ import com.intellij.refactoring.RefactoringActionHandler;
import com.intellij.refactoring.inline.InlineRefactoringActionHandler;
import org.jetbrains.annotations.Nullable;
-public class InlineAction extends BaseRefactoringAction {
+public class InlineAction extends BasePlatformRefactoringAction {
public boolean isAvailableInEditorOnly() {
return false;
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceConstantAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceConstantAction.java
index 8afc3073ff3c..81a19b4a6b83 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceConstantAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceConstantAction.java
@@ -23,7 +23,7 @@ import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.psi.PsiElement;
import com.intellij.refactoring.RefactoringActionHandler;
-public class IntroduceConstantAction extends BaseRefactoringAction {
+public class IntroduceConstantAction extends BasePlatformRefactoringAction {
public IntroduceConstantAction() {
setInjectedContext(true);
}
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceFieldAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceFieldAction.java
index b84f1a1fe2c8..a5085c2a15cd 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceFieldAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceFieldAction.java
@@ -23,7 +23,7 @@ import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.psi.PsiElement;
import com.intellij.refactoring.RefactoringActionHandler;
-public class IntroduceFieldAction extends BaseRefactoringAction {
+public class IntroduceFieldAction extends BasePlatformRefactoringAction {
public IntroduceFieldAction() {
setInjectedContext(true);
}
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceParameterAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceParameterAction.java
index 9a06120f7b4a..607f6642b877 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceParameterAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceParameterAction.java
@@ -31,7 +31,7 @@ import com.intellij.refactoring.RefactoringActionHandler;
import com.intellij.lang.Language;
import com.intellij.lang.LanguageRefactoringSupport;
-public class IntroduceParameterAction extends BaseRefactoringAction {
+public class IntroduceParameterAction extends BasePlatformRefactoringAction {
protected boolean isAvailableInEditorOnly() {
return true;
}
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceVariableAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceVariableAction.java
index 9484f0e7b63d..aa91cf1f52a0 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceVariableAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceVariableAction.java
@@ -26,7 +26,7 @@ import com.intellij.refactoring.RefactoringActionHandler;
/**
*
*/
-public class IntroduceVariableAction extends BaseRefactoringAction {
+public class IntroduceVariableAction extends BasePlatformRefactoringAction {
public IntroduceVariableAction() {
setInjectedContext(true);
}
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/PullUpAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/PullUpAction.java
index cdafb59e6928..2e65b2099895 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/PullUpAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/PullUpAction.java
@@ -26,7 +26,7 @@ import com.intellij.psi.PsiFile;
import com.intellij.refactoring.RefactoringActionHandler;
import com.intellij.refactoring.lang.ElementsHandler;
-public class PullUpAction extends BaseRefactoringAction {
+public class PullUpAction extends BasePlatformRefactoringAction {
public PullUpAction() {
setInjectedContext(true);
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/PushDownAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/PushDownAction.java
index 5fab549848d1..f3a755494b49 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/PushDownAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/PushDownAction.java
@@ -27,7 +27,7 @@ import com.intellij.refactoring.RefactoringActionHandler;
import com.intellij.refactoring.lang.ElementsHandler;
-public class PushDownAction extends BaseRefactoringAction {
+public class PushDownAction extends BasePlatformRefactoringAction {
public PushDownAction() {
setInjectedContext(true);
diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java b/platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java
index 3668febb1a4f..f1d0d0f2bc2b 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java
@@ -93,7 +93,7 @@ public abstract class RenamePsiElementProcessor {
if (element instanceof PsiFile) {
return "refactoring.renameFile";
}
- return null;
+ return "refactoring.renameDialogs";
}
public boolean isToSearchInComments(final PsiElement element) {
diff --git a/platform/lang-impl/src/com/intellij/ui/DeferredIconImpl.java b/platform/lang-impl/src/com/intellij/ui/DeferredIconImpl.java
index 53fa5b1932d6..7dbc4a248c92 100644
--- a/platform/lang-impl/src/com/intellij/ui/DeferredIconImpl.java
+++ b/platform/lang-impl/src/com/intellij/ui/DeferredIconImpl.java
@@ -20,7 +20,7 @@
package com.intellij.ui;
import com.intellij.concurrency.Job;
-import com.intellij.concurrency.JobScheduler;
+import com.intellij.concurrency.JobUtil;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.util.Alarm;
@@ -90,8 +90,7 @@ public class DeferredIconImpl implements DeferredIcon {
myLastTarget = new WeakReference(target);
- final Job