From aad6ca05686f1587a21d1a5953b0d52c76c908be Mon Sep 17 00:00:00 2001 From: Alexander Lobas Date: Fri, 16 Nov 2012 16:10:11 +0400 Subject: [PATCH 1/2] IDEA-93121 --- .../android/designer/propertyTable/editors/ResourceEditor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/android-designer/src/com/intellij/android/designer/propertyTable/editors/ResourceEditor.java b/plugins/android-designer/src/com/intellij/android/designer/propertyTable/editors/ResourceEditor.java index 902845abc9b2..0074a704f24e 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/propertyTable/editors/ResourceEditor.java +++ b/plugins/android-designer/src/com/intellij/android/designer/propertyTable/editors/ResourceEditor.java @@ -32,6 +32,7 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptor; import com.intellij.openapi.ui.ComboBox; import com.intellij.openapi.ui.ComponentWithBrowseButton; import com.intellij.openapi.ui.TextFieldWithBrowseButton; +import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.ComboboxWithBrowseButton; import com.intellij.ui.DocumentAdapter; @@ -89,7 +90,7 @@ public class ResourceEditor extends PropertyEditor { }); } else if (formats.contains(AttributeFormat.Enum)) { - ComboboxWithBrowseButton editor = new ComboboxWithBrowseButton(new ComboBox()) { + ComboboxWithBrowseButton editor = new ComboboxWithBrowseButton(SystemInfo.isWindows ? new ComboBox() : new JComboBox()) { @Override public Dimension getPreferredSize() { return getComponentPreferredSize(); From 3608d978f83719f96ec8359fc24f45978c224683 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Fri, 16 Nov 2012 16:31:45 +0400 Subject: [PATCH 2/2] Make sure Del removes project from the recents list --- .../welcomeScreen/RecentProjectPanel.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java index 04168ceb25f2..d334d6be913f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java @@ -24,9 +24,11 @@ import com.intellij.ide.ReopenProjectAction; import com.intellij.openapi.actionSystem.ActionPlaces; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.VerticalFlowLayout; import com.intellij.ui.ClickListener; import com.intellij.ui.Gray; +import com.intellij.ui.ListUtil; import com.intellij.ui.components.JBList; import com.intellij.ui.components.JBScrollPane; import com.intellij.util.ui.UIUtil; @@ -72,6 +74,28 @@ public class RecentProjectPanel extends JPanel { } }, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + ActionListener deleteAction = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ReopenProjectAction selection = (ReopenProjectAction)myList.getSelectedValue(); + + final int rc = Messages.showOkCancelDialog(RecentProjectPanel.this, + "Remove '" + selection.getTemplatePresentation().getText() + + "' from recent projects list?", + "Remove Recent Project", + Messages.getQuestionIcon()); + if (rc == 0) { + final RecentProjectsManagerBase manager = RecentProjectsManagerBase.getInstance(); + + manager.removePath(selection.getProjectPath()); + ListUtil.removeSelectedItems(myList); + } + } + }; + + myList.registerKeyboardAction(deleteAction, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + myList.registerKeyboardAction(deleteAction, KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + myList.addMouseMotionListener(new MouseMotionAdapter() { boolean myIsEngaged = false; public void mouseMoved(MouseEvent e) {