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 f68df7b commit 13774fd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
13 changes: 5 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ version '3.0.0'

dependencies {
testImplementation 'junit:junit:4.13.2'
implementation 'org.jetbrains:annotations:24.0.1'
compileOnly 'org.jetbrains:annotations:24.0.1'
}

/*https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#intellij-platform-based-products-of-recent-ide-versions*/
/*https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension*/
intellij {
pluginName = 'TreeInfotip'
// 开发环境运行时使用的版本
//version = '2022.3.2'
// 开发环境运行时使用的版本,不同的版本编译会采用默认支持java版本编译
version = '2022.2'
//沙箱目录位置,用于保存IDEA的设置,默认在build文件下面,防止clean,放在根目录下。
sandboxDir = "${rootProject.rootDir}/idea-sandbox"
type = 'IU'
Expand All @@ -55,7 +56,7 @@ intellij {
updateSinceUntilBuild = false
downloadSources = false
//localPath '/Applications/IntelliJ IDEA.app'
localPath = '/Applications/WebStorm.app/Contents'
//localPath = '/Applications/WebStorm.app/Contents'
}

runIde {
Expand All @@ -64,7 +65,3 @@ runIde {
"--add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
"--add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED"]
}

patchPluginXml {

}
25 changes: 14 additions & 11 deletions src/main/java/com/plugins/infotip/FileDirectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,17 +396,16 @@ private static void setXmlToLocationString(VirtualFile virtualFile, AbstractTree
if (null != matchPath) {
//设置备注
final PresentationData presentation = abstractTreeNode.getPresentation();
presentation.getTextAttributesKey();
//设置背景色
presentation.setBackground(Color.green);
//presentation.setBackground(Color.green);
//设置锚定文本
presentation.setLocationString(matchPath.getTitle());
//设置节点本身颜色
presentation.setForcedTextForeground(Color.blue);
//presentation.setForcedTextForeground(Color.blue);
//设置节点本身文本
presentation.setPresentableText(matchPath.getTitle());
//presentation.setPresentableText(matchPath.getTitle());
//设置提示
presentation.setTooltip(matchPath.getTitle());
//presentation.setTooltip(matchPath.getTitle());
}
}

Expand Down Expand Up @@ -440,13 +439,17 @@ private static XmlEntity getMatchPath(VirtualFile virtualFile, Project project)
List<XmlEntity> xml = XmlParsing.getXml(project);
for (XmlEntity listTreeInfo : xml) {
if (listTreeInfo != null) {
String basePath = project.getPresentableUrl();
String canonicalPath = virtualFile.getCanonicalPath();
if (null != basePath && null != canonicalPath) {
String asbbasePath = canonicalPath.substring(basePath.length(), canonicalPath.length());
if (asbbasePath.equals(listTreeInfo.getPath())) {
return listTreeInfo;
try {
String basePath = project.getPresentableUrl();
String canonicalPath = virtualFile.getCanonicalPath();
if (null != basePath && null != canonicalPath) {
String asbbasePath = canonicalPath.substring(basePath.length(), canonicalPath.length());
if (asbbasePath.equals(listTreeInfo.getPath())) {
return listTreeInfo;
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
import com.intellij.ide.projectView.PresentationData;
import com.intellij.ide.projectView.ProjectViewNode;
import com.intellij.ide.projectView.ProjectViewNodeDecorator;
import com.intellij.openapi.project.Project;
import com.intellij.packageDependencies.ui.PackageDependenciesNode;
import com.intellij.ui.ColoredTreeCellRenderer;
import org.jetbrains.annotations.NotNull;

import static com.plugins.infotip.FileDirectory.setLocationString;

Expand Down

0 comments on commit 13774fd

Please sign in to comment.