use of com.intellij.pom.Navigatable in project intellij by bazelbuild.
the class BlazeTypescriptSyncPlugin method invalidProjectViewError.
private void invalidProjectViewError(BlazeContext context, BuildSystemProvider buildSystemProvider) {
String errorNote = "For Typescript support you must add both `additional_languages: typescript`" + " and the `ts_config_rules` attribute.";
String documentationUrl = buildSystemProvider.getLanguageSupportDocumentationUrl("dynamic-languages-typescript");
Navigatable navigatable = null;
if (documentationUrl != null) {
errorNote += " Click to open the relevant docs.";
navigatable = new NavigatableAdapter() {
@Override
public void navigate(boolean requestFocus) {
BrowserLauncher.getInstance().open(documentationUrl);
}
};
}
IssueOutput.error(errorNote).navigatable(navigatable).submit(context);
}
use of com.intellij.pom.Navigatable in project buck by facebook.
the class GoToBuckFile method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getProject();
if (project == null) {
return;
}
Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
if (editor == null) {
return;
}
final Document document = editor.getDocument();
if (document == null) {
return;
}
VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(document);
final VirtualFile file = BuckFileUtil.getBuckFile(virtualFile);
if (file != null) {
final OpenFileDescriptor descriptor = new OpenFileDescriptor(project, file);
// This is for better cursor position.
final Navigatable n = descriptor.setUseCurrentWindow(false);
if (!n.canNavigate()) {
return;
}
n.navigate(true);
}
}
use of com.intellij.pom.Navigatable in project intellij-community by JetBrains.
the class ProblemsView method addMessage.
public final void addMessage(CompilerMessage message, @NotNull UUID sessionId) {
final VirtualFile file = message.getVirtualFile();
Navigatable navigatable = message.getNavigatable();
if (navigatable == null && file != null) {
navigatable = new OpenFileDescriptor(myProject, file, -1, -1);
}
final CompilerMessageCategory category = message.getCategory();
final int type = CompilerTask.translateCategory(category);
final String[] text = convertMessage(message);
final String groupName = file != null ? file.getPresentableUrl() : category.getPresentableText();
addMessage(type, text, groupName, navigatable, message.getExportTextPrefix(), message.getRenderTextPrefix(), sessionId);
}
use of com.intellij.pom.Navigatable in project intellij-community by JetBrains.
the class ExcludeFromValidationAction method getExcludedConfigurationAndFile.
@Nullable
private static Pair<ExcludesConfiguration, VirtualFile> getExcludedConfigurationAndFile(final AnActionEvent event, Project project) {
Navigatable navigatable = event.getData(CommonDataKeys.NAVIGATABLE);
if (project != null && navigatable instanceof OpenFileDescriptor) {
final VirtualFile file = ((OpenFileDescriptor) navigatable).getFile();
final ExcludesConfiguration configuration = ValidationConfiguration.getExcludedEntriesConfiguration(project);
return Pair.create(configuration, file);
}
return null;
}
use of com.intellij.pom.Navigatable in project android by JetBrains.
the class GradleBuildTreeViewPanel method navigateToSource.
private void navigateToSource(boolean focusEditor) {
NavigatableMessageElement element = getSelectedMessageElement();
if (element == null) {
return;
}
Navigatable navigatable = element.getNavigatable();
if (navigatable.canNavigate()) {
navigatable.navigate(focusEditor);
}
}
Aggregations