1 5 package com.memoire.vainstall; 6 7 import java.io.File ; 8 9 10 public class VAShortcutEntry{ 11 private String Comment_; 12 private String type_="Application"; 13 private String exePath_; 14 private String iconPath_; 15 String workingDirectory_; 16 private boolean launchInTerminal_; 17 private String name_; 18 boolean createOnDesktop_=true; 19 boolean isUninstall_; 20 24 public VAShortcutEntry(String _exePath){ 25 name_=new File (_exePath).getName(); 26 int idx=name_.indexOf('.'); 28 if(idx>0) name_=name_.substring(0,idx); 29 exePath_=_exePath; 30 if(exePath_==null) throw new IllegalArgumentException ("Exe path must not be null"); 31 } 32 public VAShortcutEntry(String _name,String _exePath){ 33 name_=_name; 34 exePath_=_exePath; 35 if(exePath_==null) throw new IllegalArgumentException ("Exe path must not be null"); 36 if(name_==null) throw new IllegalArgumentException ("Name must not be null"); 37 } 38 41 public String getComment() { 42 return Comment_; 43 } 44 47 public String getExePath() { 48 return exePath_; 49 } 50 53 public String getIconPath() { 54 return iconPath_; 55 } 56 59 public String getName() { 60 return name_; 61 } 62 65 public boolean isLaunchInTerminal() { 66 return launchInTerminal_; 67 } 68 71 public void setComment(String _comment) { 72 Comment_ = _comment; 73 } 74 77 public void setExePath(String _exePath) { 78 if(_exePath==null) throw new IllegalArgumentException ("exe path must not be null"); 79 exePath_ = _exePath; 80 } 81 84 public void setIconPath(String _iconPath) { 85 iconPath_ = _iconPath; 86 } 87 90 public void setLaunchInTerminal(boolean _launchInTerminal) { 91 launchInTerminal_ = _launchInTerminal; 92 } 93 96 public void setName(String _name) { 97 if(_name==null) throw new IllegalArgumentException ("Icon's name must not be null"); 98 name_ = _name; 99 } 100 101 104 public String getType() { 105 return type_; 106 } 107 110 public void setType(String _type) { 111 type_ = _type; 112 } 113 116 public String getWorkingDirectory() { 117 return workingDirectory_; 118 } 119 122 public void setWorkingDirectory(String _workingDirectory) { 123 workingDirectory_ = _workingDirectory; 124 } 125 128 public final boolean isCreateOnDesktop() { 129 return createOnDesktop_; 130 } 131 134 public final void setCreateOnDesktop(boolean _createOnDesktop) { 135 createOnDesktop_ = _createOnDesktop; 136 } 137 140 public final boolean isUninstall() { 141 return isUninstall_; 142 } 143 146 public final void setUninstall(boolean _isUninstall) { 147 isUninstall_ = _isUninstall; 148 } 149 } | Popular Tags |