Skip to content

Commit

Permalink
feat: V3预发布
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Mar 22, 2023
1 parent d29a903 commit f68df7b
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 67 deletions.
73 changes: 40 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,63 +1,70 @@
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url "https://www.jetbrains.com/intellij-repository/releases/" }
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
mavenLocal()
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
google()
gradlePluginPortal()
}

dependencies {
mavenLocal()
}
}

plugins {
id 'idea'
//0.4.21
id 'org.jetbrains.intellij' version '0.7.2'
id 'java'
id 'org.jetbrains.intellij' version '1.13.2'
// Gradle Changelog Plugin
id 'org.jetbrains.changelog' version "1.3.1"
// Gradle Qodana Plugin
id 'org.jetbrains.qodana' version "0.1.13"
}

//2.1 插件配置
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'idea'
apply plugin: 'java'
allprojects {
repositories {
maven { url "https://www.jetbrains.com/intellij-repository/releases/" }
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
google()
gradlePluginPortal()
mavenLocal()
}
}

group 'com.linkkou'
version '2.2.3'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
mavenCentral()
}
version '3.0.0'

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
testImplementation 'junit:junit:4.13.2'
implementation 'org.jetbrains:annotations:24.0.1'
}

/*https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#intellij-platform-based-products-of-recent-ide-versions*/
intellij {
pluginName 'TreeInfotip'
pluginName = 'TreeInfotip'
// 开发环境运行时使用的版本
version '2020.2'
//version = '2022.3.2'
//沙箱目录位置,用于保存IDEA的设置,默认在build文件下面,防止clean,放在根目录下。
sandboxDirectory = "${rootProject.rootDir}/idea-sandbox"
type 'IU'
sandboxDir = "${rootProject.rootDir}/idea-sandbox"
type = 'IU'
// 依赖的插件
//plugins = ['DatabaseTools', 'Velocity']
//Disables updating since-build attribute in plugin.xml
updateSinceUntilBuild false
downloadSources false
localPath '/Applications/IntelliJ IDEA.app'
//localPath '/Applications/WebStorm.app'
updateSinceUntilBuild = false
downloadSources = false
//localPath '/Applications/IntelliJ IDEA.app'
localPath = '/Applications/WebStorm.app/Contents'
}

runIde {
jvmArgs = [
"-javaagent:/Applications/jetbra/fineagent.jar=jetbrains",
"--add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
"--add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED"]
}

patchPluginXml {

}

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
3 changes: 2 additions & 1 deletion src/main/java/com/plugins/infotip/ActionDescriptionIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.plugins.infotip.ui.Icons;
import com.plugins.infotip.ui.IconsList;
import org.jetbrains.annotations.NotNull;
import com.intellij.codeInsight.CodeInsightActionHandler;

import java.awt.*;

Expand All @@ -20,7 +21,7 @@
*
* @author lk
* @version 1.0
* @date 2021/6/7 14:13
* 2021/6/7 14:13
*/
public class ActionDescriptionIcon extends AnAction {

Expand Down
15 changes: 7 additions & 8 deletions src/main/java/com/plugins/infotip/ActionDescriptionText.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
import static com.plugins.infotip.FileDirectory.getBasePath;

/**
* A <code>ActionDescription</code> Class
* 右键菜单
*
* @author lk
* @version 1.0
* @date 2021/6/7 14:13
* 2021/6/7 14:13
*/
public class ActionDescriptionText extends AnAction {

Expand Down Expand Up @@ -44,12 +43,12 @@ public void onCreatePath(String asbbasePath, XmlFile fileDirectoryXml, Project p
});
}


/**
* 项目构建完毕前就显示
* @return boolean
*/
@Override
public void update(@NotNull AnActionEvent event) {
//在Action显示之前,根据选中文件扩展名判定是否显示此Action
//this.getTemplatePresentation().setIcon(AllIcons.Actions.MenuPaste);
public boolean isDumbAware() {
return true;
}


}
32 changes: 23 additions & 9 deletions src/main/java/com/plugins/infotip/FileDirectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.plugins.infotip.ui.Icons;
import org.jetbrains.annotations.NotNull;

import java.awt.*;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand All @@ -29,11 +30,11 @@
import static com.plugins.infotip.FileIcons.getAllIcons;

