mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
IJSDK-788 Cleanup code sample "tree_structure_provider"
This commit is contained in:
parent
d1ce38cd9d
commit
cdc8d6af93
@ -1,8 +1,8 @@
|
||||
// Copyright 2000-2019 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.
|
||||
// Copyright 2000-2020 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.
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.intellij' version '0.4.16'
|
||||
id 'java'
|
||||
id 'org.jetbrains.intellij' version '0.4.16'
|
||||
}
|
||||
|
||||
group 'org.intellij.sdk'
|
||||
@ -11,18 +11,19 @@ version '2.0.0'
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
}
|
||||
|
||||
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
||||
intellij {
|
||||
version '2019.2.4'
|
||||
version '2019.3.3'
|
||||
updateSinceUntilBuild = false
|
||||
}
|
||||
|
||||
patchPluginXml {
|
||||
version = project.version
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#Tue Feb 11 16:56:48 CET 2020
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
@ -1,4 +1,6 @@
|
||||
package org.jetbrains.tutorials.tree.structure;
|
||||
// Copyright 2000-2020 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.
|
||||
|
||||
package org.intellij.sdk.tree_structure_provider;
|
||||
|
||||
import com.intellij.ide.projectView.*;
|
||||
import com.intellij.ide.projectView.impl.nodes.PsiFileNode;
|
||||
@ -9,16 +11,13 @@ import org.jetbrains.annotations.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Anna Bulenkova
|
||||
*/
|
||||
public class TextOnlyTreeStructureProvider implements TreeStructureProvider {
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent,
|
||||
@NotNull Collection<AbstractTreeNode> children,
|
||||
ViewSettings settings) {
|
||||
ArrayList<AbstractTreeNode> nodes = new ArrayList<AbstractTreeNode>();
|
||||
ArrayList<AbstractTreeNode> nodes = new ArrayList<>();
|
||||
for (AbstractTreeNode child : children) {
|
||||
if (child instanceof PsiFileNode) {
|
||||
VirtualFile file = ((PsiFileNode) child).getVirtualFile();
|
||||
@ -36,4 +35,4 @@ public class TextOnlyTreeStructureProvider implements TreeStructureProvider {
|
||||
public Object getData(@NotNull Collection<AbstractTreeNode> selected, @NotNull String dataId) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +1,43 @@
|
||||
<!-- Copyright 2000-2020 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. -->
|
||||
|
||||
<idea-plugin>
|
||||
<id>org.jetbrains.plugins.sample.TreeStructure</id>
|
||||
<name>Tree Structure Provider Demo</name>
|
||||
<version>1.0</version>
|
||||
<vendor>JetBrains</vendor>
|
||||
|
||||
<description>Tree Structure Provider Demo showing only plain text files</description>
|
||||
<!-- Unique id for this plugin. Must stay constant for the life of the plugin. -->
|
||||
<id>org.intellij.sdk.tree_structure_provider</id>
|
||||
|
||||
<idea-version since-build="131"/>
|
||||
<!-- Text to display as name on Preferences/Settings | Plugin page -->
|
||||
<name>SDK: Tree Structure Provider Sample Project</name>
|
||||
|
||||
<!-- The version of this plugin -->
|
||||
<version>2.0.0</version>
|
||||
|
||||
<!-- Compatible with the following versions of IntelliJ Platform -->
|
||||
<idea-version since-build="193.3"/>
|
||||
|
||||
<!-- Product and plugin compatibility requirements -->
|
||||
<depends>com.intellij.modules.platform</depends>
|
||||
|
||||
<!-- Text to display as description on Preferences/Settings | Plugin page -->
|
||||
<description>
|
||||
<![CDATA[
|
||||
Tree Structure Provider Demo showing only plain text files.
|
||||
<br>See the <a href="https://www.jetbrains.org/intellij/sdk/docs/tutorials/tree_structure_view.html">Custom Language Tutorial</a> for more information.
|
||||
]]>
|
||||
</description>
|
||||
<change-notes>
|
||||
<![CDATA[
|
||||
<ul>
|
||||
<li><b>2.0.0</b> Convert to Gradle-based plugin.</li>
|
||||
<li><b>1.0.0</b> Release 2018.3 and earlier.</li>
|
||||
</ul>
|
||||
]]>
|
||||
</change-notes>
|
||||
|
||||
<!-- Text to display as company information on Preferences/Settings | Plugin page -->
|
||||
<vendor url="https://plugins.jetbrains.com">IntelliJ Platform SDK</vendor>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<treeStructureProvider implementation="org.jetbrains.tutorials.tree.structure.TextOnlyTreeStructureProvider"/>
|
||||
<treeStructureProvider implementation="org.intellij.sdk.tree_structure_provider.TextOnlyTreeStructureProvider"/>
|
||||
</extensions>
|
||||
|
||||
</idea-plugin>
|
||||
</idea-plugin>
|
||||
|
@ -0,0 +1,58 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="81" height="80" viewBox="0 0 81 80">
|
||||
<defs>
|
||||
<linearGradient id="pluginsdk_80-a" x1="-.031%" x2="100.053%" y1="49.963%" y2="49.963%">
|
||||
<stop offset="25.81%" stop-color="#F97A12"/>
|
||||
<stop offset="45.91%" stop-color="#B07B58"/>
|
||||
<stop offset="72.41%" stop-color="#577BAE"/>
|
||||
<stop offset="91.05%" stop-color="#1E7CE5"/>
|
||||
<stop offset="100%" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="pluginsdk_80-b" x1="27.55%" x2="82.223%" y1="34.514%" y2="77.605%">
|
||||
<stop offset="0%" stop-color="#F97A12"/>
|
||||
<stop offset="7.18%" stop-color="#CB7A3E"/>
|
||||
<stop offset="15.41%" stop-color="#9E7B6A"/>
|
||||
<stop offset="24.2%" stop-color="#757B91"/>
|
||||
<stop offset="33.44%" stop-color="#537BB1"/>
|
||||
<stop offset="43.24%" stop-color="#387CCC"/>
|
||||
<stop offset="53.81%" stop-color="#237CE0"/>
|
||||
<stop offset="65.52%" stop-color="#147CEF"/>
|
||||
<stop offset="79.25%" stop-color="#0B7CF7"/>
|
||||
<stop offset="100%" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="pluginsdk_80-c" x1="63.121%" x2="40.793%" y1="97.699%" y2="-6.587%">
|
||||
<stop offset="0%" stop-color="#FE315D"/>
|
||||
<stop offset="7.84%" stop-color="#CB417E"/>
|
||||
<stop offset="16.01%" stop-color="#9E4E9B"/>
|
||||
<stop offset="24.74%" stop-color="#755BB4"/>
|
||||
<stop offset="33.92%" stop-color="#5365CA"/>
|
||||
<stop offset="43.65%" stop-color="#386DDB"/>
|
||||
<stop offset="54.14%" stop-color="#2374E9"/>
|
||||
<stop offset="65.76%" stop-color="#1478F3"/>
|
||||
<stop offset="79.4%" stop-color="#0B7BF8"/>
|
||||
<stop offset="100%" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="pluginsdk_80-d" x1="25.331%" x2="93.854%" y1="24.119%" y2="132.621%">
|
||||
<stop offset="0%" stop-color="#FE315D"/>
|
||||
<stop offset="4.023%" stop-color="#F63462"/>
|
||||
<stop offset="10.37%" stop-color="#DF3A71"/>
|
||||
<stop offset="16.67%" stop-color="#C24383"/>
|
||||
<stop offset="29.12%" stop-color="#AD4A91"/>
|
||||
<stop offset="54.98%" stop-color="#755BB4"/>
|
||||
<stop offset="91.75%" stop-color="#1D76ED"/>
|
||||
<stop offset="100%" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<g fill-rule="nonzero" transform="translate(8 8)">
|
||||
<path fill="url(#pluginsdk_80-a)" d="M6.08754566,64 L2.66453526e-15,59.1000946 L0,26.7918961 L30,38.6703369 L10.1403967,64 L6.08754566,64 Z"/>
|
||||
<path fill="url(#pluginsdk_80-b)" d="M20.9524706,64 L52.2740919,31.9159091 L37.6708832,0.460194805 L38.0580944,1.33226763e-15 L64,0 L64,64 L20.9524706,64 Z"/>
|
||||
<path fill="url(#pluginsdk_80-c)" d="M34.4123783,0 L64,0 L64,28.0366227 L49.0078336,44 L34,0.44696173 L34.4123783,0 Z"/>
|
||||
<path fill="url(#pluginsdk_80-d)" d="M30.3358775,64 L0,64 L0,49.9709549 L6.23437817,29.2830519 L0,27.1596093 L0,0 L39.4697238,0 L58,21.3844805 L30.5381317,63.9259091 L30.3358775,64 Z"/>
|
||||
</g>
|
||||
<g fill-rule="nonzero" transform="translate(12 12)">
|
||||
<rect width="56" height="56" fill="#000"/>
|
||||
<rect width="22" height="4" x="4" y="46" fill="#FFFEFE"/>
|
||||
<path fill="#FFFEFE" d="M11.128,25.28 C8.584,25.28 6.016,24.392 4,22.592 L6.184,19.976 C7.696,21.224 9.28,22.016 11.2,22.016 C12.712,22.016 13.624,21.416 13.624,20.432 L13.624,20.384 C13.624,19.448 13.048,18.968 10.24,18.248 C6.856,17.384 4.672,16.448 4.672,13.112 L4.672,13.064 C4.672,10.016 7.12,8 10.552,8 C13,8 15.088,8.768 16.792,10.136 L14.872,12.92 C13.384,11.888 11.92,11.264 10.504,11.264 C9.088,11.264 8.344,11.912 8.344,12.728 L8.344,12.776 C8.344,13.88 9.064,14.24 11.968,14.984 C15.376,15.872 17.296,17.096 17.296,20.024 L17.296,20.072 C17.296,23.408 14.752,25.28 11.128,25.28 Z M19.512,25.04 L19.512,8.24 L26.064,8.24 C31.344,8.24 34.992,11.864 34.992,16.592 L34.992,16.64 C34.992,21.368 31.344,25.04 26.064,25.04 L19.512,25.04 Z M26.064,11.576 L23.208,11.576 L23.208,21.704 L26.064,21.704 C29.088,21.704 31.128,19.664 31.128,16.688 L31.128,16.64 C31.128,13.664 29.088,11.576 26.064,11.576 Z M37.28,25.04 L37.28,8.24 L40.976,8.24 L40.976,15.584 L47.744,8.24 L52.28,8.24 L45.416,15.368 L52.568,25.04 L48.128,25.04 L42.92,17.888 L40.976,19.904 L40.976,25.04 L37.28,25.04 Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.1 KiB |
Loading…
x
Reference in New Issue
Block a user