本文整理汇总了Java中com.intellij.ui.EditorNotificationPanel.setText方法的典型用法代码示例。如果您正苦于以下问题:Java EditorNotificationPanel.setText方法的具体用法?Java EditorNotificationPanel.setText怎么用?Java EditorNotificationPanel.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.EditorNotificationPanel
的用法示例。
在下文中一共展示了EditorNotificationPanel.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNotificationPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@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 instanceof TaskWithSubtasks) {
final TaskWithSubtasks withSubtasks = (TaskWithSubtasks)task;
EditorNotificationPanel panel = new EditorNotificationPanel(EditorColors.GUTTER_BACKGROUND);
String header = (isTestFile ? "test" : "task") + " file";
int activeSubtaskIndex = withSubtasks.getActiveSubtaskIndex() + 1;
int subtaskSize = withSubtasks.getLastSubtaskIndex() + 1;
panel.setText("This is a " + header + " for " + EduNames.SUBTASK + " " + activeSubtaskIndex + "/" + subtaskSize);
panel
.createActionLabel(SWITCH_SUBTASK, () -> createPopup(withSubtasks, myProject).show(RelativePoint.getSouthEastOf(panel)));
return panel;
}
return null;
}
示例2: createPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@NotNull
private static EditorNotificationPanel createPanel(@NotNull final Project project, @NotNull final PsiFile file) {
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(ProjectBundle.message("project.sdk.not.defined"));
panel.createActionLabel(ProjectBundle.message("project.sdk.setup"), new Runnable() {
@Override
public void run() {
final Sdk projectSdk = ProjectSettingsService.getInstance(project).chooseAndSetSdk();
if (projectSdk == null) return;
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
final Module module = ModuleUtilCore.findModuleForPsiElement(file);
if (module != null) {
ModuleRootModificationUtil.setSdkInherited(module);
}
}
});
}
});
return panel;
}
示例3: createPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@NotNull
private static EditorNotificationPanel createPanel(final @NotNull Project project, final @NotNull PsiFile file) {
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(ProjectBundle.message("project.sdk.not.defined"));
panel.createActionLabel(ProjectBundle.message("project.sdk.setup"), new Runnable() {
@Override
public void run() {
final Sdk projectSdk = ProjectSettingsService.getInstance(project).chooseAndSetSdk();
if (projectSdk == null) return;
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
final Module module = ModuleUtilCore.findModuleForPsiElement(file);
if (module != null) {
ModuleRootModificationUtil.setSdkInherited(module);
}
}
});
}
});
return panel;
}
示例4: decorateStubFile
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
private void decorateStubFile(final VirtualFile file, FileEditorManager fileEditorManager, FileEditor editor) {
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText("This stub is generated for Groovy class to make Groovy-Java cross-compilation possible");
panel.createActionLabel("Go to the Groovy class", new Runnable() {
@Override
public void run() {
final PsiClass original = GroovycStubGenerator.findClassByStub(myProject, file);
if (original != null) {
original.navigate(true);
}
}
});
panel.createActionLabel("Exclude from stub generation", new Runnable() {
@Override
public void run() {
final PsiClass psiClass = GroovycStubGenerator.findClassByStub(myProject, file);
if (psiClass != null) {
ExcludeFromStubGenerationAction.doExcludeFromStubGeneration(psiClass.getContainingFile());
}
}
});
fileEditorManager.addTopComponent(editor, panel);
}
示例5: createPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@NotNull
private static EditorNotificationPanel createPanel(final @NotNull Project project, final @NotNull PsiFile file)
{
EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(JavaCoreBundle.message("module.jdk.not.defined"));
panel.createActionLabel(JavaCoreBundle.message("module.jdk.setup"), () ->
{
final Module moduleForPsiElement = ModuleUtilCore.findModuleForPsiElement(file);
if(moduleForPsiElement == null)
{
return;
}
ProjectSettingsService.getInstance(project).openModuleSettings(moduleForPsiElement);
});
return panel;
}
示例6: createNotificationPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(@NotNull final VirtualFile file, @NotNull final FileEditor fileEditor) {
if (!(fileEditor instanceof TextEditor)) return null;
final Editor editor = ((TextEditor)fileEditor).getEditor();
final Project project = editor.getProject();
if (project == null
|| !Boolean.TRUE.equals(editor.getUserData(EditorImpl.FORCED_SOFT_WRAPS))
|| PropertiesComponent.getInstance().isTrueValue(DISABLED_NOTIFICATION_KEY)) return null;
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(EditorBundle.message("forced.soft.wrap.message"));
panel.createActionLabel(EditorBundle.message("forced.soft.wrap.hide.message"), new Runnable() {
@Override
public void run() {
editor.putUserData(EditorImpl.FORCED_SOFT_WRAPS, null);
EditorNotifications.getInstance(project).updateNotifications(file);
}
});
panel.createActionLabel(EditorBundle.message("forced.soft.wrap.dont.show.again.message"), new Runnable() {
@Override
public void run() {
PropertiesComponent.getInstance().setValue(DISABLED_NOTIFICATION_KEY, "true");
EditorNotifications.getInstance(project).updateAllNotifications();
}
});
return panel;
}
示例7: createPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
private EditorNotificationPanel createPanel(@NotNull final VirtualFile file) {
EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(IdeBundle.message("file.changed.externally.message"));
panel.createActionLabel(IdeBundle.message("file.changed.externally.reload"), new Runnable() {
@Override
public void run() {
if (!myProject.isDisposed()) {
file.refresh(false, false);
EditorNotifications.getInstance(myProject).updateNotifications(file);
}
}
});
return panel;
}
示例8: createNotificationPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) {
if (!myChangeTracker.isEditedGeneratedFile(file)) return null;
EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText("Generated source files should not be edited. The changes will be lost when sources are regenerated.");
return panel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GeneratedFileEditingNotificationProvider.java
示例9: syncStarted
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@Override
public void syncStarted(@NotNull Project project) {
if (myUiInitialized) {
myNotificationPanel.removeAll();
EditorNotificationPanel notification = new EditorNotificationPanel();
notification.setText("Gradle project sync in progress...");
myNotificationPanel.add(notification);
revalidateAndRepaint(myNotificationPanel);
}
}
示例10: createNotificationPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) {
AndroidProject androidProject = getAndroidProject(file);
if (androidProject == null) {
return null;
}
VirtualFile buildFolder = VfsUtil.findFileByIoFile(androidProject.getBuildFolder(), false);
if (buildFolder == null || !buildFolder.isDirectory()) {
return null;
}
if (VfsUtilCore.isAncestor(buildFolder, file, false)) {
if (myGeneratedSourceFileChangeTracker.isEditedGeneratedFile(file)) {
// A warning is already being displayed by GeneratedFileEditingNotificationProvider
return null;
}
VirtualFile explodedBundled = buildFolder.findChild(EXPLODED_BUNDLES);
if (explodedBundled == null) {
// 0.8.2+
explodedBundled = buildFolder.findChild(EXPLODED_AAR);
}
boolean inAar = explodedBundled != null && VfsUtilCore.isAncestor(explodedBundled, file, true);
String text;
if (inAar) {
text = "Resource files inside Android library archive files (.aar) should not be edited";
}
else {
text = "Files under the build folder are generated and should not be edited.";
}
EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(text);
return panel;
}
return null;
}
示例11: createConfigureNotificationPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@Override
public EditorNotificationPanel createConfigureNotificationPanel(@NotNull final Module module) {
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(framework.getFrameworkName() + " SDK is not configured for module '" + module.getName() + '\'');
for (Entry<String, Runnable> action : framework.createConfigureActions(module).entrySet()) {
panel.createActionLabel(action.getKey(), action.getValue());
}
return panel;
}
示例12: createConfigureNotificationPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@Override
public EditorNotificationPanel createConfigureNotificationPanel(@NotNull final Module module) {
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(GroovyBundle.message("groovy.library.is.not.configured.for.module", module.getName()));
panel.createActionLabel(GroovyBundle.message("configure.groovy.library"), new Runnable() {
@Override
public void run() {
AddCustomLibraryDialog.createDialog(new GroovyLibraryDescription(), module, null).show();
}
});
return panel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DefaultGroovyFrameworkConfigNotification.java
示例13: decorateStubFile
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
private static EditorNotificationPanel decorateStubFile(final VirtualFile file, final Project project) {
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText("This stub is generated for Groovy class to make Groovy-Java cross-compilation possible");
panel.createActionLabel("Go to the Groovy class", new Runnable() {
@Override
public void run() {
DumbService.getInstance(project).withAlternativeResolveEnabled(new Runnable() {
@Override
public void run() {
final PsiClass original = findClassByStub(project, file);
if (original != null) {
original.navigate(true);
}
}
});
}
});
panel.createActionLabel("Exclude from stub generation", new Runnable() {
@Override
public void run() {
DumbService.getInstance(project).withAlternativeResolveEnabled(new Runnable() {
@Override
public void run() {
final PsiClass psiClass = findClassByStub(project, file);
if (psiClass != null) {
ExcludeFromStubGenerationAction.doExcludeFromStubGeneration(psiClass.getContainingFile());
}
}
});
}
});
return panel;
}
示例14: createMissingSdkPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@NotNull
private static EditorNotificationPanel createMissingSdkPanel(@NotNull final Project project, @Nullable final Module module) {
EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(SquirrelBundle.message("squirrel.sdk.not.configured"));
panel.createActionLabel(SquirrelBundle.message("setup.squirrel.sdk"), new Runnable() {
@Override
public void run() {
SquirrelSdkService.getInstance(project).chooseAndSetSdk(module);
}
});
return panel;
}
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:13,代码来源:WrongSdkConfigurationNotificationProvider.java
示例15: createPanel
import com.intellij.ui.EditorNotificationPanel; //导入方法依赖的package包/类
@NotNull
private static EditorNotificationPanel createPanel(@Nullable String name, @NotNull final Module rootModule)
{
EditorNotificationPanel panel = new EditorNotificationPanel();
if(StringUtil.isEmpty(name))
{
panel.setText(Unity3dBundle.message("unity.sdk.is.not.defiled"));
}
else
{
panel.setText(Unity3dBundle.message("unity.0.sdk.is.not.defined", name));
}
panel.createActionLabel("Open Settings", () -> ProjectSettingsService.getInstance(rootModule.getProject()).openModuleSettings(rootModule));
return panel;
}