Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
5bce63b1
Commit
5bce63b1
authored
6 years ago
by
Sergey Simonchik
Browse files
Options
Download
Email Patches
Plain Diff
terminal: use kotlin properly; fix tests (IDEA-CR-46423)
parent
15adb6be
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
platform/platform-impl/src/com/intellij/terminal/JBTerminalSystemSettingsProviderBase.java
+2
-2
...tellij/terminal/JBTerminalSystemSettingsProviderBase.java
platform/testFramework/extensions/src/com/intellij/keymap/KeymapsTestCase.java
+6
-6
...k/extensions/src/com/intellij/keymap/KeymapsTestCase.java
plugins/terminal/resources/META-INF/plugin.xml
+2
-2
plugins/terminal/resources/META-INF/plugin.xml
plugins/terminal/src/org/jetbrains/plugins/terminal/TerminalView.java
+4
-4
...inal/src/org/jetbrains/plugins/terminal/TerminalView.java
plugins/terminal/src/org/jetbrains/plugins/terminal/action/MoveTerminalToolwindowTabLeftAction.kt
+0
-7
...ns/terminal/action/MoveTerminalToolwindowTabLeftAction.kt
plugins/terminal/src/org/jetbrains/plugins/terminal/action/MoveTerminalToolwindowTabLeftRightAction.kt
+9
-6
...rminal/action/MoveTerminalToolwindowTabLeftRightAction.kt
plugins/terminal/src/org/jetbrains/plugins/terminal/action/MoveTerminalToolwindowTabRightAction.kt
+0
-5
...s/terminal/action/MoveTerminalToolwindowTabRightAction.kt
with
23 additions
and
32 deletions
+23
-32
platform/platform-impl/src/com/intellij/terminal/JBTerminalSystemSettingsProviderBase.java
+
2
-
2
View file @
5bce63b1
...
...
@@ -143,11 +143,11 @@ public class JBTerminalSystemSettingsProviderBase extends DefaultTabbedSettingsP
}
public
KeyStroke
[]
getMoveTabRightKeyStrokes
()
{
return
getKeyStrokesByActionId
(
"Terminal.MoveTool
w
indowTabRight"
);
return
getKeyStrokesByActionId
(
"Terminal.MoveTool
W
indowTabRight"
);
}
public
KeyStroke
[]
getMoveTabLeftKeyStrokes
()
{
return
getKeyStrokesByActionId
(
"Terminal.MoveTool
w
indowTabLeft"
);
return
getKeyStrokesByActionId
(
"Terminal.MoveTool
W
indowTabLeft"
);
}
protected
static
int
consoleFontSize
(
MyColorSchemeDelegate
colorScheme
)
{
...
...
This diff is collapsed.
Click to expand it.
platform/testFramework/extensions/src/com/intellij/keymap/KeymapsTestCase.java
+
6
-
6
View file @
5bce63b1
...
...
@@ -86,8 +86,8 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase {
{
"shift control F8"
,
"ViewBreakpoints"
,
"EditBreakpoint"
},
{
"shift control G"
,
"ClassTemplateNavigation"
,
"GoToClass"
},
{
"shift control H"
,
"ChangesView.ShelveSilently"
,
"MethodHierarchy"
},
{
"shift control LEFT"
,
"EditorPreviousWordWithSelection"
,
"ResizeToolWindowLeft"
,
},
{
"shift control RIGHT"
,
"EditorNextWordWithSelection"
,
"ResizeToolWindowRight"
,
},
{
"shift control LEFT"
,
"EditorPreviousWordWithSelection"
,
"ResizeToolWindowLeft"
,
"Terminal.MoveToolWindowTabLeft"
},
{
"shift control RIGHT"
,
"EditorNextWordWithSelection"
,
"ResizeToolWindowRight"
,
"Terminal.MoveToolWindowTabRight"
},
{
"shift control T"
,
"GotoTest"
,
"Images.ShowThumbnails"
,
"RunDashboard.ShowConfigurations"
},
{
"shift control UP"
,
"ResizeToolWindowUp"
,
"MoveStatementUp"
},
{
"shift control alt D"
,
"UML.ShowChanges"
,
"Console.TableResult.CloneColumn"
},
...
...
@@ -129,8 +129,8 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase {
{
"shift ctrl RIGHT"
,
"Diff.ApplyLeftSide"
,
"NextEditorTab"
},
{
"shift meta G"
,
"ClassTemplateNavigation"
,
"GoToClass"
,
"FindPrevious"
},
{
"shift meta M"
,
"ChangesView.Move"
,
"Vcs.MoveChangedLinesToChangelist"
},
{
"shift meta LEFT"
,
"EditorLineStartWithSelection"
,
"ResizeToolWindowLeft"
,
},
{
"shift meta RIGHT"
,
"EditorLineEndWithSelection"
,
"ResizeToolWindowRight"
,
},
{
"shift meta LEFT"
,
"EditorLineStartWithSelection"
,
"ResizeToolWindowLeft"
,
"Terminal.MoveToolWindowTabLeft"
},
{
"shift meta RIGHT"
,
"EditorLineEndWithSelection"
,
"ResizeToolWindowRight"
,
"Terminal.MoveToolWindowTabRight"
},
{
"shift meta CLOSE_BRACKET"
,
"Diff.NextChange"
,
"NextTab"
},
{
"shift meta OPEN_BRACKET"
,
"Diff.PrevChange"
,
"PreviousTab"
},
{
"alt R"
,
"Django.RunManageTaskAction"
,
"org.jetbrains.plugins.ruby.tasks.rake.actions.RakeTasksPopupAction"
},
...
...
@@ -157,8 +157,8 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase {
{
"meta 3"
,
"ActivateFindToolWindow"
,
"FileChooser.GotoModule"
},
{
"shift ctrl LEFT"
,
"Diff.ApplyRightSide"
,
"PreviousEditorTab"
},
{
"shift ctrl RIGHT"
,
"Diff.ApplyLeftSide"
,
"NextEditorTab"
},
{
"shift meta LEFT"
,
"EditorLineStartWithSelection"
,
"ResizeToolWindowLeft"
,
},
{
"shift meta RIGHT"
,
"EditorLineEndWithSelection"
,
"ResizeToolWindowRight"
,
},
{
"shift meta LEFT"
,
"EditorLineStartWithSelection"
,
"ResizeToolWindowLeft"
,
"Terminal.MoveToolWindowTabLeft"
},
{
"shift meta RIGHT"
,
"EditorLineEndWithSelection"
,
"ResizeToolWindowRight"
,
"Terminal.MoveToolWindowTabRight"
},
{
"alt R"
,
"Django.RunManageTaskAction"
,
"org.jetbrains.plugins.ruby.tasks.rake.actions.RakeTasksPopupAction"
},
});
put
(
"Emacs"
,
new
String
[][]
{
...
...
This diff is collapsed.
Click to expand it.
plugins/terminal/resources/META-INF/plugin.xml
+
2
-
2
View file @
5bce63b1
...
...
@@ -22,12 +22,12 @@
<action
id=
"Terminal.MoveToEditor"
class=
"org.jetbrains.plugins.terminal.action.MoveTerminalSessionToEditorAction"
text=
"Move to Editor"
>
<add-to-group
group-id=
"ToolWindowContextMenu"
anchor=
"last"
/>
</action>
<action
id=
"Terminal.MoveTool
w
indowTabLeft"
class=
"org.jetbrains.plugins.terminal.action.MoveTerminalTool
w
indowTabLeftAction"
<action
id=
"Terminal.MoveTool
W
indowTabLeft"
class=
"org.jetbrains.plugins.terminal.action.MoveTerminalTool
W
indowTabLeftAction"
text=
"Move Left"
>
<keyboard-shortcut
first-keystroke=
"control shift LEFT"
keymap=
"$default"
/>
<add-to-group
group-id=
"ToolWindowContextMenu"
anchor=
"last"
/>
</action>
<action
id=
"Terminal.MoveTool
w
indowTabRight"
class=
"org.jetbrains.plugins.terminal.action.MoveTerminalTool
w
indowTabRightAction"
<action
id=
"Terminal.MoveTool
W
indowTabRight"
class=
"org.jetbrains.plugins.terminal.action.MoveTerminalTool
W
indowTabRightAction"
text=
"Move Right"
>
<keyboard-shortcut
first-keystroke=
"control shift RIGHT"
keymap=
"$default"
/>
<add-to-group
group-id=
"ToolWindowContextMenu"
anchor=
"last"
/>
...
...
This diff is collapsed.
Click to expand it.
plugins/terminal/src/org/jetbrains/plugins/terminal/TerminalView.java
+
4
-
4
View file @
5bce63b1
...
...
@@ -52,8 +52,8 @@ import com.intellij.util.ObjectUtils;
import
com.intellij.util.text.UniqueNameGenerator
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.plugins.terminal.action.MoveTerminalTool
w
indowTabLeftAction
;
import
org.jetbrains.plugins.terminal.action.MoveTerminalTool
w
indowTabRightAction
;
import
org.jetbrains.plugins.terminal.action.MoveTerminalTool
W
indowTabLeftAction
;
import
org.jetbrains.plugins.terminal.action.MoveTerminalTool
W
indowTabRightAction
;
import
org.jetbrains.plugins.terminal.action.RenameTerminalSessionAction
;
import
org.jetbrains.plugins.terminal.arrangement.TerminalArrangementManager
;
import
org.jetbrains.plugins.terminal.arrangement.TerminalArrangementState
;
...
...
@@ -205,8 +205,8 @@ public class TerminalView {
}
JBTerminalWidget
finalTerminalWidget
=
terminalWidget
;
MoveTerminalTool
w
indowTabLeftAction
moveTabLeftAction
=
new
MoveTerminalTool
w
indowTabLeftAction
();
MoveTerminalTool
w
indowTabRightAction
moveTabRightAction
=
new
MoveTerminalTool
w
indowTabRightAction
();
MoveTerminalTool
W
indowTabLeftAction
moveTabLeftAction
=
new
MoveTerminalTool
W
indowTabLeftAction
();
MoveTerminalTool
W
indowTabRightAction
moveTabRightAction
=
new
MoveTerminalTool
W
indowTabRightAction
();
terminalWidget
.
setListener
(
new
JBTerminalWidgetListener
()
{
@Override
public
void
onNewSession
()
{
...
...
This diff is collapsed.
Click to expand it.
plugins/terminal/src/org/jetbrains/plugins/terminal/action/MoveTerminalToolwindowTabLeftAction.kt
deleted
100644 → 0
+
0
-
7
View file @
15adb6be
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package
org.jetbrains.plugins.terminal.action
import
com.intellij.openapi.project.DumbAware
class
MoveTerminalToolwindowTabLeftAction
:
MoveTerminalToolwindowTabLeftRightAction
(
true
)
{
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
plugins/terminal/src/org/jetbrains/plugins/terminal/action/MoveTerminalToolwindowTabLeftRightAction.kt
+
9
-
6
View file @
5bce63b1
...
...
@@ -5,11 +5,10 @@ import com.intellij.openapi.actionSystem.AnActionEvent
import
com.intellij.openapi.project.DumbAware
import
com.intellij.openapi.wm.ToolWindow
import
com.intellij.ui.content.Content
import
java.util.*
open
class
MoveTerminalToolwindowTabLeftRightAction
(
private
val
moveLeft
:
Boolean
)
:
TerminalSessionContextMenuActionBase
(),
DumbAware
{
override
fun
actionPerformed
(
e
:
AnActionEvent
,
toolWindow
:
ToolWindow
,
content
:
Content
?)
{
move
(
content
)
;
move
(
content
)
}
override
fun
update
(
e
:
AnActionEvent
,
activeToolWindow
:
ToolWindow
,
selectedContent
:
Content
?)
{
...
...
@@ -22,16 +21,20 @@ open class MoveTerminalToolwindowTabLeftRightAction(private val moveLeft: Boolea
fun
isAvailable
(
content
:
Content
?)
:
Boolean
{
val
manager
=
content
?.
manager
?:
return
false
val
ind
=
manager
.
getIndexOfContent
(
content
)
return
if
(
moveLeft
)
ind
>
0
else
ind
>=
0
&&
ind
<
manager
.
getC
ontentCount
()
-
1
return
if
(
moveLeft
)
ind
>
0
else
ind
>=
0
&&
ind
<
manager
.
c
ontentCount
-
1
}
fun
move
(
content
:
Content
?)
{
val
manager
=
content
?.
manager
?:
return
val
ind
=
manager
.
getIndexOfContent
(
content
)
val
otherInd
=
if
(
moveLeft
)
ind
-
1
else
ind
+
1
if
(
ind
>=
0
&&
otherInd
>=
0
&&
otherInd
<
manager
.
getC
ontentCount
()
)
{
val
otherContent
=
Objects
.
requireNonNull
<
Content
>(
manager
.
getContent
(
otherInd
)
)
if
(
ind
>=
0
&&
otherInd
>=
0
&&
otherInd
<
manager
.
c
ontentCount
)
{
val
otherContent
=
manager
.
getContent
(
otherInd
)
!!
manager
.
removeContent
(
otherContent
,
false
,
false
,
false
).
doWhenDone
{
manager
.
addContent
(
otherContent
,
ind
)
}
}
}
}
\ No newline at end of file
}
class
MoveTerminalToolWindowTabLeftAction
:
MoveTerminalToolwindowTabLeftRightAction
(
true
)
class
MoveTerminalToolWindowTabRightAction
:
MoveTerminalToolwindowTabLeftRightAction
(
false
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
plugins/terminal/src/org/jetbrains/plugins/terminal/action/MoveTerminalToolwindowTabRightAction.kt
deleted
100644 → 0
+
0
-
5
View file @
15adb6be
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package
org.jetbrains.plugins.terminal.action
class
MoveTerminalToolwindowTabRightAction
:
MoveTerminalToolwindowTabLeftRightAction
(
false
)
{
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help