Skip to content

Commit 395a177

Browse files
committed
Now tooltips are loaded again, fixes #100
- sorrowly I had to remove the former test cases for the TooltipTextSupport because of the eclipse dependencies which I cannot provide at gradle build time currently. (But it works now)
1 parent 1a2e4b3 commit 395a177

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+22
-46
lines changed

basheditor-plugin/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ bin.includes = META-INF/,\
99
html/,\
1010
EditorToc.xml,\
1111
toc.xml,\
12-
src/main/resources/
12+
tooltips/
1313
src.excludes = src/test/java-eclipse/,\
1414
src/test/java/

basheditor-plugin/src/main/java/de/jcup/basheditor/document/keywords/TooltipTextSupport.java renamed to basheditor-plugin/src/main/java-eclipse/de/jcup/basheditor/document/keywords/TooltipTextSupport.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import java.io.IOException;
55
import java.io.InputStream;
66
import java.io.InputStreamReader;
7+
import java.net.MalformedURLException;
8+
import java.net.URL;
79
import java.util.Map;
810
import java.util.TreeMap;
911

@@ -104,13 +106,19 @@ private String markAsHTMLContent(String content){
104106
}
105107

106108
private String loadFrom(String path) {
107-
try (InputStream stream = TooltipTextSupport.class.getResourceAsStream(path)) {
108-
return loadFromStream(stream);
109+
URL url = null;
110+
try{
111+
url = new URL("platform:/plugin/de.jcup.basheditor"+path);
112+
}catch(MalformedURLException e){
113+
return null;
114+
}
115+
try (InputStream inputStream = url.openConnection().getInputStream();) {
116+
return loadFromStream(inputStream);
109117
} catch (IOException e) {
110118
/* should not happen - but if there are errors
111119
* we just return an empty string
112120
*/
113-
return "";
121+
return null;
114122
}
115123
}
116124

basheditor-plugin/src/test/java/de/jcup/basheditor/document/keywords/TooltipTextSupportTest.java

Lines changed: 0 additions & 42 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)