1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-03-02 16:22:31 +01:00

Renamed MorePanel to ExOutputPanel

This commit is contained in:
Andrey Vlasovskikh 2014-04-03 22:58:45 +04:00
parent 4540c75498
commit a076b4d71c
10 changed files with 42 additions and 42 deletions

View File

@ -26,7 +26,7 @@ import com.maddyhome.idea.vim.ex.CommandHandler;
import com.maddyhome.idea.vim.ex.ExCommand;
import com.maddyhome.idea.vim.ex.ExException;
import com.maddyhome.idea.vim.group.HistoryGroup;
import com.maddyhome.idea.vim.ui.MorePanel;
import com.maddyhome.idea.vim.ui.ExOutputPanel;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@ -148,7 +148,7 @@ public class HistoryHandler extends CommandHandler {
break;
}
MorePanel panel = MorePanel.getInstance(editor);
ExOutputPanel panel = ExOutputPanel.getInstance(editor);
panel.setText(res.toString());
return true;

View File

@ -30,7 +30,7 @@ import com.maddyhome.idea.vim.ex.ExException;
import com.maddyhome.idea.vim.helper.EditorData;
import com.maddyhome.idea.vim.helper.EditorHelper;
import com.maddyhome.idea.vim.helper.StringHelper;
import com.maddyhome.idea.vim.ui.MorePanel;
import com.maddyhome.idea.vim.ui.ExOutputPanel;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@ -89,7 +89,7 @@ public class JumpsHandler extends CommandHandler {
text.append(">\n");
}
MorePanel panel = MorePanel.getInstance(editor);
ExOutputPanel panel = ExOutputPanel.getInstance(editor);
panel.setText(text.toString());
return true;

View File

@ -25,7 +25,7 @@ import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.command.MappingMode;
import com.maddyhome.idea.vim.ex.*;
import com.maddyhome.idea.vim.key.KeyMapping;
import com.maddyhome.idea.vim.ui.MorePanel;
import com.maddyhome.idea.vim.ui.ExOutputPanel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -101,7 +101,7 @@ public class MapHandler extends CommandHandler implements VimrcCommandHandler {
builder.append(toKeyNotation(row.getToKeys()));
builder.append("\n");
}
final MorePanel panel = MorePanel.getInstance(editor);
final ExOutputPanel panel = ExOutputPanel.getInstance(editor);
panel.setText(builder.toString());
return true;
}

View File

@ -30,7 +30,7 @@ import com.maddyhome.idea.vim.ex.ExException;
import com.maddyhome.idea.vim.helper.EditorData;
import com.maddyhome.idea.vim.helper.EditorHelper;
import com.maddyhome.idea.vim.helper.StringHelper;
import com.maddyhome.idea.vim.ui.MorePanel;
import com.maddyhome.idea.vim.ui.ExOutputPanel;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@ -77,7 +77,7 @@ public class MarksHandler extends CommandHandler {
text.append("\n");
}
MorePanel panel = MorePanel.getInstance(editor);
ExOutputPanel panel = ExOutputPanel.getInstance(editor);
panel.setText(text.toString());
//panel.setVisible(true);

View File

@ -27,7 +27,7 @@ import com.maddyhome.idea.vim.ex.CommandName;
import com.maddyhome.idea.vim.ex.ExCommand;
import com.maddyhome.idea.vim.ex.ExException;
import com.maddyhome.idea.vim.helper.StringHelper;
import com.maddyhome.idea.vim.ui.MorePanel;
import com.maddyhome.idea.vim.ui.ExOutputPanel;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@ -57,7 +57,7 @@ public class RegistersHandler extends CommandHandler {
text.append("\n");
}
MorePanel panel = MorePanel.getInstance(editor);
ExOutputPanel panel = ExOutputPanel.getInstance(editor);
panel.setText(text.toString());
return true;

View File

