diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java index 8f88be86d8ee..4d7359ab4b49 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java @@ -50,6 +50,7 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.LibraryPro import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement; import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureDaemonAnalyzer; import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureElement; +import com.intellij.openapi.ui.DialogBuilder; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.NamedConfigurable; @@ -64,6 +65,7 @@ import com.intellij.openapi.wm.WindowManager; import com.intellij.ui.navigation.Place; import com.intellij.util.Consumer; import com.intellij.util.Function; +import com.intellij.util.PathUtil; import com.intellij.util.PlatformIcons; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.tree.TreeUtil; @@ -783,27 +785,23 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple final NamedConfigurable namedConfigurable = getSelectedConfugurable(); if (namedConfigurable instanceof ModuleConfigurable) { try { + final ModuleEditor moduleEditor = ((ModuleConfigurable)namedConfigurable).getModuleEditor(); final String modulePresentation = IdeBundle.message("project.new.wizard.module.identification"); - final NamePathComponent component = new NamePathComponent(IdeBundle.message("label.project.name"), IdeBundle.message( - "label.component.file.location", StringUtil.capitalize(modulePresentation)), IdeBundle.message( - "title.select.project.file.directory", modulePresentation), IdeBundle.message("description.select.project.file.directory", - StringUtil.capitalize(modulePresentation)), true, false); - final DialogWrapper copyModuleDialog = new DialogWrapper(myTree, false) { - { - setTitle(ProjectBundle.message("copy.module.dialog.title")); - init(); - } + final NamePathComponent component = new NamePathComponent(IdeBundle.message("label.module.name"), IdeBundle.message("label.component.file.location", StringUtil.capitalize(modulePresentation)), IdeBundle.message("title.select.project.file.directory", modulePresentation), + IdeBundle.message("description.select.project.file.directory", StringUtil.capitalize(modulePresentation)), true, + false); + final Module originalModule = moduleEditor.getModule(); + if (originalModule != null) { + component.setPath(PathUtil.getParentPath(originalModule.getModuleFilePath())); + } - public JComponent getPreferredFocusedComponent() { - return component.getNameComponent(); - } - - @Nullable - protected JComponent createCenterPanel() { - return component; - } - - protected void doOKAction() { + final DialogBuilder dialogBuilder = new DialogBuilder(myTree); + dialogBuilder.setTitle(ProjectBundle.message("copy.module.dialog.title")); + dialogBuilder.setCenterPanel(component); + dialogBuilder.setPreferedFocusComponent(component.getNameComponent()); + dialogBuilder.setOkOperation(new Runnable() { + @Override + public void run() { if (component.getNameValue().length() == 0) { Messages.showErrorDialog(ProjectBundle.message("enter.module.copy.name.error.message"), CommonBundle.message("title.error")); return; @@ -815,16 +813,17 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple return; } if (!ProjectWizardUtil - .createDirectoryIfNotExists(IdeBundle.message("directory.project.file.directory", modulePresentation), component.getPath(), true)) { + .createDirectoryIfNotExists(IdeBundle.message("directory.project.file.directory", modulePresentation), component.getPath(), + true)) { Messages.showErrorDialog(ProjectBundle.message("path.0.is.invalid.error.message", component.getPath()), CommonBundle.message("title.error")); return; } - super.doOKAction(); + dialogBuilder.getDialogWrapper().close(DialogWrapper.OK_EXIT_CODE); } - }; - copyModuleDialog.show(); - if (!copyModuleDialog.isOK()) return; - final ModifiableRootModel rootModel = ((ModuleConfigurable)namedConfigurable).getModuleEditor().getModifiableRootModel(); + }); + if (dialogBuilder.show() != DialogWrapper.OK_EXIT_CODE) return; + + final ModifiableRootModel rootModel = moduleEditor.getModifiableRootModel(); final String path = component.getPath(); final ModuleBuilder builder = new ModuleBuilder() { public void setupRootModel(final ModifiableRootModel modifiableRootModel) throws ConfigurationException { diff --git a/java/java-impl/src/com/intellij/lang/java/JavaCommenter.java b/java/java-impl/src/com/intellij/lang/java/JavaCommenter.java index ea5118e52944..4d20c1a9b393 100644 --- a/java/java-impl/src/com/intellij/lang/java/JavaCommenter.java +++ b/java/java-impl/src/com/intellij/lang/java/JavaCommenter.java @@ -85,6 +85,6 @@ public class JavaCommenter implements CodeDocumentationAwareCommenterEx { public boolean isDocumentationCommentText(final PsiElement element) { if (element == null) return false; final ASTNode node = element.getNode(); - return node != null && node.getElementType() == JavaDocTokenType.DOC_COMMENT_DATA; + return node != null && (node.getElementType() == JavaDocTokenType.DOC_COMMENT_DATA || node.getElementType() == JavaDocTokenType.DOC_TAG_VALUE_TOKEN); } } diff --git a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java index af569088d49e..a8b269f15608 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java +++ b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java @@ -30,7 +30,6 @@ import com.intellij.openapi.ui.VerticalFlowLayout; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.Ref; -import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.psi.PsiCodeFragment; @@ -47,7 +46,7 @@ import com.intellij.ui.treeStructure.Tree; import com.intellij.util.Alarm; import com.intellij.util.Consumer; import com.intellij.util.PlatformIcons; -import com.intellij.util.ui.MacUIUtil; +import com.intellij.util.ui.UIUtil; import com.intellij.util.ui.table.JBListTable; import com.intellij.util.ui.table.JBTableRow; import com.intellij.util.ui.table.JBTableRowEditor; @@ -282,7 +281,13 @@ public abstract class ChangeSignatureDialogBase

() { @Override public Boolean compute() { - return CopyFilesOrDirectoriesHandler.checkFileExist(targetDirectory, choice, file, file.getName()); + return CopyFilesOrDirectoriesHandler.checkFileExist(targetDirectory, choice, file, file.getName(), "Move"); } }); if (fileExist) continue; diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameProcessor.java b/platform/lang-impl/src/com/intellij/refactoring/rename/RenameProcessor.java index 60cb7ac1dbeb..77cb4110667c 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameProcessor.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/RenameProcessor.java @@ -307,7 +307,7 @@ public class RenameProcessor extends BaseRefactoringProcessor { if (entry.getKey() instanceof PsiFile) { final PsiFile file = (PsiFile)entry.getKey(); final PsiDirectory containingDirectory = file.getContainingDirectory(); - if (CopyFilesOrDirectoriesHandler.checkFileExist(containingDirectory, choice, file, entry.getValue())) { + if (CopyFilesOrDirectoriesHandler.checkFileExist(containingDirectory, choice, file, entry.getValue(), "Rename")) { iterator.remove(); continue; } diff --git a/platform/platform-impl/src/com/intellij/util/ui/table/JBListTable.java b/platform/platform-impl/src/com/intellij/util/ui/table/JBListTable.java index b9a95273df92..f1497fcedde4 100644 --- a/platform/platform-impl/src/com/intellij/util/ui/table/JBListTable.java +++ b/platform/platform-impl/src/com/intellij/util/ui/table/JBListTable.java @@ -56,11 +56,13 @@ public abstract class JBListTable extends JPanel { mainTable = new JBTable(model) { @Override protected void processKeyEvent(KeyEvent e) { + if (e.isAltDown()) return; if (e.getKeyCode() == KeyEvent.VK_ENTER && e.getModifiers() == 0) { if (!isEditing() && e.getID() == KeyEvent.KEY_PRESSED) { editCellAt(getSelectedRow(), getSelectedColumn()); } e.consume(); + return; } //todo[kb] JBTabsImpl breaks focus traversal policy. Need a workaround here else if (e.getKeyCode() == KeyEvent.VK_TAB) { @@ -73,10 +75,9 @@ public abstract class JBListTable extends JPanel { } } e.consume(); + return; } - else { - super.processKeyEvent(e); - } + super.processKeyEvent(e); } @Override diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerHistoryManager.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerHistoryManager.java index e8557400aafe..71cd07f8e16e 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerHistoryManager.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerHistoryManager.java @@ -34,7 +34,8 @@ public class XDebuggerHistoryManager { } public void addRecentExpression(@NotNull @NonNls String id, @NotNull String expression) { - if (expression.trim().length() == 0) return; + final String trimmedExpression = expression.trim(); + if (trimmedExpression.length() == 0) return; LinkedList list = myRecentExpressions.get(id); if (list == null) { @@ -44,8 +45,8 @@ public class XDebuggerHistoryManager { if (list.size() == MAX_RECENT_EXPRESSIONS) { list.removeLast(); } - list.remove(expression); - list.addFirst(expression); + list.remove(trimmedExpression); + list.addFirst(trimmedExpression); } public List getRecentExpressions(@NonNls String id) {