/* */ 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 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 */