@ -21,7 +21,7 @@ package com.maddyhome.idea.vim.group;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.helper.EditorHelper;
import com.maddyhome.idea.vim.ui.MorePanel;
import com.maddyhome.idea.vim.ui.ExOutputPanel;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
@ -59,7 +59,7 @@ public class DigraphGroup {
}
private void showDigraphs(@NotNull Editor editor) {
MorePanel panel = MorePanel.getInstance(editor);
ExOutputPanel panel = ExOutputPanel.getInstance(editor);
int width = EditorHelper.getScreenWidth(editor);
if (width < 10) {
width = 80;

View File

@ -44,7 +44,7 @@ import com.maddyhome.idea.vim.option.BoundStringOption;
import com.maddyhome.idea.vim.option.NumberOption;
import com.maddyhome.idea.vim.option.Options;
import com.maddyhome.idea.vim.ui.ExEntryPanel;
import com.maddyhome.idea.vim.ui.MorePanel;
import com.maddyhome.idea.vim.ui.ExOutputPanel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -142,7 +142,7 @@ public class MotionGroup {
ExEntryPanel.getInstance().deactivate();
}
MorePanel.getInstance(editor).deactivate();
ExOutputPanel.getInstance(editor).deactivate();
CommandState.SubMode visualMode = CommandState.SubMode.NONE;
switch (event.getClickCount() % 3) {
@ -218,7 +218,7 @@ public class MotionGroup {
ExEntryPanel.getInstance().deactivate();
}
MorePanel.getInstance(editor).deactivate();
ExOutputPanel.getInstance(editor).deactivate();
if (update) {
if (CommandState.getInstance(editor).getMode() == CommandState.Mode.VISUAL) {
@ -253,7 +253,7 @@ public class MotionGroup {
ExEntryPanel.getInstance().deactivate();
}
MorePanel.getInstance(editor).deactivate();
ExOutputPanel.getInstance(editor).deactivate();
logger.debug("mouse released");
if (CommandState.getInstance(editor).getMode() == CommandState.Mode.VISUAL) {
@ -1768,7 +1768,7 @@ public class MotionGroup {
final FileEditor fileEditor = event.getOldEditor();
if (fileEditor instanceof TextEditor) {
final Editor editor = ((TextEditor)fileEditor).getEditor();
MorePanel.getInstance(editor).deactivate();
ExOutputPanel.getInstance(editor).deactivate();
if (CommandState.getInstance(editor).getMode() == CommandState.Mode.VISUAL) {
VimPlugin.getMotion().exitVisual(EditorHelper.getEditor(event.getManager(), event.getOldFile()), true);
}

View File

@ -28,7 +28,7 @@ import com.intellij.testFramework.LightVirtualFile;
import com.maddyhome.idea.vim.command.CommandState;
import com.maddyhome.idea.vim.command.VisualChange;
import com.maddyhome.idea.vim.command.VisualRange;
import com.maddyhome.idea.vim.ui.MorePanel;
import com.maddyhome.idea.vim.ui.ExOutputPanel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -188,11 +188,11 @@ public class EditorData {
return res != null;
}
public static MorePanel getMorePanel(Editor editor) {
public static ExOutputPanel getMorePanel(Editor editor) {
return editor.getUserData(MORE_PANEL);
}
public static void setMorePanel(@NotNull Editor editor, @NotNull MorePanel panel) {
public static void setMorePanel(@NotNull Editor editor, @NotNull ExOutputPanel panel) {
editor.putUserData(MORE_PANEL, panel);
}
@ -221,7 +221,7 @@ public class EditorData {
private static final Key<CommandState> COMMAND_STATE = new Key<CommandState>("commandState");
private static final Key<Boolean> CHANGE_GROUP = new Key<Boolean>("changeGroup");
private static final Key<Boolean> MOTION_GROUP = new Key<Boolean>("motionGroup");
private static final Key<MorePanel> MORE_PANEL = new Key<MorePanel>("IdeaVim.morePanel");
private static final Key<ExOutputPanel> MORE_PANEL = new Key<ExOutputPanel>("IdeaVim.morePanel");
private static Key CONSOLE_VIEW_IN_EDITOR_VIEW = Key.create("CONSOLE_VIEW_IN_EDITOR_VIEW");

View File

@ -23,7 +23,7 @@ import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.helper.EditorHelper;
import com.maddyhome.idea.vim.helper.MessageHelper;
import com.maddyhome.idea.vim.helper.Msg;
import com.maddyhome.idea.vim.ui.MorePanel;
import com.maddyhome.idea.vim.ui.ExOutputPanel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -366,7 +366,7 @@ public class Options {
Collections.sort(extra, new Option.NameSorter<Option>());
String pad = " ";
MorePanel panel = MorePanel.getInstance(editor);
ExOutputPanel panel = ExOutputPanel.getInstance(editor);
int width = EditorHelper.getScreenWidth(editor);
if (width < 20) {
width = 80;

View File

@ -43,7 +43,7 @@ import java.util.List;
/**
* This panel displays text in a <code>more</code> like window.
*/
public class MorePanel extends JPanel {
public class ExOutputPanel extends JPanel {
@NotNull private final Editor myEditor;
@NotNull private JLabel myLabel = new JLabel("more");
@ -60,7 +60,7 @@ public class MorePanel extends JPanel {
private boolean myActive = false;
private MorePanel(@NotNull Editor editor) {
private ExOutputPanel(@NotNull Editor editor) {
myEditor = editor;
// Create a text editor for the text and a label for the prompt
@ -96,10 +96,10 @@ public class MorePanel extends JPanel {
}
@NotNull
public static MorePanel getInstance(@NotNull Editor editor) {
MorePanel panel = EditorData.getMorePanel(editor);
public static ExOutputPanel getInstance(@NotNull Editor editor) {
ExOutputPanel panel = EditorData.getMorePanel(editor);
if (panel == null) {
panel = new MorePanel(editor);
panel = new ExOutputPanel(editor);
EditorData.setMorePanel(editor, panel);
}
return panel;
@ -298,50 +298,50 @@ public class MorePanel extends JPanel {
}
private static class MoreKeyListener extends KeyAdapter {
private MorePanel myMorePanel;
private ExOutputPanel myExOutputPanel;
public MoreKeyListener(MorePanel panel) {
this.myMorePanel = panel;
public MoreKeyListener(ExOutputPanel panel) {
this.myExOutputPanel = panel;
}
/**
* Invoked when a key has been pressed.
*/
public void keyTyped(@NotNull KeyEvent e) {
if (myMorePanel.myAtEnd) {
myMorePanel.close(e);
if (myExOutputPanel.myAtEnd) {
myExOutputPanel.close(e);
}
else {
switch (e.getKeyChar()) {
case ' ':
myMorePanel.scrollPage();
myExOutputPanel.scrollPage();
break;
case 'd':
myMorePanel.scrollHalfPage();
myExOutputPanel.scrollHalfPage();
break;
case 'q':
myMorePanel.close();
myExOutputPanel.close();
break;
case '\n':
myMorePanel.handleEnter();
myExOutputPanel.handleEnter();
break;
case '\u001b':
myMorePanel.close();
myExOutputPanel.close();
break;
case KeyEvent.CHAR_UNDEFINED: {
switch (e.getKeyCode()) {
case KeyEvent.VK_ENTER:
myMorePanel.handleEnter();
myExOutputPanel.handleEnter();
break;
case KeyEvent.VK_ESCAPE:
myMorePanel.close();
myExOutputPanel.close();
break;
default:
myMorePanel.badKey();
myExOutputPanel.badKey();
}
}
default:
myMorePanel.badKey();
myExOutputPanel.badKey();
}
}
}