summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/URLPropertyEditor.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/URLPropertyEditor.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/URLPropertyEditor.java')
-rw-r--r--NET/worlds/scape/URLPropertyEditor.java177
1 files changed, 177 insertions, 0 deletions
diff --git a/NET/worlds/scape/URLPropertyEditor.java b/NET/worlds/scape/URLPropertyEditor.java
new file mode 100644
index 0000000..b624c29
--- /dev/null
+++ b/NET/worlds/scape/URLPropertyEditor.java
@@ -0,0 +1,177 @@
+/* */ 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<URL> additions;
+/* 96 */ private boolean acceptAnyExt = false;
+/* */
+/* */ private boolean acceptDrops;
+/* */
+/* */
+/* */ private URLPropertyEditor(Property property, String extList, Enumeration<URL> 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<String> 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<URL> additions)
+/* */ {
+/* 146 */ return make(property, extList, additions, true);
+/* */ }
+/* */
+/* */
+/* */
+/* */ public static Property make(Property property, String extList, Enumeration<URL> 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
+ */ \ No newline at end of file