| author | wenzelm |
| Tue, 24 Jun 2025 21:05:48 +0200 | |
| changeset 82747 | 00828818a607 |
| parent 76652 | 90abc28523d7 |
| permissions | -rw-r--r-- |
|
76552
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
1 |
/* Title: Tools/jEdit/src/jedit_jar.scala |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
3 |
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
4 |
Offline access to jEdit jar resources. |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
5 |
*/ |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
6 |
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
7 |
package isabelle.jedit |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
8 |
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
9 |
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
10 |
import isabelle._ |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
11 |
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
12 |
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
13 |
object JEdit_JAR {
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
14 |
/* jEdit jar resources */ |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
15 |
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
16 |
def get_resource(name: String): String = {
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
17 |
val s = classOf[org.gjt.sp.jedit.jEdit].getResourceAsStream(name) |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
18 |
if (s == null) error("Bad jEdit resource: " + quote(name))
|
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
19 |
else using(s)(File.read_stream) |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
20 |
} |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
21 |
|
|
76652
90abc28523d7
tuned names: avoid overlap with instances of class Resources;
wenzelm
parents:
76552
diff
changeset
|
22 |
object JEdit_Resource extends Scala.Fun_Strings("jEdit.resource") {
|
|
76552
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
23 |
val here = Scala_Project.here |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
24 |
def apply(args: List[String]): List[String] = args.map(get_resource) |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
25 |
} |
|
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
26 |
|
|
76652
90abc28523d7
tuned names: avoid overlap with instances of class Resources;
wenzelm
parents:
76552
diff
changeset
|
27 |
class Scala_Functions extends Scala.Functions(JEdit_Resource) |
|
76552
13fde66c7cf6
more direct access to jEdit jar resources, without unzip;
wenzelm
parents:
diff
changeset
|
28 |
} |