Merge remote-tracking branch 'origin/master'

This commit is contained in:
Vassiliy Kudryashov
2012-11-16 16:34:14 +04:00
2 changed files with 26 additions and 1 deletions
@@ -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) {
@@ -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();