use of com.intellij.ui.EditorNotificationPanel in project intellij-community by JetBrains.
the class CCSubtaskEditorNotificationProvider method createNotificationPanel.
@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) {
if (!CCUtils.isCourseCreator(myProject)) {
return null;
}
boolean isTestFile = CCUtils.isTestsFile(myProject, file);
if (!isTestFile && StudyUtils.getTaskFile(myProject, file) == null) {
return null;
}
Task task = StudyUtils.getTaskForFile(myProject, file);
if (task == null || !task.hasSubtasks()) {
return null;
}
EditorNotificationPanel panel = new EditorNotificationPanel(EditorColors.GUTTER_BACKGROUND);
String header = (isTestFile ? "test" : "task") + " file";
int activeSubtaskIndex = task.getActiveSubtaskIndex() + 1;
int subtaskSize = task.getLastSubtaskIndex() + 1;
panel.setText("This is a " + header + " for " + EduNames.SUBTASK + " " + activeSubtaskIndex + "/" + subtaskSize);
panel.createActionLabel(SWITCH_SUBTASK, () -> createPopup(task, myProject).show(RelativePoint.getSouthEastOf(panel)));
return panel;
}
use of com.intellij.ui.EditorNotificationPanel in project intellij-community by JetBrains.
the class JavaFxSdkSetupNotificationTest method testJavaFxAsLibrary.
public void testJavaFxAsLibrary() throws Exception {
ModuleRootModificationUtil.updateModel(myModule, model -> AbstractJavaFXTestCase.addJavaFxJarAsLibrary(myModule, model));
final EditorNotificationPanel panel = configureBySdkAndText(IdeaTestUtil.getMockJdk18(), false, "sample.fxml", SAMPLE_FXML);
assertNull(panel);
}
use of com.intellij.ui.EditorNotificationPanel in project intellij-community by JetBrains.
the class JavaFxSdkSetupNotificationTest method testJavaFxInModuleSdk.
public void testJavaFxInModuleSdk() throws Exception {
final EditorNotificationPanel panel = configureBySdkAndText(getTestJdk(), true, "sample.fxml", SAMPLE_FXML);
assertNull(panel);
}
use of com.intellij.ui.EditorNotificationPanel in project intellij-community by JetBrains.
the class JavaFxSdkSetupNotificationTest method testJavaFxInProjectSdk.
public void testJavaFxInProjectSdk() throws Exception {
final EditorNotificationPanel panel = configureBySdkAndText(getTestJdk(), false, "sample.fxml", SAMPLE_FXML);
assertNull(panel);
}
use of com.intellij.ui.EditorNotificationPanel in project intellij-community by JetBrains.
the class JavaFxSdkSetupNotificationTest method testNoJavaFx.
public void testNoJavaFx() throws Exception {
final EditorNotificationPanel panel = configureBySdkAndText(IdeaTestUtil.getMockJdk17(), false, "sample.fxml", SAMPLE_FXML);
assertSdkSetupPanelShown(panel, "The JavaFX runtime is not configured");
}
Aggregations