summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/URLEditorDialog.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/URLEditorDialog.java
downloadworlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz
worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/URLEditorDialog.java')
-rw-r--r--NET/worlds/scape/URLEditorDialog.java89
1 files changed, 89 insertions, 0 deletions
diff --git a/NET/worlds/scape/URLEditorDialog.java b/NET/worlds/scape/URLEditorDialog.java
new file mode 100644
index 0000000..904e3db
--- /dev/null
+++ b/NET/worlds/scape/URLEditorDialog.java
@@ -0,0 +1,89 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import NET.worlds.console.Console;
+/* */ import NET.worlds.network.URL;
+/* */ import java.net.MalformedURLException;
+/* */ import java.util.Vector;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ class URLEditorDialog
+/* */ extends FieldWithListEditorDialog
+/* */ {
+/* */ private static final long serialVersionUID = 1L;
+/* */ Property property;
+/* */ FileList extChecker;
+/* */
+/* */ URLEditorDialog(EditTile parent, String title, Property property, Vector<String> files, FileList extChecker)
+/* */ {
+/* 36 */ super(parent, title + " dir: " + URL.getBestContainer((SuperRoot)property.getOwner()), files);
+/* 37 */ this.property = property;
+/* 38 */ this.extChecker = extChecker;
+/* 39 */ ready();
+/* */ }
+/* */
+/* */ protected String getValue()
+/* */ {
+/* 44 */ SuperRoot context = (SuperRoot)this.property.getOwner();
+/* */
+/* */
+/* */
+/* 48 */ if ((context != null) && (this.property.getName().equals("Source URL"))) {
+/* 49 */ context = context.getOwner();
+/* */ }
+/* 51 */ String s = URL.getRelativeTo((URL)this.property.get(), context);
+/* 52 */ if (s == null)
+/* 53 */ return "";
+/* 54 */ return s;
+/* */ }
+/* */
+/* */ protected boolean setValue(String text)
+/* */ {
+/* 59 */ URL url = null;
+/* */
+/* 61 */ if (text.length() == 0) {
+/* 62 */ if (!this.property.canSetNull())
+/* 63 */ return false;
+/* */ } else {
+/* 65 */ if ((this.extChecker != null) && (!this.extChecker.extMatches(text))) {
+/* 66 */ Console.println(
+/* */
+/* 68 */ Console.message("extension-match") + this.extChecker.getExtList());
+/* 69 */ return false;
+/* */ }
+/* */ try
+/* */ {
+/* 73 */ url = new URL((SuperRoot)this.property.getOwner(), text);
+/* */ } catch (MalformedURLException e) {
+/* 75 */ Console.println(Console.message("Illegal-URL") + e);
+/* 76 */ return false;
+/* */ }
+/* */ }
+/* */
+/* 80 */ this.parent.addUndoableSet(this.property, url);
+/* 81 */ return true;
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\URLEditorDialog.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file