/* */ package NET.worlds.scape; /* */ /* */ import NET.worlds.console.PolledDialog; /* */ import NET.worlds.network.URL; /* */ import java.util.Enumeration; /* */ import java.util.Vector; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class URLPropertyEditor /* */ extends PropEditor /* */ { /* */ private FileList files; /* */ private Enumeration additions; /* 96 */ private boolean acceptAnyExt = false; /* */ /* */ private boolean acceptDrops; /* */ /* */ /* */ private URLPropertyEditor(Property property, String extList, Enumeration additions, boolean acceptDrops) /* */ { /* 103 */ super(property); /* 104 */ this.acceptDrops = acceptDrops; /* 105 */ URL dir = URL.getContainingOrCurDir((SuperRoot)property.getOwner()); /* */ /* */ /* 108 */ if (extList == null) { /* 109 */ this.acceptAnyExt = true; /* */ } else { /* 111 */ if (extList.startsWith("*")) { /* 112 */ extList = extList.substring(1); /* 113 */ this.acceptAnyExt = true; /* */ } /* */ /* */ /* 117 */ this.files = new FileList(dir.unalias(), extList); /* */ } /* 119 */ this.additions = additions; /* */ } /* */ /* */ public PolledDialog edit(EditTile parent, String title) /* */ { /* 124 */ Vector v = this.files == null ? new Vector() : this.files.getList(); /* 125 */ if (this.additions != null) /* 126 */ while (this.additions.hasMoreElements()) /* 127 */ v.addElement(((URL)this.additions.nextElement()).toString()); /* 128 */ return new URLEditorDialog(parent, title, this.property, v, /* 129 */ this.acceptAnyExt ? null : this.files); /* */ } /* */ /* */ public static Property make(Property property, String extList) /* */ { /* 134 */ return make(property, extList, null, true); /* */ } /* */ /* */ /* */ public static Property make(Property property, String extList, boolean acceptDrops) /* */ { /* 140 */ return make(property, extList, null, acceptDrops); /* */ } /* */ /* */ /* */ public static Property make(Property property, String extList, Enumeration additions) /* */ { /* 146 */ return make(property, extList, additions, true); /* */ } /* */ /* */ /* */ /* */ public static Property make(Property property, String extList, Enumeration additions, boolean acceptDrops) /* */ { /* 153 */ property.setPropertyType(10); /* 154 */ return property.setEditor(new URLPropertyEditor(property, /* 155 */ extList, additions, /* 156 */ acceptDrops)); /* */ } /* */ /* */ /* */ public boolean libraryDrop(EditTile target, Object obj, boolean isPaste, boolean doDrop) /* */ { /* 162 */ if ((!isPaste) && (this.acceptDrops) && ((obj instanceof URL)) && ( /* 163 */ (this.acceptAnyExt) || (this.files.extMatches(((URL)obj).getExt())))) /* */ { /* 165 */ if (doDrop) /* 166 */ target.addUndoableSet(this.property, obj); /* 167 */ return true; /* */ } /* 169 */ return false; /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\URLPropertyEditor.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */