1 11 package org.eclipse.update.internal.model; 12 import org.eclipse.core.runtime.*; 13 import org.eclipse.update.core.model.*; 14 import org.eclipse.update.internal.core.*; 15 16 19 public class ConfiguredSiteModel extends ModelObject { 20 private String [] previousPluginPath; 21 22 private SiteModel site; 23 private String platformURLString; 24 private ConfigurationPolicyModel policy; 25 private InstallConfigurationModel installConfiguration; 26 private boolean installable = false; 27 28 31 public ConfiguredSiteModel() { 32 super(); 33 } 34 35 40 public SiteModel getSiteModel() { 41 return site; 42 } 43 44 48 public void setSiteModel(SiteModel site) { 49 assertIsWriteable(); 50 this.site = site; 51 } 52 53 56 public ConfigurationPolicyModel getConfigurationPolicyModel() { 57 return policy; 58 } 59 60 64 public void setConfigurationPolicyModel(ConfigurationPolicyModel policy) { 65 assertIsWriteable(); 66 this.policy = policy; 67 policy.setConfiguredSiteModel(this); 68 } 69 70 73 public boolean isUpdatable() { 74 return installable; 75 } 76 77 80 public void setUpdatable(boolean installable) { 81 assertIsWriteable(); 82 this.installable = installable; 83 } 84 85 89 public InstallConfigurationModel getInstallConfigurationModel() { 90 return installConfiguration; 91 } 92 93 97 public void setInstallConfigurationModel(InstallConfigurationModel installConfiguration) { 98 assertIsWriteable(); 99 this.installConfiguration = installConfiguration; 100 } 101 102 106 public String getPlatformURLString() { 107 return platformURLString; 108 } 109 110 114 public void setPlatformURLString(String platformURLString) { 115 this.platformURLString = platformURLString; 116 } 117 118 119 123 public String [] getPreviousPluginPath() { 124 if (previousPluginPath == null) 125 previousPluginPath = new String [0]; 126 return previousPluginPath; 127 } 128 129 133 public void setPreviousPluginPath(String [] previousPluginPath) { 134 this.previousPluginPath = new String [previousPluginPath.length]; 135 System.arraycopy(previousPluginPath, 0, this.previousPluginPath, 0, previousPluginPath.length); 136 } 137 138 141 protected IStatus createStatus(int statusType, String msg, Exception e){ 142 if (statusType!=IStatus.OK) statusType = IStatus.ERROR; 143 return createStatus(statusType,IStatus.OK, msg.toString(), e); 144 } 145 146 149 protected IStatus createStatus(int statusSeverity, int statusCode, String msg, Exception e){ 150 String id = UpdateCore.getPlugin().getBundle().getSymbolicName(); 151 152 StringBuffer completeString = new StringBuffer (""); if (msg!=null) 154 completeString.append(msg); 155 if (e!=null){ 156 completeString.append("\r\n["); completeString.append(e.toString()); 158 completeString.append("]\r\n"); } 160 return new Status(statusSeverity, id, statusCode, completeString.toString(), e); 161 } 162 163 166 public boolean isEnabled() { 167 return getConfigurationPolicyModel().isEnabled(); 168 } 169 170 173 public void setEnabled(boolean value) { 174 getConfigurationPolicyModel().setEnabled(value); 175 } 176 177 } 178 | Popular Tags |