/**
* A <code>FileDirectory</code> Class
* 文件目录管理
*
* @author lk
* @version 1.0
* @date 2021/6/7 16:48
* 2021/6/7 16:48
*/
public class FileDirectory {

Expand Down Expand Up @@ -384,7 +385,8 @@ private static VirtualFile getVirtualFile(Method[] methods, Object o) {
}

/**
* 设置备注
* 设置备注-文本
* 核心代码实现
*
* @param virtualFile 对象
* @param abstractTreeNode 对象
Expand All @@ -393,12 +395,23 @@ private static void setXmlToLocationString(VirtualFile virtualFile, AbstractTree
XmlEntity matchPath = getMatchPath(virtualFile, abstractTreeNode.getProject());
if (null != matchPath) {
//设置备注
abstractTreeNode.getPresentation().setLocationString(matchPath.getTitle());
final PresentationData presentation = abstractTreeNode.getPresentation();
presentation.getTextAttributesKey();
//设置背景色
presentation.setBackground(Color.green);
//设置锚定文本
presentation.setLocationString(matchPath.getTitle());
//设置节点本身颜色
presentation.setForcedTextForeground(Color.blue);
//设置节点本身文本
presentation.setPresentableText(matchPath.getTitle());
//设置提示
presentation.setTooltip(matchPath.getTitle());
}
}

/**
* 设置备注
* 设置备注-图标
*
* @param virtualFile 对象
* @param data 对象
Expand Down Expand Up @@ -429,10 +442,11 @@ private static XmlEntity getMatchPath(VirtualFile virtualFile, Project project)
if (listTreeInfo != null) {
String basePath = project.getPresentableUrl();
String canonicalPath = virtualFile.getCanonicalPath();
String asbbasePath = canonicalPath.substring(basePath.length(), canonicalPath.length());
//Messages.showMessageDialog(project, presentableUrl + ":" + x.getPath(), "Can't Get Path", AllIcons.Actions.Menu_paste);
if (asbbasePath.equals(listTreeInfo.getPath())) {
return listTreeInfo;
if (null != basePath && null != canonicalPath) {
String asbbasePath = canonicalPath.substring(basePath.length(), canonicalPath.length());
if (asbbasePath.equals(listTreeInfo.getPath())) {
return listTreeInfo;
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/plugins/infotip/FileIcons.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import java.util.ArrayList;

/**
* A <code>FileIcons</code> Class
* 获取IDEA内默认的所有图标
*
* @author lk
* @version 1.0
* @date 2021/6/18 20:09
* 2021/6/18 20:09
*/
public class FileIcons {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,9 @@
*/
public class IgnoreViewNodeDecorator implements ProjectViewNodeDecorator {

public IgnoreViewNodeDecorator(@NotNull Project project) {

}

@Override
public void decorate(ProjectViewNode node, PresentationData data) {
setLocationString(node,data);
}

@Override
public void decorate(PackageDependenciesNode node, ColoredTreeCellRenderer cellRenderer) {
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/plugins/infotip/XmlEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import com.intellij.psi.xml.XmlTag;

/**
* A <code>XMLEntity</code> Class
* XML的实体
*
* @author lk
* @version 1.0
* @date 2021/6/7 17:11
* 2021/6/7 17:11
*/
public class XmlEntity {
/**
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/plugins/infotip/XmlParsing.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
import com.intellij.psi.xml.XmlTag;
import com.plugins.infotip.ui.Icons;

import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

/**
* A <code>XmlParsing</code> Class
* XML的解析
*
* @author lk
* @version 1.0
* @date 2021/6/7 17:12
* 2021/6/7 17:12
*/
public class XmlParsing {

Expand Down Expand Up @@ -77,7 +76,6 @@ public void visitElement(final PsiElement element) {
}
}
});
System.out.println(123);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<vendor email="[email protected]" url="https://github.com/Link-Kou/intellij-treeInfotip">linkkou</vendor>

<!-- 插件版本 -->
<version>2.2.3</version>
<version>3.0.0</version>
<!-- please see https://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
<idea-version since-build="191"/>
<!-- 插件的描述 -->
Expand Down

0 comments on commit f68df7b

Please sign in to comment.