diff options
Diffstat (limited to 'NET/worlds/scape/URLEditorDialog.java')
| -rw-r--r-- | NET/worlds/scape/URLEditorDialog.java | 89 |
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 |