├── .idea ├── .name ├── gradle.xml ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml ├── uiDesigner.xml ├── vcs.xml └── workspace.xml ├── README.md ├── build.gradle ├── element-2.0.jar ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── img ├── attr-tip.gif ├── doc.gif ├── idea.png ├── methods.gif ├── property.gif ├── tag.gif └── tip.gif ├── settings.gradle └── src ├── .gitignore └── main ├── java └── com │ └── element │ ├── ElementFileType.java │ ├── ElementFileTypeFactory.java │ ├── ElementIcons.java │ ├── ElementLanguage.java │ ├── ElementTemplatesProvider.java │ ├── document │ ├── DocumentConstant.java │ ├── DocumentProvider.java │ └── IProperty.java │ ├── language │ └── ElementParserDefinition.java │ └── xml │ ├── ElementAnyXmlElementDescriptor.java │ ├── ElementAttributeDescriptor.java │ ├── ElementAttributesProvider.java │ ├── ElementTagConstant.java │ └── ElementTagNameProvider.java └── resources ├── META-INF └── plugin.xml ├── element.xml └── icons ├── element.ai └── element.png /.idea/.name: -------------------------------------------------------------------------------- 1 | element -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 40 | 41 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ElementPlugin 2 | idea plugin for develop with element ui. before use, you must install vuejs plugin. 3 | ## basic functions 4 | ### 1 . see tag document (win: ctrl + Q, mac: ^ + j), the keyboard shortcut same as quick document 5 | ![](./img/doc.gif) 6 | ### 2. live templates (ctrl + space) 7 | ![](./img/tip.gif) 8 | ### 3. edit through tag name 9 | ![](./img/tag.gif) 10 | ### 4. tag property tip 11 | ![](./img/property.gif) 12 | ### 5. method tip (begin width elm ) 13 | include [message, alert, confirm, notify, prompt] 14 | ![](./img/methods.gif) 15 | ### 6. attribute tip and auto complete (new) 16 | ![](./img/attr-tip.gif) 17 | ## download 18 | if you use webstorm or IntelliJ IDEA, you can download from plugin repositories. 19 | ![](./img/idea.png) 20 | 21 | or you can direct download from jetbrains plugins repository 22 | ## questions feedback 23 | if you has any questions or good idea, you can call me by qq: **2278371826** or by email **shenjiaolong1021@163.com** 24 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.jetbrains.intellij' version '0.3.1' 3 | } 4 | 5 | group 'element' 6 | version '2.0' 7 | 8 | apply plugin: 'java' 9 | apply plugin: 'idea' 10 | apply plugin: 'org.jetbrains.intellij' 11 | 12 | sourceCompatibility = 1.8 13 | 14 | repositories { 15 | mavenCentral() 16 | maven { url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' } 17 | } 18 | 19 | dependencies { 20 | testCompile group: 'junit', name: 'junit', version: '4.12' 21 | } 22 | 23 | intellij { 24 | version 'IU-173.4674.33' 25 | /*version 'IU-LATEST-TRUNK-SNAPSHOT'*/ 26 | pluginName 'element' 27 | downloadSources false 28 | updateSinceUntilBuild false 29 | plugins = ['JavaScriptLanguage', 'org.jetbrains.plugins.vue:173.4301.12'] 30 | } 31 | 32 | //指定编译的编码 33 | tasks.withType(JavaCompile){ 34 | options.encoding = "UTF-8" 35 | } 36 | -------------------------------------------------------------------------------- /element-2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/element-2.0.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /img/attr-tip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/img/attr-tip.gif -------------------------------------------------------------------------------- /img/doc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/img/doc.gif -------------------------------------------------------------------------------- /img/idea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/img/idea.png -------------------------------------------------------------------------------- /img/methods.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/img/methods.gif -------------------------------------------------------------------------------- /img/property.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/img/property.gif -------------------------------------------------------------------------------- /img/tag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/img/tag.gif -------------------------------------------------------------------------------- /img/tip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/img/tip.gif -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'element' 2 | 3 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Java template 3 | # Compiled class file 4 | *.class 5 | 6 | # Log file 7 | *.log 8 | 9 | # BlueJ files 10 | *.ctxt 11 | 12 | # Mobile Tools for Java (J2ME) 13 | .mtj.tmp/ 14 | 15 | # Package Files # 16 | *.jar 17 | *.war 18 | *.ear 19 | *.zip 20 | *.tar.gz 21 | *.rar 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | 26 | .idea/ 27 | out 28 | build 29 | .gradle -------------------------------------------------------------------------------- /src/main/java/com/element/ElementFileType.java: -------------------------------------------------------------------------------- 1 | package com.element; 2 | 3 | import com.intellij.openapi.fileTypes.LanguageFileType; 4 | import org.jetbrains.annotations.NotNull; 5 | import org.jetbrains.annotations.Nullable; 6 | 7 | import javax.swing.*; 8 | 9 | public class ElementFileType extends LanguageFileType { 10 | public static final ElementFileType INSTANCE = new ElementFileType(); 11 | 12 | private ElementFileType() { 13 | super(ElementLanguage.INSTANCE); 14 | } 15 | 16 | @NotNull 17 | @Override 18 | public String getName() { 19 | return "Shen file"; 20 | } 21 | 22 | @NotNull 23 | @Override 24 | public String getDescription() { 25 | return "Shen language file"; 26 | } 27 | 28 | @NotNull 29 | @Override 30 | public String getDefaultExtension() { 31 | return "element"; 32 | } 33 | 34 | @Nullable 35 | @Override 36 | public Icon getIcon() { 37 | return ElementIcons.FILE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/element/ElementFileTypeFactory.java: -------------------------------------------------------------------------------- 1 | package com.element; 2 | 3 | import com.intellij.openapi.fileTypes.FileTypeConsumer; 4 | import com.intellij.openapi.fileTypes.FileTypeFactory; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class ElementFileTypeFactory extends FileTypeFactory { 8 | @Override 9 | public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) { 10 | fileTypeConsumer.consume(ElementFileType.INSTANCE); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/element/ElementIcons.java: -------------------------------------------------------------------------------- 1 | package com.element; 2 | 3 | import com.intellij.openapi.util.IconLoader; 4 | 5 | import javax.swing.*; 6 | 7 | public class ElementIcons { 8 | public static final Icon FILE = IconLoader.getIcon("/icons/element.png"); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/element/ElementLanguage.java: -------------------------------------------------------------------------------- 1 | package com.element; 2 | 3 | import com.intellij.lang.Language; 4 | 5 | public class ElementLanguage extends Language { 6 | public static final ElementLanguage INSTANCE = new ElementLanguage(); 7 | private ElementLanguage() { 8 | super("Shen"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/element/ElementTemplatesProvider.java: -------------------------------------------------------------------------------- 1 | package com.element; 2 | 3 | import com.intellij.codeInsight.template.impl.DefaultLiveTemplatesProvider; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | /** 7 | * 用于展示代码模板 8 | */ 9 | public class ElementTemplatesProvider implements DefaultLiveTemplatesProvider { 10 | @Override 11 | public String[] getDefaultLiveTemplateFiles() { 12 | /* 关联 element.xml */ 13 | return new String[]{"element", "vux"}; 14 | } 15 | 16 | @Nullable 17 | @Override 18 | public String[] getHiddenLiveTemplateFiles() { 19 | return null; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/element/document/DocumentProvider.java: -------------------------------------------------------------------------------- 1 | package com.element.document; 2 | 3 | import com.intellij.lang.documentation.AbstractDocumentationProvider; 4 | import com.intellij.openapi.util.text.StringUtil; 5 | import com.intellij.psi.PsiElement; 6 | import com.intellij.psi.PsiFile; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | import java.lang.reflect.Field; 11 | 12 | /** 13 | * @author sjl 14 | */ 15 | public class DocumentProvider extends AbstractDocumentationProvider { 16 | @Override 17 | @Nullable 18 | public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) { 19 | if (element instanceof IProperty) { 20 | return "\"" + renderPropertyValue((IProperty)element) + "\"" + getLocationString(element); 21 | } 22 | return null; 23 | } 24 | 25 | private static String getLocationString(PsiElement element) { 26 | PsiFile file = element.getContainingFile(); 27 | return file != null ? " [" + file.getName() + "]" : ""; 28 | } 29 | 30 | @NotNull 31 | private static String renderPropertyValue(IProperty prop) { 32 | String raw = prop.getValue(); 33 | if (raw == null) { 34 | return "empty"; 35 | } 36 | return StringUtil.escapeXml(raw); 37 | } 38 | 39 | @Override 40 | public String generateDoc(final PsiElement element, @Nullable final PsiElement originalElement) { 41 | // 相关处理,不处理返回null 42 | String text = originalElement.getText(); 43 | 44 | if (null != text) { 45 | System.out.println(text); 46 | String doc = "doc: " + text; 47 | String textHandle = text.replaceAll("-", "").replaceAll("\n|\r\n", ""); 48 | Class clazz = DocumentConstant.class; 49 | Field[] fields = clazz.getFields(); 50 | for (Field field : fields) { 51 | if (textHandle.equals(field.getName()) && field.getType().toString().endsWith("java.lang.String")) { 52 | try { 53 | doc = (String) field.get(DocumentConstant.class); 54 | } catch (IllegalAccessException e) { 55 | e.printStackTrace(); 56 | } 57 | break; 58 | } 59 | } 60 | if ("doc: ".equals(doc)) { 61 | return null; 62 | }else{ 63 | return doc; 64 | } 65 | } 66 | return null; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/element/document/IProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 3 | */ 4 | package com.element.document; 5 | 6 | import com.intellij.openapi.actionSystem.DataKey; 7 | import com.intellij.openapi.util.Iconable; 8 | import com.intellij.pom.Navigatable; 9 | import com.intellij.psi.PsiElement; 10 | import com.intellij.util.IncorrectOperationException; 11 | import org.jetbrains.annotations.NonNls; 12 | import org.jetbrains.annotations.NotNull; 13 | import org.jetbrains.annotations.Nullable; 14 | 15 | /** 16 | * An interface representing a generic property. It can be a property inside xml file or a property inside .properties-file 17 | * 18 | */ 19 | public interface IProperty extends Navigatable, Iconable { 20 | IProperty[] EMPTY_ARRAY = new IProperty[0]; 21 | DataKey ARRAY_KEY = DataKey.create("IProperty.array"); 22 | 23 | String getName(); 24 | 25 | PsiElement setName(String name); 26 | 27 | @Nullable 28 | String getKey(); 29 | 30 | @Nullable 31 | String getValue(); 32 | 33 | /** 34 | * Returns the value with \n, \r, \t, \f and Unicode escape characters converted to their 35 | * character equivalents. 36 | * 37 | * @return unescaped value, or null if no value is specified for this property. 38 | */ 39 | @Nullable 40 | String getUnescapedValue(); 41 | 42 | /** 43 | * Returns the key with \n, \r, \t, \f and Unicode escape characters converted to their 44 | * character equivalents. 45 | * 46 | * @return unescaped key, or null if no key is specified for this property. 47 | */ 48 | @Nullable 49 | String getUnescapedKey(); 50 | 51 | void setValue(@NonNls @NotNull String value) throws IncorrectOperationException; 52 | 53 | /** 54 | * @return text of comment preceding this property. Comment-start characters ('#' and '!') are stripped from the text. 55 | */ 56 | @Nullable 57 | String getDocCommentText(); 58 | 59 | /** 60 | * @return underlying psi element of property 61 | */ 62 | @NotNull 63 | PsiElement getPsiElement(); 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/element/language/ElementParserDefinition.java: -------------------------------------------------------------------------------- 1 | package com.element.language; 2 | 3 | import com.intellij.lang.PsiParser; 4 | import com.intellij.lang.html.HTMLParserDefinition; 5 | import com.intellij.lexer.Lexer; 6 | import com.intellij.openapi.project.Project; 7 | import com.intellij.psi.FileViewProvider; 8 | import com.intellij.psi.PsiFile; 9 | import com.intellij.psi.tree.IFileElementType; 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | public class ElementParserDefinition extends HTMLParserDefinition { 13 | @NotNull 14 | @Override 15 | public Lexer createLexer(Project project) { 16 | return super.createLexer(project); 17 | } 18 | 19 | @Override 20 | public IFileElementType getFileNodeType() { 21 | return super.getFileNodeType(); 22 | } 23 | 24 | @Override 25 | public PsiFile createFile(FileViewProvider viewProvider) { 26 | return super.createFile(viewProvider); 27 | } 28 | 29 | @NotNull 30 | @Override 31 | public PsiParser createParser(Project project) { 32 | return super.createParser(project); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/element/xml/ElementAnyXmlElementDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.element.xml; 2 | 3 | import com.intellij.openapi.util.Condition; 4 | import com.intellij.psi.PsiElement; 5 | import com.intellij.psi.impl.source.html.dtd.HtmlNSDescriptorImpl; 6 | import com.intellij.psi.impl.source.xml.XmlDocumentImpl; 7 | import com.intellij.psi.util.PsiTreeUtil; 8 | import com.intellij.psi.xml.XmlAttribute; 9 | import com.intellij.psi.xml.XmlTag; 10 | import com.intellij.util.ArrayUtil; 11 | import com.intellij.util.containers.ContainerUtil; 12 | import com.intellij.xml.XmlAttributeDescriptor; 13 | import com.intellij.xml.XmlElementDescriptor; 14 | import com.intellij.xml.XmlElementsGroup; 15 | import com.intellij.xml.XmlNSDescriptor; 16 | import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; 17 | import org.jetbrains.annotations.NonNls; 18 | import org.jetbrains.annotations.Nullable; 19 | 20 | /** 21 | * 扩展xmlElementDescriptor, 定制自己的元素描述 22 | */ 23 | public class ElementAnyXmlElementDescriptor extends AnyXmlElementDescriptor implements XmlElementDescriptor { 24 | private final String name; 25 | 26 | public ElementAnyXmlElementDescriptor(XmlElementDescriptor xmlElementDescriptor, XmlNSDescriptor xmlNSDescriptor, String name) { 27 | super(xmlElementDescriptor, xmlNSDescriptor); 28 | this.name = name; 29 | } 30 | 31 | @Override 32 | public String getQualifiedName() { 33 | return name; 34 | } 35 | 36 | @Override 37 | public String getDefaultName() { 38 | return name; 39 | } 40 | 41 | @Override 42 | public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) { 43 | XmlDocumentImpl xmlDocument = PsiTreeUtil.getParentOfType(context, XmlDocumentImpl.class); 44 | if (xmlDocument == null) { 45 | return EMPTY_ARRAY; 46 | } 47 | return xmlDocument.getRootTagNSDescriptor().getRootElementsDescriptors(xmlDocument); 48 | } 49 | 50 | @Override 51 | public XmlElementDescriptor getElementDescriptor(XmlTag childTag, XmlTag contextTag) { 52 | XmlTag parent = contextTag.getParentTag(); 53 | if (parent == null) { 54 | return null; 55 | } 56 | final XmlNSDescriptor descriptor = parent.getNSDescriptor(childTag.getNamespace(), true); 57 | return descriptor == null ? null : descriptor.getElementDescriptor(childTag); 58 | } 59 | 60 | @Override 61 | public XmlAttributeDescriptor[] getAttributesDescriptors(@Nullable XmlTag context) { 62 | return HtmlNSDescriptorImpl.getCommonAttributeDescriptors(context); 63 | } 64 | 65 | @Nullable 66 | @Override 67 | public XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attribute) { 68 | return getAttributeDescriptor(attribute.getName(), attribute.getParent()); 69 | } 70 | 71 | @Nullable 72 | @Override 73 | public XmlAttributeDescriptor getAttributeDescriptor(@NonNls final String attributeName, @Nullable XmlTag context) { 74 | final XmlAttributeDescriptor descriptor = ContainerUtil.find(getAttributesDescriptors(context), new Condition() { 75 | @Override 76 | public boolean value(XmlAttributeDescriptor descriptor) { 77 | return attributeName.equals(descriptor.getName()); 78 | } 79 | }); 80 | if (descriptor != null) { 81 | return descriptor; 82 | } 83 | return null; 84 | } 85 | 86 | @Override 87 | public XmlNSDescriptor getNSDescriptor() { 88 | return null; 89 | } 90 | 91 | @Nullable 92 | @Override 93 | public XmlElementsGroup getTopGroup() { 94 | return null; 95 | } 96 | 97 | @Override 98 | public int getContentType() { 99 | return CONTENT_TYPE_ANY; 100 | } 101 | 102 | @Nullable 103 | @Override 104 | public String getDefaultValue() { 105 | return null; 106 | } 107 | 108 | @Override 109 | public PsiElement getDeclaration() { 110 | return null; 111 | } 112 | 113 | @Override 114 | public String getName(PsiElement context) { 115 | return getName(); 116 | } 117 | 118 | @Override 119 | public String getName() { 120 | return name; 121 | } 122 | 123 | @Override 124 | public void init(PsiElement element) { 125 | 126 | } 127 | 128 | @Override 129 | public Object[] getDependences() { 130 | return ArrayUtil.EMPTY_OBJECT_ARRAY; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /src/main/java/com/element/xml/ElementAttributeDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.element.xml; 2 | 3 | import com.intellij.openapi.project.Project; 4 | import com.intellij.psi.PsiElement; 5 | import com.intellij.psi.meta.PsiPresentableMetaData; 6 | import com.intellij.psi.xml.XmlElement; 7 | import com.intellij.util.ArrayUtil; 8 | import com.intellij.xml.impl.BasicXmlAttributeDescriptor; 9 | import com.intellij.xml.impl.XmlAttributeDescriptorEx; 10 | import com.element.ElementIcons; 11 | import org.jetbrains.annotations.NonNls; 12 | import org.jetbrains.annotations.NotNull; 13 | import org.jetbrains.annotations.Nullable; 14 | 15 | import javax.swing.*; 16 | 17 | /** 18 | * @author sjl 19 | */ 20 | public class ElementAttributeDescriptor extends BasicXmlAttributeDescriptor implements XmlAttributeDescriptorEx, PsiPresentableMetaData { 21 | protected final Project project; 22 | private final String attributeName; 23 | private String[] attributeValues = null; 24 | 25 | public ElementAttributeDescriptor(final Project project, String attributeName, String[] attributeValues) { 26 | this.project = project; 27 | this.attributeName = attributeName; 28 | this.attributeValues = attributeValues; 29 | } 30 | 31 | @Override 32 | public PsiElement getDeclaration() { 33 | return null; 34 | } 35 | 36 | @Override 37 | public PsiElement getValueDeclaration(XmlElement xmlElement, String value) { 38 | return super.getValueDeclaration(xmlElement, value); 39 | } 40 | 41 | @Override 42 | public String getName() { 43 | return attributeName; 44 | } 45 | 46 | @Override 47 | public void init(PsiElement element) {} 48 | 49 | @Override 50 | public Object[] getDependences() { 51 | return ArrayUtil.EMPTY_OBJECT_ARRAY; 52 | } 53 | 54 | @Override 55 | public boolean isRequired() { 56 | return false; 57 | } 58 | 59 | @Override 60 | public boolean hasIdType() { 61 | return false; 62 | } 63 | 64 | @Override 65 | public boolean hasIdRefType() { 66 | return false; 67 | } 68 | 69 | @Override 70 | public boolean isEnumerated() { 71 | return false; 72 | } 73 | 74 | @Override 75 | public boolean isFixed() { 76 | return false; 77 | } 78 | 79 | @Override 80 | public String getDefaultValue() { 81 | return null; 82 | } 83 | 84 | @Override 85 | public String[] getEnumeratedValues() { 86 | return attributeValues; 87 | } 88 | 89 | @Override 90 | protected PsiElement getEnumeratedValueDeclaration(XmlElement xmlElement, String value) { 91 | return xmlElement; 92 | } 93 | 94 | @Nullable 95 | @Override 96 | public String handleTargetRename(@NotNull @NonNls String newTargetName) { 97 | return newTargetName; 98 | } 99 | 100 | @Override 101 | public String getTypeName() { 102 | return null; 103 | } 104 | 105 | @Nullable 106 | @Override 107 | public Icon getIcon() { 108 | return ElementIcons.FILE; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/main/java/com/element/xml/ElementAttributesProvider.java: -------------------------------------------------------------------------------- 1 | package com.element.xml; 2 | 3 | import com.intellij.openapi.project.Project; 4 | import com.intellij.psi.xml.XmlTag; 5 | import com.intellij.xml.XmlAttributeDescriptor; 6 | import com.intellij.xml.XmlAttributeDescriptorsProvider; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | /** 13 | * @author sjl 14 | */ 15 | public class ElementAttributesProvider implements XmlAttributeDescriptorsProvider { 16 | /** 17 | * 给特定标签添加属性 18 | * @param xmlTag 19 | * @return 20 | */ 21 | @Override 22 | public XmlAttributeDescriptor[] getAttributeDescriptors(XmlTag xmlTag) { 23 | final Project project = xmlTag.getProject(); 24 | for (Map.Entry> next : ElementTagConstant.TAG_CONSTANT.entrySet()) { 25 | if (next.getKey().equals(xmlTag.getName())) { 26 | HashMap attrMap = next.getValue(); 27 | XmlAttributeDescriptor[] attributeDescriptors = new ElementAttributeDescriptor[attrMap.size()]; 28 | int i = 0; 29 | for(Map.Entry attr : attrMap.entrySet()){ 30 | attributeDescriptors[i] = new ElementAttributeDescriptor(project, attr.getKey(), attr.getValue()); 31 | i++; 32 | } 33 | return attributeDescriptors; 34 | } 35 | } 36 | return XmlAttributeDescriptor.EMPTY; 37 | } 38 | 39 | @Nullable 40 | @Override 41 | public XmlAttributeDescriptor getAttributeDescriptor(String s, XmlTag xmlTag) { 42 | return null; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/element/xml/ElementTagConstant.java: -------------------------------------------------------------------------------- 1 | package com.element.xml; 2 | 3 | import java.util.HashMap; 4 | 5 | /** 6 | * @author sjl 7 | */ 8 | public class ElementTagConstant { 9 | public static HashMap> TAG_CONSTANT = new HashMap<>(); 10 | 11 | static { 12 | /* element */ 13 | HashMap elRowMap = new HashMap<>(); 14 | elRowMap.put("gutter", new String[]{"10"}); 15 | elRowMap.put("type", new String[]{"flex"}); 16 | elRowMap.put("justify", new String[]{"start", "center", "end", "space-between", "space-around"}); 17 | elRowMap.put("align-", new String[]{"top", "middle", "bottom"}); 18 | elRowMap.put("tag", new String[]{"div"}); 19 | TAG_CONSTANT.put("el-row", elRowMap); 20 | 21 | HashMap elColMap = new HashMap<>(); 22 | elColMap.put("span", new String[]{"8"}); 23 | elColMap.put("offset", new String[]{"6"}); 24 | elColMap.put("push", new String[]{"6"}); 25 | elColMap.put("pull", new String[]{"6"}); 26 | elColMap.put("xs", new String[]{"8"}); 27 | elColMap.put("sm", new String[]{"8"}); 28 | elColMap.put("lg", new String[]{"8"}); 29 | elColMap.put("xl", new String[]{"8"}); 30 | elColMap.put("tag", new String[]{"div"}); 31 | TAG_CONSTANT.put("el-col", elColMap); 32 | 33 | HashMap elContainerMap = new HashMap<>(); 34 | elContainerMap.put("direction", new String[]{"horizontal ", "vertical"}); 35 | TAG_CONSTANT.put("el-container", elContainerMap); 36 | 37 | HashMap elHeaderMap = new HashMap<>(); 38 | elHeaderMap.put("height", new String[]{"60px"}); 39 | TAG_CONSTANT.put("el-header", elHeaderMap); 40 | 41 | HashMap elAsideMap = new HashMap<>(); 42 | elAsideMap.put("width", new String[]{"300px"}); 43 | TAG_CONSTANT.put("el-aside", elAsideMap); 44 | 45 | HashMap elFooterMap = new HashMap<>(); 46 | elFooterMap.put("width", new String[]{"60px"}); 47 | TAG_CONSTANT.put("el-footer", elFooterMap); 48 | 49 | HashMap elButtonMap = new HashMap<>(); 50 | elButtonMap.put("size", new String[]{"medium", "small", "mini"}); 51 | elButtonMap.put("type", new String[]{"primary", "success", "warning", "danger", "info", "text"}); 52 | elButtonMap.put("plain", new String[]{"true", "false"}); 53 | elButtonMap.put("round", new String[]{"true", "false"}); 54 | elButtonMap.put("circle", new String[]{"true", "false"}); 55 | elButtonMap.put("loading", new String[]{"true", "false"}); 56 | elButtonMap.put("disabled", new String[]{"true", "false"}); 57 | elButtonMap.put("icon", new String[]{"el-icon-plus", "el-icon-edit", "el-icon-delete", "el-icon-search"}); 58 | elButtonMap.put("autofocus", new String[]{"true", "false"}); 59 | elButtonMap.put("native-type", new String[]{"button", "submit", "reset"}); 60 | TAG_CONSTANT.put("el-button", elButtonMap); 61 | 62 | HashMap elButtonGroupMap = new HashMap<>(); 63 | elButtonGroupMap.put("align", new String[]{}); 64 | TAG_CONSTANT.put("el-button-group", elButtonGroupMap); 65 | 66 | HashMap elRadioMap = new HashMap<>(); 67 | elRadioMap.put("label", new String[]{"div"}); 68 | elRadioMap.put("disabled", new String[]{"true", "false"}); 69 | elRadioMap.put("border", new String[]{"true", "false"}); 70 | elRadioMap.put("size", new String[]{"medium", "small", "mini"}); 71 | elRadioMap.put("name", new String[]{}); 72 | elRadioMap.put("@change", new String[]{}); 73 | TAG_CONSTANT.put("el-radio", elRadioMap); 74 | 75 | HashMap elRadioGroupMap = new HashMap<>(); 76 | elRadioGroupMap.put("size", new String[]{"medium", "small", "mini"}); 77 | elRadioGroupMap.put("disabled", new String[]{"true", "false"}); 78 | elRadioGroupMap.put("text-color", new String[]{"#ffffff"}); 79 | elRadioGroupMap.put("fill", new String[]{"#409eff"}); 80 | elRadioGroupMap.put("@change", new String[]{}); 81 | TAG_CONSTANT.put("el-radio-group", elRadioGroupMap); 82 | 83 | HashMap elRadioButtonMap = new HashMap<>(); 84 | elRadioButtonMap.put("label", new String[]{}); 85 | elRadioButtonMap.put("disabled", new String[]{"true", "false"}); 86 | elRadioButtonMap.put("name", new String[]{}); 87 | TAG_CONSTANT.put("el-radio-button", elRadioButtonMap); 88 | 89 | HashMap elCheckboxMap = new HashMap<>(); 90 | elCheckboxMap.put("label", new String[]{}); 91 | elCheckboxMap.put("true-label", new String[]{}); 92 | elCheckboxMap.put("false-label", new String[]{}); 93 | elCheckboxMap.put("disabled", new String[]{"true", "false"}); 94 | elCheckboxMap.put("border", new String[]{"true", "false"}); 95 | elCheckboxMap.put("size", new String[]{"medium", "small", "mini"}); 96 | elCheckboxMap.put("name", new String[]{}); 97 | elCheckboxMap.put("checked", new String[]{"true", "false"}); 98 | elCheckboxMap.put("indeterminate", new String[]{"true", "false"}); 99 | elCheckboxMap.put("@change", new String[]{}); 100 | TAG_CONSTANT.put("el-checkbox", elCheckboxMap); 101 | 102 | HashMap elCheckboxGroupMap = new HashMap<>(); 103 | elCheckboxGroupMap.put("size", new String[]{"medium", "small", "mini"}); 104 | elCheckboxGroupMap.put("disabled", new String[]{"true", "false"}); 105 | elCheckboxGroupMap.put("min", new String[]{"1"}); 106 | elCheckboxGroupMap.put("max", new String[]{"10"}); 107 | elCheckboxGroupMap.put("text-color", new String[]{"#ffffff"}); 108 | elCheckboxGroupMap.put("fill", new String[]{"#409eff"}); 109 | elCheckboxGroupMap.put("@change", new String[]{}); 110 | TAG_CONSTANT.put("el-checkbox-group", elCheckboxGroupMap); 111 | 112 | HashMap elCheckboxButtonMap = new HashMap<>(); 113 | elCheckboxButtonMap.put("label", new String[]{}); 114 | elCheckboxButtonMap.put("true-label", new String[]{}); 115 | elCheckboxButtonMap.put("false-label", new String[]{}); 116 | elCheckboxButtonMap.put("disabled", new String[]{"true", "false"}); 117 | elCheckboxButtonMap.put("name", new String[]{}); 118 | elCheckboxButtonMap.put("checked", new String[]{"true", "false"}); 119 | TAG_CONSTANT.put("el-checkbox-button", elCheckboxButtonMap); 120 | 121 | HashMap elInputMap = new HashMap<>(); 122 | elInputMap.put("type", new String[]{"text", "textarea"}); 123 | elInputMap.put("value", new String[]{}); 124 | elInputMap.put("maxlength", new String[]{"100"}); 125 | elInputMap.put("minlength", new String[]{"1"}); 126 | elInputMap.put("placeholder", new String[]{}); 127 | elInputMap.put("clearable", new String[]{"true", "false"}); 128 | elInputMap.put("disabled", new String[]{"true", "false"}); 129 | elInputMap.put("size", new String[]{"medium", "small", "mini"}); 130 | elInputMap.put("prefix-icon", new String[]{}); 131 | elInputMap.put("suffix-icon", new String[]{}); 132 | elInputMap.put("rows", new String[]{"2"}); 133 | elInputMap.put("autosize", new String[]{"true", "false"}); 134 | elInputMap.put("auto-complete", new String[]{"true", "false"}); 135 | elInputMap.put("name", new String[]{}); 136 | elInputMap.put("readonly", new String[]{"true", "false"}); 137 | elInputMap.put("max", new String[]{}); 138 | elInputMap.put("min", new String[]{}); 139 | elInputMap.put("step", new String[]{}); 140 | elInputMap.put("resize", new String[]{"none", "both", "horizontal", "vertical"}); 141 | elInputMap.put("autofocus", new String[]{"true", "false"}); 142 | elInputMap.put("form", new String[]{}); 143 | elInputMap.put("label", new String[]{}); 144 | elInputMap.put("tabindex", new String[]{}); 145 | elInputMap.put("@blur", new String[]{}); 146 | elInputMap.put("@focus", new String[]{}); 147 | elInputMap.put("@change", new String[]{}); 148 | TAG_CONSTANT.put("el-input", elInputMap); 149 | 150 | HashMap elAutocompleteMap = new HashMap<>(); 151 | elAutocompleteMap.put("placeholder", new String[]{}); 152 | elAutocompleteMap.put("disabled", new String[]{"true", "false"}); 153 | elAutocompleteMap.put("value-key", new String[]{}); 154 | elAutocompleteMap.put("value", new String[]{}); 155 | elAutocompleteMap.put("debounce", new String[]{"300"}); 156 | elAutocompleteMap.put("placement", new String[]{"top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end"}); 157 | elAutocompleteMap.put("fetch-suggestions", new String[]{"Function(queryString, callback)"}); 158 | elAutocompleteMap.put("popper-class", new String[]{}); 159 | elAutocompleteMap.put("trigger-on-focus", new String[]{"true", "false"}); 160 | elAutocompleteMap.put("name", new String[]{}); 161 | elAutocompleteMap.put("select-when-unmatched", new String[]{"true", "false"}); 162 | elAutocompleteMap.put("label", new String[]{}); 163 | elAutocompleteMap.put("align", new String[]{}); 164 | elAutocompleteMap.put("prefix-icon", new String[]{}); 165 | elAutocompleteMap.put("suffix-icon", new String[]{}); 166 | elAutocompleteMap.put("@select", new String[]{}); 167 | elAutocompleteMap.put("@focus", new String[]{}); 168 | TAG_CONSTANT.put("el-autocomplete", elAutocompleteMap); 169 | 170 | HashMap elInputNumberMap = new HashMap<>(); 171 | elInputNumberMap.put("value", new String[]{}); 172 | elInputNumberMap.put("min", new String[]{"-Infinity"}); 173 | elInputNumberMap.put("max", new String[]{"Infinity"}); 174 | elInputNumberMap.put("step", new String[]{"1"}); 175 | elInputNumberMap.put("size", new String[]{"large", "small"}); 176 | elInputNumberMap.put("disabled", new String[]{"true", "false"}); 177 | elInputNumberMap.put("controls", new String[]{"true", "false"}); 178 | elInputNumberMap.put("controls-position", new String[]{"right"}); 179 | elInputNumberMap.put("name", new String[]{}); 180 | elInputNumberMap.put("label", new String[]{}); 181 | elInputNumberMap.put("@change", new String[]{}); 182 | elInputNumberMap.put("@blur", new String[]{}); 183 | elInputNumberMap.put("@focus", new String[]{}); 184 | TAG_CONSTANT.put("el-input-number", elInputNumberMap); 185 | 186 | HashMap elSelectMap = new HashMap<>(); 187 | elSelectMap.put("multiple", new String[]{"true", "false"}); 188 | elSelectMap.put("disabled", new String[]{"true", "false"}); 189 | elSelectMap.put("value-key", new String[]{}); 190 | elSelectMap.put("size", new String[]{"medium", "small", "mini"}); 191 | elSelectMap.put("clearable", new String[]{"true", "false"}); 192 | elSelectMap.put("collapse-tags", new String[]{"true", "false"}); 193 | elSelectMap.put("multiple-limit", new String[]{"0"}); 194 | elSelectMap.put("name", new String[]{}); 195 | elSelectMap.put("auto-complete", new String[]{"off"}); 196 | elSelectMap.put("placeholder", new String[]{}); 197 | elSelectMap.put("filterable", new String[]{"true", "false"}); 198 | elSelectMap.put("allow-create", new String[]{"true", "false"}); 199 | elSelectMap.put("filter-method", new String[]{"function"}); 200 | elSelectMap.put("remote", new String[]{"true", "false"}); 201 | elSelectMap.put("remote-method", new String[]{"function"}); 202 | elSelectMap.put("loading", new String[]{"true", "false"}); 203 | elSelectMap.put("loading-text", new String[]{"加载中"}); 204 | elSelectMap.put("no-match-text", new String[]{"无匹配数据"}); 205 | elSelectMap.put("no-data-text", new String[]{"无数据"}); 206 | elSelectMap.put("popper-class", new String[]{}); 207 | elSelectMap.put("reserve-keyword", new String[]{"true", "false"}); 208 | elSelectMap.put("default-first-option", new String[]{"true", "false"}); 209 | elSelectMap.put("popper-append-to-body", new String[]{"true", "false"}); 210 | elSelectMap.put("automatic-dropdown", new String[]{"true", "false"}); 211 | elSelectMap.put("@change", new String[]{}); 212 | elSelectMap.put("@visible-change", new String[]{}); 213 | elSelectMap.put("@remove-tag", new String[]{}); 214 | elSelectMap.put("@clear", new String[]{}); 215 | elSelectMap.put("@blur", new String[]{}); 216 | elSelectMap.put("@focus", new String[]{}); 217 | TAG_CONSTANT.put("el-select", elSelectMap); 218 | HashMap elOptionGroupMap = new HashMap<>(); 219 | elOptionGroupMap.put("label", new String[]{}); 220 | elOptionGroupMap.put("disabled", new String[]{"true", "false"}); 221 | TAG_CONSTANT.put("el-option-group", elOptionGroupMap); 222 | HashMap elOptionMap = new HashMap<>(); 223 | elOptionMap.put("label", new String[]{}); 224 | elOptionMap.put("value", new String[]{}); 225 | elOptionMap.put("disabled", new String[]{"true", "false"}); 226 | TAG_CONSTANT.put("el-option", elOptionMap); 227 | 228 | HashMap elCascaderMap = new HashMap<>(); 229 | elCascaderMap.put("options", new String[]{"[{value: 'zhinan', label: '指南', children: [{value: 'shejiyuanze', label: '设计原则'}]}]"}); 230 | elCascaderMap.put("props", new String[]{}); 231 | elCascaderMap.put("value", new String[]{}); 232 | elCascaderMap.put("separator", new String[]{"/"}); 233 | elCascaderMap.put("popper-class", new String[]{}); 234 | elCascaderMap.put("placeholder", new String[]{}); 235 | elCascaderMap.put("disabled", new String[]{"true", "false"}); 236 | elCascaderMap.put("clearable", new String[]{"true", "false"}); 237 | elCascaderMap.put("expand-trigger", new String[]{"click", "hover"}); 238 | elCascaderMap.put("show-all-levels", new String[]{"true", "false"}); 239 | elCascaderMap.put("filterable", new String[]{"true", "false"}); 240 | elCascaderMap.put("debounce", new String[]{"300"}); 241 | elCascaderMap.put("change-on-select", new String[]{"true", "false"}); 242 | elCascaderMap.put("size", new String[]{"medium", "small", "mini"}); 243 | elCascaderMap.put("before-filter", new String[]{"function"}); 244 | elCascaderMap.put("@change", new String[]{}); 245 | elCascaderMap.put("@active-item-change", new String[]{}); 246 | elCascaderMap.put("@blur", new String[]{}); 247 | elCascaderMap.put("@focus", new String[]{}); 248 | TAG_CONSTANT.put("el-cascader", elCascaderMap); 249 | 250 | HashMap elSwitchMap = new HashMap<>(); 251 | elSwitchMap.put("disabled", new String[]{"true", "false"}); 252 | elSwitchMap.put("width", new String[]{"40"}); 253 | elSwitchMap.put("active-icon-class", new String[]{}); 254 | elSwitchMap.put("inactive-icon-class", new String[]{}); 255 | elSwitchMap.put("active-text", new String[]{}); 256 | elSwitchMap.put("inactive-text", new String[]{}); 257 | elSwitchMap.put("active-value", new String[]{"true", "false", "1"}); 258 | elSwitchMap.put("inactive-value", new String[]{"true", "false", "1"}); 259 | elSwitchMap.put("active-color", new String[]{"#409eff"}); 260 | elSwitchMap.put("inactive-color", new String[]{"#c0ccda"}); 261 | elSwitchMap.put("name", new String[]{}); 262 | elSwitchMap.put("@change", new String[]{}); 263 | TAG_CONSTANT.put("el-switch", elSwitchMap); 264 | 265 | HashMap elSliderMap = new HashMap<>(); 266 | elSliderMap.put("min", new String[]{"0"}); 267 | elSliderMap.put("max", new String[]{"100"}); 268 | elSliderMap.put("disabled", new String[]{"true", "false"}); 269 | elSliderMap.put("step", new String[]{"1"}); 270 | elSliderMap.put("show-input", new String[]{"true", "false"}); 271 | elSliderMap.put("show-input-controls", new String[]{"true", "false"}); 272 | elSliderMap.put("input-size", new String[]{"large", "medium", "small", "mini"}); 273 | elSliderMap.put("show-stops", new String[]{"true", "false"}); 274 | elSliderMap.put("show-tooltipss", new String[]{"true", "false"}); 275 | elSliderMap.put("format-tooltip", new String[]{"function"}); 276 | elSliderMap.put("range", new String[]{"true", "false"}); 277 | elSliderMap.put("vertical", new String[]{"true", "false"}); 278 | elSliderMap.put("height", new String[]{}); 279 | elSliderMap.put("label", new String[]{}); 280 | elSliderMap.put("debounce", new String[]{"300"}); 281 | elSliderMap.put("tooltip-class", new String[]{}); 282 | elSliderMap.put("@change", new String[]{}); 283 | TAG_CONSTANT.put("el-slider", elSliderMap); 284 | 285 | HashMap elTimePickerMap = new HashMap<>(); 286 | elTimePickerMap.put("readonly", new String[]{"true", "false"}); 287 | elTimePickerMap.put("disabled", new String[]{"true", "false"}); 288 | elTimePickerMap.put("editable", new String[]{"true", "false"}); 289 | elTimePickerMap.put("clearable", new String[]{"true", "false"}); 290 | elTimePickerMap.put("size", new String[]{"medium", "small", "mini"}); 291 | elTimePickerMap.put("placeholder", new String[]{}); 292 | elTimePickerMap.put("start-placeholder", new String[]{}); 293 | elTimePickerMap.put("end-placeholder", new String[]{}); 294 | elTimePickerMap.put("is-range", new String[]{"true", "false"}); 295 | elTimePickerMap.put("arrow-control", new String[]{"true", "false"}); 296 | elTimePickerMap.put("value", new String[]{}); 297 | elTimePickerMap.put("align-", new String[]{"left", "center", "right"}); 298 | elTimePickerMap.put("popper-class", new String[]{}); 299 | elTimePickerMap.put("picker-options", new String[]{"{ selectableRange: ['09:30:00 - 12:00:00', '14:30:00 - 18:30:00'], format: 'HH:mm:ss'}"}); 300 | elTimePickerMap.put("range-separator", new String[]{"-"}); 301 | elTimePickerMap.put("value-format", new String[]{}); 302 | elTimePickerMap.put("default-value", new String[]{}); 303 | elTimePickerMap.put("name", new String[]{}); 304 | elTimePickerMap.put("prefix-icon", new String[]{"el-icon-time"}); 305 | elTimePickerMap.put("clear-icon", new String[]{"el-icon-circle-close"}); 306 | elTimePickerMap.put("@change", new String[]{}); 307 | elTimePickerMap.put("@blur", new String[]{}); 308 | elTimePickerMap.put("@focus", new String[]{}); 309 | TAG_CONSTANT.put("el-time-picker", elTimePickerMap); 310 | HashMap elTimeSelectMap = new HashMap<>(); 311 | elTimeSelectMap.put("placeholder", new String[]{}); 312 | elTimeSelectMap.put("picker-options", new String[]{"{ start: '08:30', step: '00:15', end: '18:30', minTime: '00:00', maxTime: '00:00'}"}); 313 | TAG_CONSTANT.put("el-time-select", elTimeSelectMap); 314 | 315 | HashMap elDatePickerMap = new HashMap<>(); 316 | elDatePickerMap.put("readonly", new String[]{"true", "false"}); 317 | elDatePickerMap.put("disabled", new String[]{"true", "false"}); 318 | elDatePickerMap.put("editable", new String[]{"true", "false"}); 319 | elDatePickerMap.put("clearable", new String[]{"true", "false"}); 320 | elDatePickerMap.put("size", new String[]{"large", "small", "mini"}); 321 | elDatePickerMap.put("placeholder", new String[]{}); 322 | elDatePickerMap.put("start-placeholder", new String[]{}); 323 | elDatePickerMap.put("end-placeholder", new String[]{}); 324 | elDatePickerMap.put("type", new String[]{"year", "month", "date", "dates", "week", "datetime", "datetimerange", "daterange"}); 325 | elDatePickerMap.put("format", new String[]{"yyyy-MM-dd"}); 326 | elDatePickerMap.put("align-", new String[]{"left", "center", "right"}); 327 | elDatePickerMap.put("popper-class", new String[]{}); 328 | elDatePickerMap.put("picker-options", new String[]{"{shortcuts: [], disabledDate,: function, firstDayOfWeek: 7, onPick: Function({ maxDate, minDate })}"}); 329 | elDatePickerMap.put("range-separator", new String[]{"-"}); 330 | elDatePickerMap.put("default-value", new String[]{}); 331 | elDatePickerMap.put("default-time", new String[]{}); 332 | elDatePickerMap.put("value-format", new String[]{}); 333 | elDatePickerMap.put("name", new String[]{}); 334 | elDatePickerMap.put("unlink-panels", new String[]{"true", "false"}); 335 | elDatePickerMap.put("prefix-icon", new String[]{"el-icon-date"}); 336 | elDatePickerMap.put("clear-icon", new String[]{"el-icon-circle-close"}); 337 | elDatePickerMap.put("@change", new String[]{}); 338 | elDatePickerMap.put("@blur", new String[]{}); 339 | elDatePickerMap.put("@focus", new String[]{}); 340 | TAG_CONSTANT.put("el-date-picker", elDatePickerMap); 341 | HashMap elUploadMap = new HashMap<>(); 342 | elUploadMap.put("action", new String[]{}); 343 | elUploadMap.put("headers", new String[]{}); 344 | elUploadMap.put("multiple", new String[]{"true", "false"}); 345 | elUploadMap.put("data", new String[]{}); 346 | elUploadMap.put("name", new String[]{"file"}); 347 | elUploadMap.put("with-credentials", new String[]{"true", "false"}); 348 | elUploadMap.put("show-file-list", new String[]{"true", "false"}); 349 | elUploadMap.put("drag", new String[]{"true", "false"}); 350 | elUploadMap.put("accept", new String[]{}); 351 | elUploadMap.put("on-preview", new String[]{"function(file)"}); 352 | elUploadMap.put("on-remove", new String[]{"function(file, fileList)"}); 353 | elUploadMap.put("on-success", new String[]{"function(response, file, fileList)"}); 354 | elUploadMap.put("on-error", new String[]{"function(err, file, fileList)"}); 355 | elUploadMap.put("on-progress", new String[]{"function(event, file, fileList)"}); 356 | elUploadMap.put("on-change", new String[]{"function(file, fileList)"}); 357 | elUploadMap.put("before-upload", new String[]{"function(file)"}); 358 | elUploadMap.put("before-remove", new String[]{"function(file, fileList)"}); 359 | elUploadMap.put("list-type", new String[]{"text", "picture", "picture-card"}); 360 | elUploadMap.put("auto-upload", new String[]{"true", "false"}); 361 | elUploadMap.put("file-list", new String[]{"[]"}); 362 | elUploadMap.put("http-request", new String[]{}); 363 | elUploadMap.put("disabled", new String[]{"true", "false"}); 364 | elUploadMap.put("limit", new String[]{"10"}); 365 | elUploadMap.put("on-exceed", new String[]{"function(files, fileList)"}); 366 | elUploadMap.put("clearFiles", new String[]{}); 367 | elUploadMap.put("abort", new String[]{}); 368 | TAG_CONSTANT.put("el-upload", elUploadMap); 369 | 370 | HashMap elRateMap = new HashMap<>(); 371 | elRateMap.put("max", new String[]{"5"}); 372 | elRateMap.put("disabled", new String[]{"true", "false"}); 373 | elRateMap.put("allow-half", new String[]{"true", "false"}); 374 | elRateMap.put("low-threshold", new String[]{"2"}); 375 | elRateMap.put("high-threshold", new String[]{"4"}); 376 | elRateMap.put("colors", new String[]{"['#f7ba2a', '#f7ba2a', '#f7ba2a']"}); 377 | elRateMap.put("void-color", new String[]{"#c6d1de"}); 378 | elRateMap.put("disabled-void-color", new String[]{"#eff2f7"}); 379 | elRateMap.put("icon-classes", new String[]{"['el-icon-star-on', 'el-icon-star-on','el-icon-star-on']"}); 380 | elRateMap.put("void-icon-class", new String[]{"el-icon-star-off"}); 381 | elRateMap.put("disabled-void-icon-class", new String[]{"el-icon-star-on"}); 382 | elRateMap.put("show-text", new String[]{"true", "false"}); 383 | elRateMap.put("show-score", new String[]{"true", "false"}); 384 | elRateMap.put("text-color", new String[]{"#1f2d3d"}); 385 | elRateMap.put("texts", new String[]{"['极差', '失望', '一般', '满意', '惊喜']"}); 386 | elRateMap.put("score-template", new String[]{"{value}"}); 387 | elRateMap.put("@change", new String[]{}); 388 | TAG_CONSTANT.put("el-rate", elRateMap); 389 | HashMap elColorPickerMap = new HashMap<>(); 390 | elColorPickerMap.put("disabled", new String[]{"true", "false"}); 391 | elColorPickerMap.put("size", new String[]{"medium", "small", "mini"}); 392 | elColorPickerMap.put("show-alpha", new String[]{"true", "false"}); 393 | elColorPickerMap.put("color-format", new String[]{"hsl", "hsv", "hex", "rgb"}); 394 | elColorPickerMap.put("popper-class", new String[]{}); 395 | elColorPickerMap.put("predefine", new String[]{}); 396 | elColorPickerMap.put("@change", new String[]{}); 397 | elColorPickerMap.put("@active-change", new String[]{}); 398 | TAG_CONSTANT.put("el-color-picker", elColorPickerMap); 399 | HashMap elTransferMap = new HashMap<>(); 400 | elTransferMap.put("data", new String[]{"[{key: 1, label: '1'}, {key: 2, label: '2'}]"}); 401 | elTransferMap.put("filterable", new String[]{"true", "false"}); 402 | elTransferMap.put("filter-placeholder", new String[]{"请输入搜索内容"}); 403 | elTransferMap.put("filter-method", new String[]{}); 404 | elTransferMap.put("target-order", new String[]{"original", "push", "unshift"}); 405 | elTransferMap.put("titles", new String[]{"['列表 1', '列表 2']"}); 406 | elTransferMap.put("button-texts", new String[]{"[]"}); 407 | elTransferMap.put("render-content", new String[]{"function(h, option)"}); 408 | elTransferMap.put("format", new String[]{"{ noChecked: '${checked}/${total}', hasChecked: '${checked}/${total}' }"}); 409 | elTransferMap.put("props", new String[]{}); 410 | elTransferMap.put("left-default-checked", new String[]{"[]"}); 411 | elTransferMap.put("right-default-checked", new String[]{"[]"}); 412 | elTransferMap.put("clearQuery", new String[]{}); 413 | elTransferMap.put("@change", new String[]{}); 414 | elTransferMap.put("@left-check-change", new String[]{}); 415 | elTransferMap.put("@right-check-change", new String[]{}); 416 | TAG_CONSTANT.put("el-transfer", elTransferMap); 417 | 418 | HashMap elFormMap = new HashMap<>(); 419 | elFormMap.put("model", new String[]{}); 420 | elFormMap.put("rules", new String[]{}); 421 | elFormMap.put("inline", new String[]{"true", "false"}); 422 | elFormMap.put("label-position", new String[]{"right", "left", "top"}); 423 | elFormMap.put("label-width", new String[]{"80px"}); 424 | elFormMap.put("label-suffix", new String[]{}); 425 | elFormMap.put("show-message", new String[]{"true", "false"}); 426 | elFormMap.put("inline-message", new String[]{"true", "false"}); 427 | elFormMap.put("status-icon", new String[]{"true", "false"}); 428 | elFormMap.put("validate-on-rule-change", new String[]{"true", "false"}); 429 | elFormMap.put("size", new String[]{"medium", "small", "mini"}); 430 | elFormMap.put("disabled", new String[]{"true", "false"}); 431 | elFormMap.put("validate", new String[]{"Function(callback: Function(boolean, object))"}); 432 | elFormMap.put("validateField", new String[]{"Function(prop: string, callback: Function(errorMessage: string))"}); 433 | elFormMap.put("resetFields", new String[]{"Function"}); 434 | elFormMap.put("clearValidate", new String[]{"Function"}); 435 | elFormMap.put("@validate", new String[]{}); 436 | TAG_CONSTANT.put("el-form", elFormMap); 437 | HashMap elFormItemMap = new HashMap<>(); 438 | elFormItemMap.put("prop", new String[]{}); 439 | elFormItemMap.put("label", new String[]{}); 440 | elFormItemMap.put("label-width", new String[]{"80px"}); 441 | elFormItemMap.put("required", new String[]{"true", "false"}); 442 | elFormItemMap.put("rules", new String[]{}); 443 | elFormItemMap.put("error", new String[]{}); 444 | elFormItemMap.put("show-message", new String[]{"true", "false"}); 445 | elFormItemMap.put("inline-message", new String[]{"true", "false"}); 446 | elFormItemMap.put("size", new String[]{"medium", "small", "mini"}); 447 | elFormItemMap.put("resetField", new String[]{"function"}); 448 | TAG_CONSTANT.put("el-form-item", elFormItemMap); 449 | 450 | HashMap elTableMap = new HashMap<>(); 451 | elTableMap.put("height", new String[]{}); 452 | elTableMap.put("max-height", new String[]{}); 453 | elTableMap.put("stripe", new String[]{"true", "false"}); 454 | elTableMap.put("border", new String[]{"true", "false"}); 455 | elTableMap.put("size", new String[]{"medium", "small", "mini"}); 456 | elTableMap.put("fit", new String[]{"true", "false"}); 457 | elTableMap.put("show-header", new String[]{"true", "false"}); 458 | elTableMap.put("highlight-current-row", new String[]{"true", "false"}); 459 | elTableMap.put("current-row-key", new String[]{}); 460 | elTableMap.put("row-class-name", new String[]{}); 461 | elTableMap.put("row-style", new String[]{}); 462 | elTableMap.put("cell-class-name", new String[]{}); 463 | elTableMap.put("cell-style", new String[]{}); 464 | elTableMap.put("header-row-class-name", new String[]{}); 465 | elTableMap.put("header-row-style", new String[]{}); 466 | elTableMap.put("header-cell-class-name", new String[]{}); 467 | elTableMap.put("header-cell-style", new String[]{}); 468 | elTableMap.put("row-key", new String[]{}); 469 | elTableMap.put("empty-text", new String[]{"暂无数据"}); 470 | elTableMap.put("default-expand-all", new String[]{"true", "false"}); 471 | elTableMap.put("expand-row-keys", new String[]{}); 472 | elTableMap.put("default-sort", new String[]{"ascending", "descending"}); 473 | elTableMap.put("tooltip-effect", new String[]{"dark", "light"}); 474 | elTableMap.put("show-summary", new String[]{"true", "false"}); 475 | elTableMap.put("sum-text", new String[]{"合计"}); 476 | elTableMap.put("summary-method", new String[]{}); 477 | elTableMap.put("span-method", new String[]{}); 478 | elTableMap.put("select-on-indeterminate", new String[]{}); 479 | elTableMap.put("@select", new String[]{"function(selection, row)"}); 480 | elTableMap.put("@select-all", new String[]{"function(selection)"}); 481 | elTableMap.put("@selection-change", new String[]{"function(selection)"}); 482 | elTableMap.put("@cell-mouse-enter", new String[]{"function(row, column, cell, event)"}); 483 | elTableMap.put("@cell-mouse-leave", new String[]{"function(row, column, cell, event)"}); 484 | elTableMap.put("@cell-click", new String[]{"function(row, column, cell, event)"}); 485 | elTableMap.put("@cell-dblclick", new String[]{"function(row, column, cell, event)"}); 486 | elTableMap.put("@row-click", new String[]{"function(row, event, column)"}); 487 | elTableMap.put("@row-contextmenu", new String[]{"function(row, event)"}); 488 | elTableMap.put("@row-dblclick", new String[]{"function(row, event)"}); 489 | elTableMap.put("@header-click", new String[]{"function(column, event)"}); 490 | elTableMap.put("@header-contextmenu", new String[]{"function(column, event)"}); 491 | elTableMap.put("@sort-change", new String[]{"function({ column, prop, order })"}); 492 | elTableMap.put("@filter-change", new String[]{"function(filters)"}); 493 | elTableMap.put("@current-change", new String[]{"function(currentRow, oldCurrentRow)"}); 494 | elTableMap.put("@header-dragend", new String[]{"function(newWidth, oldWidth, column, event)"}); 495 | elTableMap.put("@expand-change", new String[]{"function(row, expandedRows)"}); 496 | elTableMap.put("clearSelection", new String[]{}); 497 | elTableMap.put("toggleRowSelection", new String[]{"function(row, selected)"}); 498 | elTableMap.put("toggleRowExpansion", new String[]{"function(row, expanded)"}); 499 | elTableMap.put("setCurrentRow", new String[]{"function(row)"}); 500 | elTableMap.put("clearSort", new String[]{"function"}); 501 | elTableMap.put("clearFilter", new String[]{"function"}); 502 | elTableMap.put("doLayout", new String[]{"function"}); 503 | TAG_CONSTANT.put("el-table", elTableMap); 504 | 505 | HashMap elTableColumnMap = new HashMap<>(); 506 | elTableColumnMap.put("type", new String[]{"selection", "index", "expand"}); 507 | elTableColumnMap.put("index", new String[]{}); 508 | elTableColumnMap.put("column-key", new String[]{}); 509 | elTableColumnMap.put("label", new String[]{}); 510 | elTableColumnMap.put("prop", new String[]{}); 511 | elTableColumnMap.put("width", new String[]{"100px"}); 512 | elTableColumnMap.put("min-width", new String[]{"100px"}); 513 | elTableColumnMap.put("fixed", new String[]{"true", "left", "right"}); 514 | elTableColumnMap.put("render-header", new String[]{"Function(h, { column, $index })"}); 515 | elTableColumnMap.put("sortable", new String[]{"true", "false", "custom"}); 516 | elTableColumnMap.put("sort-method", new String[]{"Function(a, b)"}); 517 | elTableColumnMap.put("sort-by", new String[]{}); 518 | elTableColumnMap.put("resizable", new String[]{"true", "false"}); 519 | elTableColumnMap.put("formatter", new String[]{"Function(row, column, cellValue, index)"}); 520 | elTableColumnMap.put("show-overflow-tooltip", new String[]{"true", "false"}); 521 | elTableColumnMap.put("align-", new String[]{"left", "center", "right"}); 522 | elTableColumnMap.put("header-align", new String[]{"left", "center", "right"}); 523 | elTableColumnMap.put("class-name", new String[]{}); 524 | elTableColumnMap.put("label-class-name", new String[]{}); 525 | elTableColumnMap.put("selectable", new String[]{"Function(row, index)"}); 526 | elTableColumnMap.put("reserve-selection", new String[]{"true", "false"}); 527 | elTableColumnMap.put("filters", new String[]{"[{ text, value }]"}); 528 | elTableColumnMap.put("filter-placement", new String[]{}); 529 | elTableColumnMap.put("filter-multiple", new String[]{"true", "false"}); 530 | elTableColumnMap.put("filter-method", new String[]{"Function(value, row, column)"}); 531 | elTableColumnMap.put("filtered-value", new String[]{"[]"}); 532 | TAG_CONSTANT.put("el-table-column", elTableColumnMap); 533 | 534 | HashMap elTagMap = new HashMap<>(); 535 | elTagMap.put("type", new String[]{"success", "info", "warning", "danger"}); 536 | elTagMap.put("closable", new String[]{"true", "false"}); 537 | elTagMap.put("disable-transitions", new String[]{"true", "false"}); 538 | elTagMap.put("hit", new String[]{"true", "false"}); 539 | elTagMap.put("color", new String[]{}); 540 | elTagMap.put("size", new String[]{"medium", "small", "mini"}); 541 | elTagMap.put("@close", new String[]{}); 542 | TAG_CONSTANT.put("el-tag", elTagMap); 543 | 544 | HashMap elProgressMap = new HashMap<>(); 545 | elProgressMap.put("percentage", new String[]{"0"}); 546 | elProgressMap.put("type", new String[]{"line", "circle"}); 547 | elProgressMap.put("stroke-width", new String[]{"6"}); 548 | elProgressMap.put("text-inside", new String[]{"true", "false"}); 549 | elProgressMap.put("status", new String[]{"success", "exception"}); 550 | elProgressMap.put("color", new String[]{}); 551 | elProgressMap.put("width", new String[]{"126"}); 552 | elProgressMap.put("show-text", new String[]{"true", "false"}); 553 | TAG_CONSTANT.put("el-progress", elProgressMap); 554 | 555 | HashMap elTreeMap = new HashMap<>(); 556 | elTreeMap.put("data", new String[]{"[{label, children: {label, children}]"}); 557 | elTreeMap.put("empty-text", new String[]{"暂无内容"}); 558 | elTreeMap.put("node-key", new String[]{}); 559 | elTreeMap.put("props", new String[]{"{label, children, disabled, isLeaf}"}); 560 | elTreeMap.put("render-after-expand", new String[]{"true", "false"}); 561 | elTreeMap.put("load", new String[]{"function(node, resolve)"}); 562 | elTreeMap.put("render-content", new String[]{"Function(h, { node, data, store }"}); 563 | elTreeMap.put("highlight-current", new String[]{"true", "false"}); 564 | elTreeMap.put("default-expand-all", new String[]{"true", "false"}); 565 | elTreeMap.put("expand-on-click-node", new String[]{"true", "false"}); 566 | elTreeMap.put("auto-expand-parent", new String[]{"true", "false"}); 567 | elTreeMap.put("default-expanded-keys", new String[]{"[]"}); 568 | elTreeMap.put("show-checkbox", new String[]{"true", "false"}); 569 | elTreeMap.put("check-strictly", new String[]{"true", "false"}); 570 | elTreeMap.put("default-checked-keys", new String[]{"[]"}); 571 | elTreeMap.put("filter-node-method", new String[]{"Function(value, data, node)"}); 572 | elTreeMap.put("accordion", new String[]{"true", "false"}); 573 | elTreeMap.put("indent", new String[]{"16"}); 574 | elTreeMap.put("lazy", new String[]{"true", "false"}); 575 | elTreeMap.put("draggable", new String[]{"true", "false"}); 576 | elTreeMap.put("allow-drag", new String[]{"Function(node)"}); 577 | elTreeMap.put("allow-drop", new String[]{"Function(draggingNode, dropNode, type)"}); 578 | elTreeMap.put("filter", new String[]{"function"}); 579 | elTreeMap.put("updateKeyChildren", new String[]{"function(key, data)"}); 580 | elTreeMap.put("getCheckedNodes", new String[]{"function(leafOnly)"}); 581 | elTreeMap.put("setCheckedNodes", new String[]{"function(nodes)"}); 582 | elTreeMap.put("getCheckedKeys", new String[]{"function(leafOnly)"}); 583 | elTreeMap.put("setCheckedKeys", new String[]{"function(keys, leafOnly)"}); 584 | elTreeMap.put("setChecked", new String[]{"function(key/data, checked, deep)"}); 585 | elTreeMap.put("getHalfCheckedNodes", new String[]{"function"}); 586 | elTreeMap.put("getHalfCheckedKeys", new String[]{"function"}); 587 | elTreeMap.put("getCurrentKey", new String[]{"function"}); 588 | elTreeMap.put("getCurrentNode", new String[]{"function"}); 589 | elTreeMap.put("setCurrentKey", new String[]{"function(key)"}); 590 | elTreeMap.put("setCurrentNode", new String[]{"function(node)"}); 591 | elTreeMap.put("getNode", new String[]{"function(data)"}); 592 | elTreeMap.put("remove", new String[]{"function(data)"}); 593 | elTreeMap.put("append", new String[]{"function(data, parentNode)"}); 594 | elTreeMap.put("insertBefore", new String[]{"function(data, refNode)"}); 595 | elTreeMap.put("insertAfter", new String[]{"function(data, refNode)"}); 596 | elTreeMap.put("@node-click", new String[]{}); 597 | elTreeMap.put("@node-contextmenu", new String[]{}); 598 | elTreeMap.put("@check-change", new String[]{}); 599 | elTreeMap.put("@check", new String[]{}); 600 | elTreeMap.put("@current-change", new String[]{}); 601 | elTreeMap.put("@node-expand", new String[]{}); 602 | elTreeMap.put("@node-collapse", new String[]{}); 603 | elTreeMap.put("@node-drag-start", new String[]{}); 604 | elTreeMap.put("@node-drag-enter", new String[]{}); 605 | elTreeMap.put("@node-drag-leave", new String[]{}); 606 | elTreeMap.put("@node-drag-over", new String[]{}); 607 | elTreeMap.put("@node-drag-end", new String[]{}); 608 | elTreeMap.put("@node-drop", new String[]{}); 609 | TAG_CONSTANT.put("el-tree", elTreeMap); 610 | 611 | HashMap elPaginationMap = new HashMap<>(); 612 | elPaginationMap.put("small", new String[]{"true", "false"}); 613 | elPaginationMap.put("background", new String[]{"true", "false"}); 614 | elPaginationMap.put("page-size", new String[]{"10"}); 615 | elPaginationMap.put("total", new String[]{"100"}); 616 | elPaginationMap.put("page-count", new String[]{"10"}); 617 | elPaginationMap.put("pager-count", new String[]{"7"}); 618 | elPaginationMap.put("current-page", new String[]{"1"}); 619 | elPaginationMap.put("layout", new String[]{"sizes, prev, pager, next, jumper, ->, total, slot"}); 620 | elPaginationMap.put("page-sizes", new String[]{"[10, 20, 30, 40, 50, 100]"}); 621 | elPaginationMap.put("popper-class", new String[]{}); 622 | elPaginationMap.put("prev-text", new String[]{"上一页"}); 623 | elPaginationMap.put("next-text", new String[]{"下一页"}); 624 | elPaginationMap.put("disabled", new String[]{"true", "false"}); 625 | elPaginationMap.put("@size-change", new String[]{}); 626 | elPaginationMap.put("@current-change", new String[]{}); 627 | elPaginationMap.put("@prev-click", new String[]{}); 628 | elPaginationMap.put("@next-click", new String[]{}); 629 | TAG_CONSTANT.put("el-pagination", elPaginationMap); 630 | 631 | HashMap elBadgeMap = new HashMap<>(); 632 | elBadgeMap.put("value", new String[]{}); 633 | elBadgeMap.put("max", new String[]{"10"}); 634 | elBadgeMap.put("is-dot", new String[]{"true", "false"}); 635 | elBadgeMap.put("hidden", new String[]{"true", "false"}); 636 | TAG_CONSTANT.put("el-badge", elBadgeMap); 637 | 638 | HashMap elAlertMap = new HashMap<>(); 639 | elAlertMap.put("title", new String[]{}); 640 | elAlertMap.put("type", new String[]{"success", "warning", "info", "error"}); 641 | elAlertMap.put("description", new String[]{}); 642 | elAlertMap.put("closable", new String[]{"true", "false"}); 643 | elAlertMap.put("center", new String[]{"true", "false"}); 644 | elAlertMap.put("close-text", new String[]{}); 645 | elAlertMap.put("show-icon", new String[]{"true", "false"}); 646 | elAlertMap.put("@close", new String[]{}); 647 | TAG_CONSTANT.put("el-alert", elAlertMap); 648 | 649 | HashMap elMenuMap = new HashMap<>(); 650 | elMenuMap.put("mode", new String[]{"horizontal", "vertical"}); 651 | elMenuMap.put("collapse", new String[]{"true", "false"}); 652 | elMenuMap.put("background-color", new String[]{"#ffffff"}); 653 | elMenuMap.put("text-color", new String[]{"#303133"}); 654 | elMenuMap.put("active-text-color", new String[]{"#409eff"}); 655 | elMenuMap.put("default-active", new String[]{}); 656 | elMenuMap.put("default-openeds", new String[]{"[]"}); 657 | elMenuMap.put("unique-opened", new String[]{"true", "false"}); 658 | elMenuMap.put("menu-trigger", new String[]{"hover"}); 659 | elMenuMap.put("router", new String[]{"true", "false"}); 660 | elMenuMap.put("collapse-transition", new String[]{"true", "false"}); 661 | elMenuMap.put("open", new String[]{"function(index)"}); 662 | elMenuMap.put("close", new String[]{"function(index)"}); 663 | elMenuMap.put("@select", new String[]{}); 664 | elMenuMap.put("@open", new String[]{}); 665 | elMenuMap.put("@close", new String[]{}); 666 | TAG_CONSTANT.put("el-menu", elMenuMap); 667 | 668 | HashMap elSubMenuMap = new HashMap<>(); 669 | elSubMenuMap.put("index", new String[]{}); 670 | elSubMenuMap.put("popper-class", new String[]{}); 671 | elSubMenuMap.put("show-timeout", new String[]{"300"}); 672 | elSubMenuMap.put("hide-timeout", new String[]{"300"}); 673 | elSubMenuMap.put("disabled", new String[]{"true", "false"}); 674 | elSubMenuMap.put("popper-append-to-body", new String[]{"true", "false"}); 675 | TAG_CONSTANT.put("el-submenu", elSubMenuMap); 676 | 677 | HashMap elMenuItemMap = new HashMap<>(); 678 | elMenuItemMap.put("index", new String[]{}); 679 | elMenuItemMap.put("route", new String[]{}); 680 | elMenuItemMap.put("disabled", new String[]{"true", "false"}); 681 | TAG_CONSTANT.put("el-menu-item", elMenuItemMap); 682 | 683 | HashMap elMenuGroupMap = new HashMap<>(); 684 | elMenuGroupMap.put("title", new String[]{}); 685 | TAG_CONSTANT.put("el-menu-group", elMenuGroupMap); 686 | 687 | HashMap elTabsMap = new HashMap<>(); 688 | elTabsMap.put("type", new String[]{"card", "border-card"}); 689 | elTabsMap.put("closable", new String[]{"true", "false"}); 690 | elTabsMap.put("addable", new String[]{"true", "false"}); 691 | elTabsMap.put("editable", new String[]{"true", "false"}); 692 | elTabsMap.put("value", new String[]{}); 693 | elTabsMap.put("tab-position", new String[]{"top", "right", "bottom", "left"}); 694 | elTabsMap.put("@tab-click", new String[]{}); 695 | elTabsMap.put("@tab-remove", new String[]{}); 696 | elTabsMap.put("@tab-add", new String[]{}); 697 | elTabsMap.put("@edit", new String[]{}); 698 | TAG_CONSTANT.put("el-tabs", elTabsMap); 699 | 700 | HashMap elTabPaneMap = new HashMap<>(); 701 | elTabPaneMap.put("label", new String[]{}); 702 | elTabPaneMap.put("disabled", new String[]{"true", "false"}); 703 | elTabPaneMap.put("name", new String[]{}); 704 | elTabPaneMap.put("closable", new String[]{"true", "false"}); 705 | TAG_CONSTANT.put("el-tab-pane", elTabPaneMap); 706 | 707 | HashMap elBreadcrumbMap = new HashMap<>(); 708 | elBreadcrumbMap.put("separator", new String[]{"/"}); 709 | elBreadcrumbMap.put("separator-class", new String[]{}); 710 | TAG_CONSTANT.put("el-breadcrumb", elBreadcrumbMap); 711 | 712 | HashMap elBreadcrumbItemMap = new HashMap<>(); 713 | elBreadcrumbItemMap.put("to", new String[]{}); 714 | elBreadcrumbItemMap.put("replace", new String[]{"true", "false"}); 715 | TAG_CONSTANT.put("el-breadcrumb-item", elBreadcrumbItemMap); 716 | 717 | HashMap elDropdownMap = new HashMap<>(); 718 | elDropdownMap.put("type", new String[]{"primary", "success", "warning", "danger", "info", "text"}); 719 | elDropdownMap.put("size", new String[]{"medium", "small", "mini"}); 720 | elDropdownMap.put("split-button", new String[]{"true", "false"}); 721 | elDropdownMap.put("placement", new String[]{"top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end"}); 722 | elDropdownMap.put("trigger", new String[]{"hover", "click"}); 723 | elDropdownMap.put("hide-on-click", new String[]{"true", "false"}); 724 | elDropdownMap.put("show-timeout", new String[]{"250"}); 725 | elDropdownMap.put("hide-timeout", new String[]{"150"}); 726 | elDropdownMap.put("@click", new String[]{}); 727 | elDropdownMap.put("@command", new String[]{}); 728 | elDropdownMap.put("@visible-change", new String[]{}); 729 | TAG_CONSTANT.put("el-dropdown", elDropdownMap); 730 | 731 | HashMap elDropdownMenuMap = new HashMap<>(); 732 | elDropdownMenuMap.put("command", new String[]{}); 733 | elDropdownMenuMap.put("disabled", new String[]{"true", "false"}); 734 | elDropdownMenuMap.put("divided", new String[]{"true", "false"}); 735 | TAG_CONSTANT.put("el-dropdown-menu", elDropdownMenuMap); 736 | 737 | HashMap elStepsMap = new HashMap<>(); 738 | elStepsMap.put("space", new String[]{}); 739 | elStepsMap.put("direction", new String[]{"vertical", "horizontal"}); 740 | elStepsMap.put("active", new String[]{"0"}); 741 | elStepsMap.put("process-status", new String[]{"wait", "process", "finish", "error", "success"}); 742 | elStepsMap.put("finish-status", new String[]{"wait", "process", "finish", "error", "success"}); 743 | elStepsMap.put("align-center", new String[]{"true", "false"}); 744 | elStepsMap.put("simple", new String[]{"true", "false"}); 745 | TAG_CONSTANT.put("el-steps", elStepsMap); 746 | HashMap elStepMap = new HashMap<>(); 747 | elStepMap.put("title", new String[]{}); 748 | elStepMap.put("description", new String[]{}); 749 | elStepMap.put("icon", new String[]{}); 750 | elStepMap.put("status", new String[]{"wait", "process", "finish", "error", "success"}); 751 | TAG_CONSTANT.put("el-step", elStepMap); 752 | 753 | HashMap elDialogMap = new HashMap<>(); 754 | elDialogMap.put("visible", new String[]{"true", "false"}); 755 | elDialogMap.put("title", new String[]{}); 756 | elDialogMap.put("width", new String[]{"50%"}); 757 | elDialogMap.put("fullscreen", new String[]{"true", "false"}); 758 | elDialogMap.put("top", new String[]{"15px"}); 759 | elDialogMap.put("modal", new String[]{"true", "false"}); 760 | elDialogMap.put("modal-append-to-body", new String[]{"true", "false"}); 761 | elDialogMap.put("append-to-body", new String[]{"true", "false"}); 762 | elDialogMap.put("lock-scroll", new String[]{"true", "false"}); 763 | elDialogMap.put("custom-class", new String[]{}); 764 | elDialogMap.put("close-on-click-modal", new String[]{"true", "false"}); 765 | elDialogMap.put("close-on-press-escape", new String[]{"true", "false"}); 766 | elDialogMap.put("show-close", new String[]{"true", "false"}); 767 | elDialogMap.put("before-close", new String[]{"function(done)"}); 768 | elDialogMap.put("center", new String[]{"true", "false"}); 769 | elDialogMap.put("@close", new String[]{}); 770 | elDialogMap.put("@open", new String[]{}); 771 | TAG_CONSTANT.put("el-dialog", elDialogMap); 772 | 773 | HashMap elTooltipMap = new HashMap<>(); 774 | elTooltipMap.put("effect", new String[]{"dark", "light"}); 775 | elTooltipMap.put("content", new String[]{}); 776 | elTooltipMap.put("placement", new String[]{"top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "right", "right-start", "right-end"}); 777 | elTooltipMap.put("value", new String[]{"true", "false"}); 778 | elTooltipMap.put("disabled", new String[]{"true", "false"}); 779 | elTooltipMap.put("offset", new String[]{"0"}); 780 | elTooltipMap.put("transition", new String[]{"el-fade-in-linear"}); 781 | elTooltipMap.put("visible-arrow", new String[]{"true", "false"}); 782 | elTooltipMap.put("popper-options", new String[]{"{ boundariesElement: 'body', gpuAcceleration: false }"}); 783 | elTooltipMap.put("open-delay", new String[]{"0"}); 784 | elTooltipMap.put("manual", new String[]{"true", "false"}); 785 | elTooltipMap.put("popper-class", new String[]{}); 786 | elTooltipMap.put("enterable", new String[]{"true", "false"}); 787 | elTooltipMap.put("hide-after", new String[]{"0"}); 788 | TAG_CONSTANT.put("el-tooltip", elTooltipMap); 789 | 790 | HashMap elPopoverMap = new HashMap<>(); 791 | elPopoverMap.put("trigger", new String[]{"click", "focus", "hover", "manual"}); 792 | elPopoverMap.put("title", new String[]{}); 793 | elPopoverMap.put("content", new String[]{}); 794 | elPopoverMap.put("width", new String[]{"150px"}); 795 | elPopoverMap.put("placement", new String[]{"top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "right", "right-start", "right-end"}); 796 | elPopoverMap.put("disabled", new String[]{"true", "false"}); 797 | elPopoverMap.put("value", new String[]{"true", "false"}); 798 | elPopoverMap.put("offset", new String[]{"0"}); 799 | elPopoverMap.put("transition", new String[]{"fade-in-linear"}); 800 | elPopoverMap.put("visible-arrow", new String[]{"true", "false"}); 801 | elPopoverMap.put("popper-options", new String[]{"{ boundariesElement: 'body', gpuAcceleration: false }"}); 802 | elPopoverMap.put("popper-class", new String[]{}); 803 | elPopoverMap.put("open-delay", new String[]{"300"}); 804 | elPopoverMap.put("@show", new String[]{}); 805 | elPopoverMap.put("@after-enter", new String[]{}); 806 | elPopoverMap.put("@hide", new String[]{}); 807 | elPopoverMap.put("@after-leave", new String[]{}); 808 | TAG_CONSTANT.put("el-popover", elPopoverMap); 809 | 810 | HashMap elCardMap = new HashMap<>(); 811 | elCardMap.put("header", new String[]{}); 812 | elCardMap.put("body-style", new String[]{"{ padding: '20px' }"}); 813 | elCardMap.put("shadow", new String[]{"always", "hover", "never"}); 814 | TAG_CONSTANT.put("el-card", elCardMap); 815 | 816 | HashMap elCarouselMap = new HashMap<>(); 817 | elCarouselMap.put("height", new String[]{}); 818 | elCarouselMap.put("initial-index", new String[]{"0"}); 819 | elCarouselMap.put("trigger", new String[]{"click"}); 820 | elCarouselMap.put("autoplay", new String[]{"true", "false"}); 821 | elCarouselMap.put("interval", new String[]{"3000"}); 822 | elCarouselMap.put("indicator-position", new String[]{"outside", "none"}); 823 | elCarouselMap.put("arrow", new String[]{"always", "hover", "never"}); 824 | elCarouselMap.put("type", new String[]{"card"}); 825 | elCarouselMap.put("@change", new String[]{}); 826 | TAG_CONSTANT.put("el-carousel", elCarouselMap); 827 | HashMap elCarouselItemMap = new HashMap<>(); 828 | elCarouselItemMap.put("name", new String[]{}); 829 | elCarouselItemMap.put("label", new String[]{}); 830 | TAG_CONSTANT.put("el-carousel-item", elCarouselItemMap); 831 | 832 | HashMap elCollapseMap = new HashMap<>(); 833 | elCollapseMap.put("accordion", new String[]{"true", "false"}); 834 | elCollapseMap.put("value", new String[]{}); 835 | elCollapseMap.put("@change", new String[]{}); 836 | TAG_CONSTANT.put("el-collapse", elCollapseMap); 837 | HashMap elCollapseItemMap = new HashMap<>(); 838 | elCollapseItemMap.put("name", new String[]{}); 839 | elCollapseItemMap.put("title", new String[]{}); 840 | TAG_CONSTANT.put("el-collapse-item", elCollapseItemMap); 841 | } 842 | } 843 | -------------------------------------------------------------------------------- /src/main/java/com/element/xml/ElementTagNameProvider.java: -------------------------------------------------------------------------------- 1 | package com.element.xml; 2 | 3 | import com.intellij.codeInsight.completion.XmlTagInsertHandler; 4 | import com.intellij.codeInsight.lookup.LookupElement; 5 | import com.intellij.codeInsight.lookup.LookupElementBuilder; 6 | import com.intellij.psi.impl.source.xml.XmlElementDescriptorProvider; 7 | import com.intellij.psi.xml.XmlTag; 8 | import com.intellij.xml.XmlElementDescriptor; 9 | import com.intellij.xml.XmlNSDescriptor; 10 | import com.intellij.xml.XmlTagNameProvider; 11 | import org.jetbrains.annotations.NotNull; 12 | import org.jetbrains.annotations.Nullable; 13 | 14 | import java.util.HashMap; 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | /** 19 | * 标签自动完成 20 | * @author sjl 21 | */ 22 | public class ElementTagNameProvider implements XmlElementDescriptorProvider, XmlTagNameProvider { 23 | 24 | /** 25 | * 添加属性元素标签 26 | * 在输入 < 后执行, 需在plugin.xml中配置xml.tagNameProvider 27 | * @param list 28 | * @param xmlTag 29 | * @param s 30 | */ 31 | @Override 32 | public void addTagNameVariants(List list, @NotNull XmlTag xmlTag, String s) { 33 | for (Map.Entry> next : ElementTagConstant.TAG_CONSTANT.entrySet()) { 34 | list.add(LookupElementBuilder.create(next.getKey()).withInsertHandler(XmlTagInsertHandler.INSTANCE)); 35 | } 36 | } 37 | 38 | 39 | /** 40 | * 获取标签描述 41 | * 在任意输入后执行, 需在plugin.xml中配置xml.elementDescriptorProvider 42 | * @param xmlTag 43 | * @return 44 | */ 45 | @Nullable 46 | @Override 47 | public XmlElementDescriptor getDescriptor(XmlTag xmlTag) { 48 | final XmlNSDescriptor nsDescriptor = xmlTag.getNSDescriptor(xmlTag.getNamespace(), false); 49 | final XmlElementDescriptor descriptor = nsDescriptor != null ? nsDescriptor.getElementDescriptor(xmlTag) : null; 50 | // 判断是否包含在特定处理标签内 51 | boolean special = false; 52 | for (Map.Entry> next : ElementTagConstant.TAG_CONSTANT.entrySet()) { 53 | if (next.getKey().equals(xmlTag.getName())) { 54 | special = true; 55 | break; 56 | } 57 | } 58 | if (!special) { 59 | return null; 60 | } 61 | 62 | return new ElementAnyXmlElementDescriptor(descriptor, nsDescriptor, xmlTag.getName()); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | com.shen.plugin.element 3 | element 4 | 2.0 5 | element 6 | 7 | 8 | 9 | 10 | vuejs 13 | ]]> 14 | 15 | 2. add tag special attribute and auto tip. 17 | ]]> 18 | 19 | 20 | 22 | 25 | JavaScript 26 | com.intellij.modules.platform 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/resources/element.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | 17 | 23 | 24 | 30 | 31 | 37 | 38 | 44 | 45 | 54 | 55 | 63 | 64 | 70 | 71 | 80 | 81 | 92 | 93 | 100 | 101 | 109 | 110 | 122 | 123 | 132 | 133 | 141 | 142 | 150 | 151 | 159 | 160 | 171 | 172 | 182 | 183 | 192 | 193 | 202 | 203 | 210 | 211 | 218 | 219 | 230 | 231 | 241 | 242 | 250 | 251 | 259 | 260 | 266 | 267 | 273 | 274 | 280 | 281 | 287 | 288 | 294 | 295 | 301 | 302 | 308 | 309 | 315 | 316 | 322 | 323 | 329 | 330 | 336 | 337 | 343 | 344 | 350 | 351 | 357 | 358 | 364 | 365 | 371 | 372 | 378 | 379 | 385 | 386 | 392 | 393 | 399 | 400 | 406 | 407 | 413 | 414 | 420 | 421 | 427 | 428 | 435 | 436 | 443 | 444 | 451 | 452 | 459 | 460 | 467 | 468 | 475 | 476 | 482 | 483 | 489 | 490 | 496 | 497 | 503 | 504 | 510 | 511 | 517 | 518 | 524 | 525 | 531 | 532 | 538 | 539 | 545 | 546 | 552 | 553 | 559 | 560 | 566 | 567 | 573 | 574 | 580 | 581 | 582 | 588 | 589 | 596 | 597 | 604 | 605 | 612 | 613 | 620 | 621 | 628 | 629 | 636 | 637 | 644 | 645 | 652 | 653 | 659 | 660 | 666 | 667 | 673 | 674 | 680 | 681 | 687 | 688 | 694 | 695 | 701 | 702 | 708 | 709 | 715 | 716 | 722 | 723 | 729 | 730 | 736 | 737 | 743 | 744 | 750 | 751 | 757 | 758 | 764 | 765 | 771 | 772 | 778 | 779 | 785 | 786 | 792 | 793 | 799 | 800 | 806 | 807 | 813 | 814 | 820 | 821 | 828 | 829 | 839 | 840 | -------------------------------------------------------------------------------- /src/main/resources/icons/element.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/src/main/resources/icons/element.ai -------------------------------------------------------------------------------- /src/main/resources/icons/element.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiaolong1021/ElementPlugin/efadc61920f761d4343fbfee15803a77e6691499/src/main/resources/icons/element.png --------------------------------------------------------------------------------