mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
[IFT] Rework Python and Java run lessons and adjust them for the new UI
IJ-CR-103403 GitOrigin-RevId: 88218a3ef100af6592eea13a2ea3ee4c3a8070c6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bc6abbde05
commit
0291a4ce92
@@ -22,5 +22,6 @@
|
||||
<orderEntry type="library" name="kotlinx-serialization-core" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-serialization-json" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.java.execution.impl" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -80,8 +80,9 @@ java.basic.completion.deeper.level=Sometimes, you need to see suggestions for st
|
||||
Press {0} twice to get them in the lookup.
|
||||
java.basic.completion.module.promotion=You will find more about refactorings in the {0} module.
|
||||
|
||||
java.run.configuration.lets.run=Any code marked with {0} can be run. Let''s run our simple example with {1}. \
|
||||
Alternatively, you can click {0} and select the {2} item.
|
||||
java.run.configuration.lets.run=There are more than one way to run your code. \
|
||||
Let''s try to run it from gutter this time by clicking {0} and selecting the {1} item. \
|
||||
Alternatively, you can press {2}.
|
||||
|
||||
java.postfix.completion.type=Type {0} after the parenthesis to see the list of postfix completion suggestions.
|
||||
java.postfix.completion.complete=Select {0} from the list or type the same value in the editor. Press {1} to complete the statement.
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.intellij.java.ift.lesson.run
|
||||
|
||||
import com.intellij.codeInsight.daemon.LineMarkerInfo
|
||||
import com.intellij.execution.ExecutionBundle
|
||||
import com.intellij.execution.application.ApplicationConfiguration
|
||||
import com.intellij.icons.AllIcons
|
||||
import com.intellij.java.ift.JavaLessonsBundle
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys
|
||||
@@ -35,8 +36,10 @@ class JavaRunConfigurationLesson : CommonRunConfigurationLesson("java.run.config
|
||||
}
|
||||
|
||||
task("RunClass") {
|
||||
text(JavaLessonsBundle.message("java.run.configuration.lets.run", icon(AllIcons.Actions.Execute), action(it),
|
||||
strong(ExecutionBundle.message("default.runner.start.action.text").dropMnemonic())))
|
||||
text(JavaLessonsBundle.message("java.run.configuration.lets.run",
|
||||
icon(AllIcons.RunConfigurations.TestState.Run),
|
||||
strong(ExecutionBundle.message("default.runner.start.action.text").dropMnemonic()),
|
||||
action(it)))
|
||||
timerCheck { configurations().isNotEmpty() }
|
||||
//Wait toolwindow
|
||||
checkToolWindowState("Run", true)
|
||||
@@ -46,7 +49,16 @@ class JavaRunConfigurationLesson : CommonRunConfigurationLesson("java.run.config
|
||||
}
|
||||
}
|
||||
|
||||
override val sampleFilePath: String = "src/${JavaRunLessonsUtils.demoClassName}.java"
|
||||
override fun LessonContext.addAnotherRunConfiguration() {
|
||||
prepareRuntimeTask {
|
||||
addNewRunConfigurationFromContext { runConfiguration ->
|
||||
runConfiguration.name = demoWithParametersName
|
||||
(runConfiguration as ApplicationConfiguration).programParameters = "hello world"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override val sampleFilePath: String = "src/${demoClassName}.java"
|
||||
}
|
||||
|
||||
internal fun TaskContext.highlightRunGutters(highlightInside: Boolean = false, usePulsation: Boolean = false) {
|
||||
@@ -56,10 +68,8 @@ internal fun TaskContext.highlightRunGutters(highlightInside: Boolean = false, u
|
||||
}.componentPart l@{ ui: EditorGutterComponentEx ->
|
||||
if (CommonDataKeys.EDITOR.getData(ui as DataProvider) != editor) return@l null
|
||||
val runGutterLines = (0 until editor.document.lineCount).mapNotNull { lineInd ->
|
||||
val gutter = ui.getGutterRenderers(lineInd).singleOrNull() ?: return@mapNotNull null
|
||||
if ((gutter as? LineMarkerInfo.LineMarkerGutterIconRenderer<*>)?.featureId == "run") {
|
||||
if (ui.getGutterRenderers(lineInd).any { (it as? LineMarkerInfo.LineMarkerGutterIconRenderer<*>)?.featureId == "run" })
|
||||
lineInd
|
||||
}
|
||||
else null
|
||||
}
|
||||
if (runGutterLines.size < 2) return@l null
|
||||
|
||||
Reference in New Issue
Block a user