Commits

Brice Dutheil  committed f4ac942

Replaced raw text with links using HyperlinkLabel from the OpenAPI jar

  • Participants
  • Parent commits b0df49e

Comments (0)

Files changed (2)

File src/main/java/jd/ide/intellij/config/JDPluginConfigurationPane.form

 <?xml version="1.0" encoding="UTF-8"?>
 <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="jd.ide.intellij.config.JDPluginConfigurationPane">
-  <grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+  <grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
     <margin top="0" left="0" bottom="0" right="0"/>
     <constraints>
-      <xy x="20" y="20" width="500" height="400"/>
+      <xy x="20" y="20" width="721" height="400"/>
     </constraints>
     <properties/>
     <border type="none"/>
     <children>
       <vspacer id="7962d">
         <constraints>
-          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+          <grid row="1" column="0" row-span="1" col-span="3" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
         </constraints>
       </vspacer>
       <grid id="4b92" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
         <margin top="0" left="0" bottom="0" right="0"/>
         <constraints>
-          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+          <grid row="0" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
         </constraints>
         <properties/>
         <border type="none"/>
           </component>
         </children>
       </grid>
-      <component id="de365" class="javax.swing.JTextPane" binding="usingJDCoreTextPane">
+      <grid id="9fc2a" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
         <constraints>
-          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
-            <preferred-size width="150" height="50"/>
-          </grid>
+          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children>
+          <component id="31ca4" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="Using : JD-Core 0.6.1"/>
+            </properties>
+          </component>
+          <component id="58100" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="See :"/>
+            </properties>
+          </component>
+          <component id="2020b" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="JD-Core Suggestions"/>
+            </properties>
+          </component>
+          <component id="1102" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="JD-Core Bugs"/>
+            </properties>
+          </component>
+          <component id="496cb" class="com.intellij.ui.HyperlinkLabel" binding="jd_hyperlinkLabel" custom-create="true">
+            <constraints>
+              <grid row="1" column="1" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+          </component>
+          <component id="2fbe6" class="com.intellij.ui.HyperlinkLabel" binding="jdSuggestions_hyperlinkLabel" custom-create="true">
+            <constraints>
+              <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+          </component>
+          <component id="10cb7" class="com.intellij.ui.HyperlinkLabel" binding="jdBugs_hyperlinkLabel" custom-create="true">
+            <constraints>
+              <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+          </component>
+        </children>
+      </grid>
+      <component id="23fef" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
         </constraints>
         <properties>
-          <text value="Using : JD-Core 0.6.1 &#10;&#10;See : http://java.decompiler.free.fr/  &#10;JD-Core Suggestions : http://java.decompiler.free.fr/jd-eclipse/suggestions  &#10;JD-Core Bugs : http://java.decompiler.free.fr/jd-eclipse/bugs  &#10;&#10;This plugin is not developped by Emmanuel Dupuy, it only use the JD-Core library that HE developped."/>
+          <text value="This plugin is not developped by Emmanuel Dupuy, it only use the JD-Core library that HE developped."/>
         </properties>
       </component>
     </children>

File src/main/java/jd/ide/intellij/config/JDPluginConfigurationPane.java

 
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.components.ServiceManager;
+import com.intellij.ui.HyperlinkLabel;
 import jd.ide.intellij.JavaDecompilerRefreshSupportService;
 
 import javax.swing.*;
     private JCheckBox showLineNumbersCheckBox;
     private JCheckBox showMetadataCheckBox;
     private JPanel contentPane;
-    private JTextPane usingJDCoreTextPane;
+    private HyperlinkLabel jd_hyperlinkLabel;
+    private HyperlinkLabel jdSuggestions_hyperlinkLabel;
+    private HyperlinkLabel jdBugs_hyperlinkLabel;
 
     public JDPluginConfigurationPane() {
         MouseListener itemListener = new OnMouseReleaseRefreshDecompiledFilesListener(this);
         return contentPane;
     }
 
+    private void createUIComponents() {
+        jd_hyperlinkLabel = createHyperLinkLabelWithURL("http://java.decompiler.free.fr/");
+        jdSuggestions_hyperlinkLabel = createHyperLinkLabelWithURL("http://java.decompiler.free.fr/jd-eclipse/suggestions");
+        jdBugs_hyperlinkLabel = createHyperLinkLabelWithURL("http://java.decompiler.free.fr/jd-eclipse/bugs");
+    }
+
+    private HyperlinkLabel createHyperLinkLabelWithURL(String link) {
+        HyperlinkLabel hyperlinkLabel = new HyperlinkLabel();
+        hyperlinkLabel.setHyperlinkText(link);
+        hyperlinkLabel.setHyperlinkTarget(link);
+        return hyperlinkLabel;
+    }
+
+
     private static class OnMouseReleaseRefreshDecompiledFilesListener implements MouseListener {
 
         private final JDPluginConfigurationPane jdPluginConfigurationPane;