mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
getIcon() in PsiViewerExtention
This commit is contained in:
+9
-2
@@ -15,9 +15,12 @@
|
||||
*/
|
||||
package com.intellij.internal.psiView;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.Icons;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
@@ -27,6 +30,10 @@ public class PsiViewerCodeFragmentExtension implements PsiViewerExtension {
|
||||
return "Java Code Block";
|
||||
}
|
||||
|
||||
public Icon getIcon() {
|
||||
return Icons.CLASS_INITIALIZER;
|
||||
}
|
||||
|
||||
public PsiElement createElement(Project project, String text) {
|
||||
return JavaPsiFacade.getElementFactory(project).createCodeBlockFromText(text, null);
|
||||
}
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
*/
|
||||
package com.intellij.internal.psiView;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.Icons;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
@@ -27,6 +30,10 @@ public class PsiViewerExpressionExtension implements PsiViewerExtension {
|
||||
return "Java Expression";
|
||||
}
|
||||
|
||||
public Icon getIcon() {
|
||||
return Icons.CLASS_INITIALIZER;
|
||||
}
|
||||
|
||||
public PsiElement createElement(Project project, String text) {
|
||||
return JavaPsiFacade.getElementFactory(project).createExpressionFromText(text, null);
|
||||
}
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
*/
|
||||
package com.intellij.internal.psiView;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.Icons;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
@@ -27,6 +30,10 @@ public class PsiViewerMethodExtension implements PsiViewerExtension {
|
||||
return "Java Method";
|
||||
}
|
||||
|
||||
public Icon getIcon() {
|
||||
return Icons.METHOD_ICON;
|
||||
}
|
||||
|
||||
public PsiElement createElement(Project project, String text) {
|
||||
return JavaPsiFacade.getInstance(project).getElementFactory().createMethodFromText(text, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user