|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2004, 2008 Tasktop Technologies and others. |
2 |
* Copyright (c) 2004, 2008 Tasktop Technologies and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 28-34
Link Here
|
| 28 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
28 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
| 29 |
import org.eclipse.jface.preference.PreferenceDialog; |
29 |
import org.eclipse.jface.preference.PreferenceDialog; |
| 30 |
import org.eclipse.jface.preference.StringFieldEditor; |
30 |
import org.eclipse.jface.preference.StringFieldEditor; |
| 31 |
import org.eclipse.jface.wizard.WizardPage; |
|
|
| 32 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
31 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
| 33 |
import org.eclipse.mylyn.commons.net.AuthenticationCredentials; |
32 |
import org.eclipse.mylyn.commons.net.AuthenticationCredentials; |
| 34 |
import org.eclipse.mylyn.commons.net.AuthenticationType; |
33 |
import org.eclipse.mylyn.commons.net.AuthenticationType; |
|
Lines 67-73
Link Here
|
| 67 |
import org.eclipse.ui.forms.events.HyperlinkEvent; |
66 |
import org.eclipse.ui.forms.events.HyperlinkEvent; |
| 68 |
import org.eclipse.ui.forms.events.IHyperlinkListener; |
67 |
import org.eclipse.ui.forms.events.IHyperlinkListener; |
| 69 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
68 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
| 70 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
|
|
| 71 |
import org.eclipse.ui.forms.widgets.Hyperlink; |
69 |
import org.eclipse.ui.forms.widgets.Hyperlink; |
| 72 |
|
70 |
|
| 73 |
/** |
71 |
/** |
|
Lines 78-85
Link Here
|
| 78 |
* @author Rob Elves |
76 |
* @author Rob Elves |
| 79 |
* @author Steffen Pingel |
77 |
* @author Steffen Pingel |
| 80 |
* @author Frank Becker |
78 |
* @author Frank Becker |
|
|
79 |
* @author David Green |
| 80 |
* @since 2.0 |
| 81 |
*/ |
81 |
*/ |
| 82 |
public abstract class AbstractRepositorySettingsPage extends WizardPage implements ITaskRepositoryPage { |
82 |
public abstract class AbstractRepositorySettingsPage extends AbstractTaskRepositoryPage implements ITaskRepositoryPage { |
| 83 |
|
83 |
|
| 84 |
protected static final String PREFS_PAGE_ID_NET_PROXY = "org.eclipse.ui.net.NetPreferences"; |
84 |
protected static final String PREFS_PAGE_ID_NET_PROXY = "org.eclipse.ui.net.NetPreferences"; |
| 85 |
|
85 |
|
|
Lines 123-128
Link Here
|
| 123 |
|
123 |
|
| 124 |
protected StringFieldEditor proxyPasswordEditor; |
124 |
protected StringFieldEditor proxyPasswordEditor; |
| 125 |
|
125 |
|
|
|
126 |
// FIXME shadows declaration in super |
| 126 |
protected TaskRepository repository; |
127 |
protected TaskRepository repository; |
| 127 |
|
128 |
|
| 128 |
private Button validateServerButton; |
129 |
private Button validateServerButton; |
|
Lines 205-222
Link Here
|
| 205 |
|
206 |
|
| 206 |
private Button disconnectedButton; |
207 |
private Button disconnectedButton; |
| 207 |
|
208 |
|
| 208 |
// TODO 3.1 make accessible to subclasses |
|
|
| 209 |
private FormToolkit toolkit; |
| 210 |
|
| 211 |
/** |
209 |
/** |
| 212 |
* @since 3.0 |
210 |
* @since 3.0 |
| 213 |
*/ |
211 |
*/ |
| 214 |
public AbstractRepositorySettingsPage(String title, String description, TaskRepository taskRepository) { |
212 |
public AbstractRepositorySettingsPage(String title, String description, TaskRepository taskRepository) { |
| 215 |
super(title); |
213 |
super(title, description, taskRepository); |
| 216 |
this.repository = taskRepository; |
|
|
| 217 |
this.connector = TasksUi.getRepositoryManager().getRepositoryConnector(getConnectorKind()); |
214 |
this.connector = TasksUi.getRepositoryManager().getRepositoryConnector(getConnectorKind()); |
| 218 |
setTitle(title); |
|
|
| 219 |
setDescription(description); |
| 220 |
setNeedsAnonymousLogin(false); |
215 |
setNeedsAnonymousLogin(false); |
| 221 |
setNeedsEncoding(true); |
216 |
setNeedsEncoding(true); |
| 222 |
setNeedsTimeZone(true); |
217 |
setNeedsTimeZone(true); |
|
Lines 228-247
Link Here
|
| 228 |
/** |
223 |
/** |
| 229 |
* @since 3.0 |
224 |
* @since 3.0 |
| 230 |
*/ |
225 |
*/ |
|
|
226 |
@Override |
| 231 |
public abstract String getConnectorKind(); |
227 |
public abstract String getConnectorKind(); |
| 232 |
|
228 |
|
| 233 |
@Override |
229 |
@Override |
| 234 |
public void dispose() { |
230 |
public void dispose() { |
| 235 |
super.dispose(); |
231 |
super.dispose(); |
| 236 |
if (toolkit != null) { |
|
|
| 237 |
toolkit.dispose(); |
| 238 |
toolkit = null; |
| 239 |
} |
| 240 |
} |
232 |
} |
| 241 |
|
233 |
|
| 242 |
public void createControl(Composite parent) { |
234 |
/** |
| 243 |
toolkit = new FormToolkit(TasksUiPlugin.getDefault().getFormColors(parent.getDisplay())); |
235 |
* @since 2.0 |
|
|
236 |
*/ |
| 237 |
@Override |
| 238 |
protected void createContents(Composite parent) { |
| 239 |
createSettingControls(parent); |
| 240 |
} |
| 244 |
|
241 |
|
|
|
242 |
/** |
| 243 |
* @since 2.0 |
| 244 |
*/ |
| 245 |
@Override |
| 246 |
protected void createSettingControls(Composite parent) { |
| 245 |
if (repository != null) { |
247 |
if (repository != null) { |
| 246 |
originalUrl = repository.getRepositoryUrl(); |
248 |
originalUrl = repository.getRepositoryUrl(); |
| 247 |
AuthenticationCredentials oldCredentials = repository.getCredentials(AuthenticationType.REPOSITORY); |
249 |
AuthenticationCredentials oldCredentials = repository.getCredentials(AuthenticationType.REPOSITORY); |
|
Lines 628-633
Link Here
|
| 628 |
|
630 |
|
| 629 |
addStatusSection(); |
631 |
addStatusSection(); |
| 630 |
|
632 |
|
|
|
633 |
addContributionSection(); |
| 634 |
|
| 631 |
Composite managementComposite = new Composite(compositeContainer, SWT.NULL); |
635 |
Composite managementComposite = new Composite(compositeContainer, SWT.NULL); |
| 632 |
GridLayout managementLayout = new GridLayout(4, false); |
636 |
GridLayout managementLayout = new GridLayout(4, false); |
| 633 |
managementLayout.marginHeight = 0; |
637 |
managementLayout.marginHeight = 0; |
|
Lines 701-707
Link Here
|
| 701 |
|
705 |
|
| 702 |
updateHyperlinks(); |
706 |
updateHyperlinks(); |
| 703 |
|
707 |
|
| 704 |
setControl(compositeContainer); |
|
|
| 705 |
} |
708 |
} |
| 706 |
|
709 |
|
| 707 |
private void addProxySection() { |
710 |
private void addProxySection() { |
|
Lines 855-860
Link Here
|
| 855 |
proxyExpComposite.setExpanded(!systemProxyButton.getSelection()); |
858 |
proxyExpComposite.setExpanded(!systemProxyButton.getSelection()); |
| 856 |
} |
859 |
} |
| 857 |
|
860 |
|
|
|
861 |
private void addContributionSection() { |
| 862 |
Composite composite = toolkit.createComposite(compositeContainer); |
| 863 |
GridDataFactory.fillDefaults().grab(true, false).span(2, SWT.DEFAULT).applyTo(composite); |
| 864 |
|
| 865 |
GridLayout layout = new GridLayout(1, false); |
| 866 |
layout.marginWidth = 0; |
| 867 |
layout.marginTop = -5; |
| 868 |
composite.setLayout(layout); |
| 869 |
|
| 870 |
composite.setBackground(compositeContainer.getBackground()); |
| 871 |
|
| 872 |
createContributionControls(composite); |
| 873 |
} |
| 874 |
|
| 858 |
private void addStatusSection() { |
875 |
private void addStatusSection() { |
| 859 |
ExpandableComposite statusComposite = toolkit.createExpandableComposite(compositeContainer, |
876 |
ExpandableComposite statusComposite = toolkit.createExpandableComposite(compositeContainer, |
| 860 |
ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); |
877 |
ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); |
|
Lines 912-917
Link Here
|
| 912 |
} |
929 |
} |
| 913 |
} |
930 |
} |
| 914 |
|
931 |
|
|
|
932 |
/** |
| 933 |
* @since 2.0 |
| 934 |
*/ |
| 915 |
public void setAnonymous(boolean selected) { |
935 |
public void setAnonymous(boolean selected) { |
| 916 |
if (!needsAnonymousLogin) { |
936 |
if (!needsAnonymousLogin) { |
| 917 |
return; |
937 |
return; |
|
Lines 937-942
Link Here
|
| 937 |
} |
957 |
} |
| 938 |
} |
958 |
} |
| 939 |
|
959 |
|
|
|
960 |
/** |
| 961 |
* @since 2.0 |
| 962 |
*/ |
| 940 |
public void setHttpAuth(boolean selected) { |
963 |
public void setHttpAuth(boolean selected) { |
| 941 |
if (!needsHttpAuth) { |
964 |
if (!needsHttpAuth) { |
| 942 |
return; |
965 |
return; |
|
Lines 963-968
Link Here
|
| 963 |
return httpAuthButton.getSelection(); |
986 |
return httpAuthButton.getSelection(); |
| 964 |
} |
987 |
} |
| 965 |
|
988 |
|
|
|
989 |
/** |
| 990 |
* @since 2.0 |
| 991 |
*/ |
| 966 |
public void setUseDefaultProxy(boolean selected) { |
992 |
public void setUseDefaultProxy(boolean selected) { |
| 967 |
if (!needsProxy) { |
993 |
if (!needsProxy) { |
| 968 |
return; |
994 |
return; |
|
Lines 985-992
Link Here
|
| 985 |
setProxyAuth(proxyAuthButton.getSelection()); |
1011 |
setProxyAuth(proxyAuthButton.getSelection()); |
| 986 |
} |
1012 |
} |
| 987 |
|
1013 |
|
|
|
1014 |
/** |
| 1015 |
* @since 2.0 |
| 1016 |
*/ |
| 988 |
public void setProxyAuth(boolean selected) { |
1017 |
public void setProxyAuth(boolean selected) { |
| 989 |
|
|
|
| 990 |
proxyAuthButton.setSelection(selected); |
1018 |
proxyAuthButton.setSelection(selected); |
| 991 |
proxyAuthButton.setEnabled(!systemProxyButton.getSelection()); |
1019 |
proxyAuthButton.setEnabled(!systemProxyButton.getSelection()); |
| 992 |
if (!selected) { |
1020 |
if (!selected) { |
|
Lines 1039-1046
Link Here
|
| 1039 |
protected void repositoryTemplateSelected(RepositoryTemplate template) { |
1067 |
protected void repositoryTemplateSelected(RepositoryTemplate template) { |
| 1040 |
} |
1068 |
} |
| 1041 |
|
1069 |
|
|
|
1070 |
/** |
| 1071 |
* @since 2.0 |
| 1072 |
*/ |
| 1042 |
protected abstract void createAdditionalControls(Composite parent); |
1073 |
protected abstract void createAdditionalControls(Composite parent); |
| 1043 |
|
1074 |
|
|
|
1075 |
/** |
| 1076 |
* @since 2.0 |
| 1077 |
*/ |
| 1044 |
protected abstract boolean isValidUrl(String name); |
1078 |
protected abstract boolean isValidUrl(String name); |
| 1045 |
|
1079 |
|
| 1046 |
private void updateHyperlinks() { |
1080 |
private void updateHyperlinks() { |
|
Lines 1064-1069
Link Here
|
| 1064 |
} |
1098 |
} |
| 1065 |
} |
1099 |
} |
| 1066 |
|
1100 |
|
|
|
1101 |
/** |
| 1102 |
* @since 2.0 |
| 1103 |
*/ |
| 1067 |
public String getRepositoryLabel() { |
1104 |
public String getRepositoryLabel() { |
| 1068 |
return repositoryLabelEditor.getStringValue(); |
1105 |
return repositoryLabelEditor.getStringValue(); |
| 1069 |
} |
1106 |
} |
|
Lines 1075-1088
Link Here
|
| 1075 |
return TaskRepositoryManager.stripSlashes(serverUrlCombo.getText()); |
1112 |
return TaskRepositoryManager.stripSlashes(serverUrlCombo.getText()); |
| 1076 |
} |
1113 |
} |
| 1077 |
|
1114 |
|
|
|
1115 |
/** |
| 1116 |
* @since 2.0 |
| 1117 |
*/ |
| 1078 |
public String getUserName() { |
1118 |
public String getUserName() { |
| 1079 |
return repositoryUserNameEditor.getStringValue(); |
1119 |
return repositoryUserNameEditor.getStringValue(); |
| 1080 |
} |
1120 |
} |
| 1081 |
|
1121 |
|
|
|
1122 |
/** |
| 1123 |
* @since 2.0 |
| 1124 |
*/ |
| 1082 |
public String getPassword() { |
1125 |
public String getPassword() { |
| 1083 |
return repositoryPasswordEditor.getStringValue(); |
1126 |
return repositoryPasswordEditor.getStringValue(); |
| 1084 |
} |
1127 |
} |
| 1085 |
|
1128 |
|
|
|
1129 |
/** |
| 1130 |
* @since 2.0 |
| 1131 |
*/ |
| 1086 |
public String getHttpAuthUserId() { |
1132 |
public String getHttpAuthUserId() { |
| 1087 |
if (needsHttpAuth()) { |
1133 |
if (needsHttpAuth()) { |
| 1088 |
return httpAuthUserNameEditor.getStringValue(); |
1134 |
return httpAuthUserNameEditor.getStringValue(); |
|
Lines 1091-1096
Link Here
|
| 1091 |
} |
1137 |
} |
| 1092 |
} |
1138 |
} |
| 1093 |
|
1139 |
|
|
|
1140 |
/** |
| 1141 |
* @since 2.0 |
| 1142 |
*/ |
| 1094 |
public String getHttpAuthPassword() { |
1143 |
public String getHttpAuthPassword() { |
| 1095 |
if (needsHttpAuth()) { |
1144 |
if (needsHttpAuth()) { |
| 1096 |
return httpAuthPasswordEditor.getStringValue(); |
1145 |
return httpAuthPasswordEditor.getStringValue(); |
|
Lines 1099-1104
Link Here
|
| 1099 |
} |
1148 |
} |
| 1100 |
} |
1149 |
} |
| 1101 |
|
1150 |
|
|
|
1151 |
/** |
| 1152 |
* @since 2.0 |
| 1153 |
*/ |
| 1102 |
public String getProxyHostname() { |
1154 |
public String getProxyHostname() { |
| 1103 |
if (needsProxy()) { |
1155 |
if (needsProxy()) { |
| 1104 |
return proxyHostnameEditor.getStringValue(); |
1156 |
return proxyHostnameEditor.getStringValue(); |
|
Lines 1107-1112
Link Here
|
| 1107 |
} |
1159 |
} |
| 1108 |
} |
1160 |
} |
| 1109 |
|
1161 |
|
|
|
1162 |
/** |
| 1163 |
* @since 2.0 |
| 1164 |
*/ |
| 1110 |
public String getProxyPort() { |
1165 |
public String getProxyPort() { |
| 1111 |
if (needsProxy()) { |
1166 |
if (needsProxy()) { |
| 1112 |
return proxyPortEditor.getStringValue(); |
1167 |
return proxyPortEditor.getStringValue(); |
|
Lines 1115-1120
Link Here
|
| 1115 |
} |
1170 |
} |
| 1116 |
} |
1171 |
} |
| 1117 |
|
1172 |
|
|
|
1173 |
/** |
| 1174 |
* @since 2.0 |
| 1175 |
*/ |
| 1118 |
public Boolean getUseDefaultProxy() { |
1176 |
public Boolean getUseDefaultProxy() { |
| 1119 |
if (needsProxy()) { |
1177 |
if (needsProxy()) { |
| 1120 |
return systemProxyButton.getSelection(); |
1178 |
return systemProxyButton.getSelection(); |
|
Lines 1123-1128
Link Here
|
| 1123 |
} |
1181 |
} |
| 1124 |
} |
1182 |
} |
| 1125 |
|
1183 |
|
|
|
1184 |
/** |
| 1185 |
* @since 2.0 |
| 1186 |
*/ |
| 1126 |
public String getProxyUserName() { |
1187 |
public String getProxyUserName() { |
| 1127 |
if (needsProxy()) { |
1188 |
if (needsProxy()) { |
| 1128 |
return proxyUserNameEditor.getStringValue(); |
1189 |
return proxyUserNameEditor.getStringValue(); |
|
Lines 1131-1136
Link Here
|
| 1131 |
} |
1192 |
} |
| 1132 |
} |
1193 |
} |
| 1133 |
|
1194 |
|
|
|
1195 |
/** |
| 1196 |
* @since 2.0 |
| 1197 |
*/ |
| 1134 |
public String getProxyPassword() { |
1198 |
public String getProxyPassword() { |
| 1135 |
if (needsProxy()) { |
1199 |
if (needsProxy()) { |
| 1136 |
return proxyPasswordEditor.getStringValue(); |
1200 |
return proxyPasswordEditor.getStringValue(); |
|
Lines 1139-1148
Link Here
|
| 1139 |
} |
1203 |
} |
| 1140 |
} |
1204 |
} |
| 1141 |
|
1205 |
|
|
|
1206 |
/** |
| 1207 |
* @since 2.0 |
| 1208 |
*/ |
| 1142 |
public void init(IWorkbench workbench) { |
1209 |
public void init(IWorkbench workbench) { |
| 1143 |
// ignore |
1210 |
// ignore |
| 1144 |
} |
1211 |
} |
| 1145 |
|
1212 |
|
|
|
1213 |
/** |
| 1214 |
* @since 2.0 |
| 1215 |
*/ |
| 1146 |
public boolean isAnonymousAccess() { |
1216 |
public boolean isAnonymousAccess() { |
| 1147 |
if (anonymousButton != null) { |
1217 |
if (anonymousButton != null) { |
| 1148 |
return anonymousButton.getSelection(); |
1218 |
return anonymousButton.getSelection(); |
|
Lines 1206-1211
Link Here
|
| 1206 |
|| repositoryPasswordEditor.getStringValue().trim().equals(""); |
1276 |
|| repositoryPasswordEditor.getStringValue().trim().equals(""); |
| 1207 |
} |
1277 |
} |
| 1208 |
|
1278 |
|
|
|
1279 |
/** |
| 1280 |
* @since 2.0 |
| 1281 |
*/ |
| 1209 |
protected String isUniqueUrl(String urlString) { |
1282 |
protected String isUniqueUrl(String urlString) { |
| 1210 |
if (!urlString.equals(originalUrl)) { |
1283 |
if (!urlString.equals(originalUrl)) { |
| 1211 |
if (repositoryUrls == null) { |
1284 |
if (repositoryUrls == null) { |
|
Lines 1223-1233
Link Here
|
| 1223 |
return null; |
1296 |
return null; |
| 1224 |
} |
1297 |
} |
| 1225 |
|
1298 |
|
|
|
1299 |
/** |
| 1300 |
* @since 2.0 |
| 1301 |
*/ |
| 1226 |
@Deprecated |
1302 |
@Deprecated |
| 1227 |
public void setRepository(TaskRepository repository) { |
1303 |
public void setRepository(TaskRepository repository) { |
| 1228 |
this.repository = repository; |
1304 |
this.repository = repository; |
| 1229 |
} |
1305 |
} |
| 1230 |
|
1306 |
|
|
|
1307 |
/** |
| 1308 |
* @since 2.0 |
| 1309 |
*/ |
| 1231 |
public void setVersion(String previousVersion) { |
1310 |
public void setVersion(String previousVersion) { |
| 1232 |
if (previousVersion == null) { |
1311 |
if (previousVersion == null) { |
| 1233 |
serverVersion = TaskRepository.NO_VERSION_SPECIFIED; |
1312 |
serverVersion = TaskRepository.NO_VERSION_SPECIFIED; |
|
Lines 1236-1249
Link Here
|
| 1236 |
} |
1315 |
} |
| 1237 |
} |
1316 |
} |
| 1238 |
|
1317 |
|
|
|
1318 |
/** |
| 1319 |
* @since 2.0 |
| 1320 |
*/ |
| 1239 |
public String getVersion() { |
1321 |
public String getVersion() { |
| 1240 |
return serverVersion; |
1322 |
return serverVersion; |
| 1241 |
} |
1323 |
} |
| 1242 |
|
1324 |
|
|
|
1325 |
/** |
| 1326 |
* @since 2.0 |
| 1327 |
*/ |
| 1243 |
public TaskRepository getRepository() { |
1328 |
public TaskRepository getRepository() { |
| 1244 |
return repository; |
1329 |
return repository; |
| 1245 |
} |
1330 |
} |
| 1246 |
|
1331 |
|
|
|
1332 |
/** |
| 1333 |
* @since 2.0 |
| 1334 |
*/ |
| 1247 |
public String getCharacterEncoding() { |
1335 |
public String getCharacterEncoding() { |
| 1248 |
if (defaultEncoding == null) { |
1336 |
if (defaultEncoding == null) { |
| 1249 |
return null; |
1337 |
return null; |
|
Lines 1260-1265
Link Here
|
| 1260 |
} |
1348 |
} |
| 1261 |
} |
1349 |
} |
| 1262 |
|
1350 |
|
|
|
1351 |
/** |
| 1352 |
* @since 2.0 |
| 1353 |
*/ |
| 1263 |
public TaskRepository createTaskRepository() { |
1354 |
public TaskRepository createTaskRepository() { |
| 1264 |
TaskRepository repository = new TaskRepository(connector.getConnectorKind(), getRepositoryUrl()); |
1355 |
TaskRepository repository = new TaskRepository(connector.getConnectorKind(), getRepositoryUrl()); |
| 1265 |
applyTo(repository); |
1356 |
applyTo(repository); |
|
Lines 1269-1274
Link Here
|
| 1269 |
/** |
1360 |
/** |
| 1270 |
* @since 2.2 |
1361 |
* @since 2.2 |
| 1271 |
*/ |
1362 |
*/ |
|
|
1363 |
@Override |
| 1272 |
public void applyTo(TaskRepository repository) { |
1364 |
public void applyTo(TaskRepository repository) { |
| 1273 |
repository.setVersion(getVersion()); |
1365 |
repository.setVersion(getVersion()); |
| 1274 |
if (needsEncoding()) { |
1366 |
if (needsEncoding()) { |
|
Lines 1307-1362
Link Here
|
| 1307 |
} |
1399 |
} |
| 1308 |
|
1400 |
|
| 1309 |
repository.setOffline(disconnectedButton.getSelection()); |
1401 |
repository.setOffline(disconnectedButton.getSelection()); |
|
|
1402 |
|
| 1403 |
super.applyTo(repository); |
| 1310 |
} |
1404 |
} |
| 1311 |
|
1405 |
|
|
|
1406 |
/** |
| 1407 |
* @since 2.0 |
| 1408 |
*/ |
| 1312 |
public AbstractRepositoryConnector getConnector() { |
1409 |
public AbstractRepositoryConnector getConnector() { |
| 1313 |
return connector; |
1410 |
return connector; |
| 1314 |
} |
1411 |
} |
| 1315 |
|
1412 |
|
|
|
1413 |
/** |
| 1414 |
* @since 2.0 |
| 1415 |
*/ |
| 1316 |
public boolean needsEncoding() { |
1416 |
public boolean needsEncoding() { |
| 1317 |
return needsEncoding; |
1417 |
return needsEncoding; |
| 1318 |
} |
1418 |
} |
| 1319 |
|
1419 |
|
|
|
1420 |
/** |
| 1421 |
* @since 2.0 |
| 1422 |
*/ |
| 1320 |
public boolean needsTimeZone() { |
1423 |
public boolean needsTimeZone() { |
| 1321 |
return needsTimeZone; |
1424 |
return needsTimeZone; |
| 1322 |
} |
1425 |
} |
| 1323 |
|
1426 |
|
|
|
1427 |
/** |
| 1428 |
* @since 2.0 |
| 1429 |
*/ |
| 1324 |
public boolean needsAnonymousLogin() { |
1430 |
public boolean needsAnonymousLogin() { |
| 1325 |
return needsAnonymousLogin; |
1431 |
return needsAnonymousLogin; |
| 1326 |
} |
1432 |
} |
| 1327 |
|
1433 |
|
|
|
1434 |
/** |
| 1435 |
* @since 2.0 |
| 1436 |
*/ |
| 1328 |
public boolean needsAdvanced() { |
1437 |
public boolean needsAdvanced() { |
| 1329 |
return needsAdvanced; |
1438 |
return needsAdvanced; |
| 1330 |
} |
1439 |
} |
| 1331 |
|
1440 |
|
|
|
1441 |
/** |
| 1442 |
* @since 2.0 |
| 1443 |
*/ |
| 1332 |
public void setNeedsEncoding(boolean needsEncoding) { |
1444 |
public void setNeedsEncoding(boolean needsEncoding) { |
| 1333 |
this.needsEncoding = needsEncoding; |
1445 |
this.needsEncoding = needsEncoding; |
| 1334 |
} |
1446 |
} |
| 1335 |
|
1447 |
|
|
|
1448 |
/** |
| 1449 |
* @since 2.0 |
| 1450 |
*/ |
| 1336 |
public void setNeedsTimeZone(boolean needsTimeZone) { |
1451 |
public void setNeedsTimeZone(boolean needsTimeZone) { |
| 1337 |
this.needsTimeZone = needsTimeZone; |
1452 |
this.needsTimeZone = needsTimeZone; |
| 1338 |
} |
1453 |
} |
| 1339 |
|
1454 |
|
|
|
1455 |
/** |
| 1456 |
* @since 2.0 |
| 1457 |
*/ |
| 1340 |
public void setNeedsAdvanced(boolean needsAdvanced) { |
1458 |
public void setNeedsAdvanced(boolean needsAdvanced) { |
| 1341 |
this.needsAdvanced = needsAdvanced; |
1459 |
this.needsAdvanced = needsAdvanced; |
| 1342 |
} |
1460 |
} |
| 1343 |
|
1461 |
|
|
|
1462 |
/** |
| 1463 |
* @since 2.0 |
| 1464 |
*/ |
| 1344 |
public boolean needsHttpAuth() { |
1465 |
public boolean needsHttpAuth() { |
| 1345 |
return this.needsHttpAuth; |
1466 |
return this.needsHttpAuth; |
| 1346 |
} |
1467 |
} |
| 1347 |
|
1468 |
|
|
|
1469 |
/** |
| 1470 |
* @since 2.0 |
| 1471 |
*/ |
| 1348 |
public void setNeedsHttpAuth(boolean needsHttpAuth) { |
1472 |
public void setNeedsHttpAuth(boolean needsHttpAuth) { |
| 1349 |
this.needsHttpAuth = needsHttpAuth; |
1473 |
this.needsHttpAuth = needsHttpAuth; |
| 1350 |
} |
1474 |
} |
| 1351 |
|
1475 |
|
|
|
1476 |
/** |
| 1477 |
* @since 2.0 |
| 1478 |
*/ |
| 1352 |
public void setNeedsProxy(boolean needsProxy) { |
1479 |
public void setNeedsProxy(boolean needsProxy) { |
| 1353 |
this.needsProxy = needsProxy; |
1480 |
this.needsProxy = needsProxy; |
| 1354 |
} |
1481 |
} |
| 1355 |
|
1482 |
|
|
|
1483 |
/** |
| 1484 |
* @since 2.0 |
| 1485 |
*/ |
| 1356 |
public boolean needsProxy() { |
1486 |
public boolean needsProxy() { |
| 1357 |
return this.needsProxy; |
1487 |
return this.needsProxy; |
| 1358 |
} |
1488 |
} |
| 1359 |
|
1489 |
|
|
|
1490 |
/** |
| 1491 |
* @since 2.0 |
| 1492 |
*/ |
| 1360 |
public void setNeedsAnonymousLogin(boolean needsAnonymousLogin) { |
1493 |
public void setNeedsAnonymousLogin(boolean needsAnonymousLogin) { |
| 1361 |
this.needsAnonymousLogin = needsAnonymousLogin; |
1494 |
this.needsAnonymousLogin = needsAnonymousLogin; |
| 1362 |
} |
1495 |
} |
|
Lines 1365-1385
Link Here
|
| 1365 |
this.needsValidation = needsValidation; |
1498 |
this.needsValidation = needsValidation; |
| 1366 |
} |
1499 |
} |
| 1367 |
|
1500 |
|
|
|
1501 |
/** |
| 1502 |
* @since 2.0 |
| 1503 |
*/ |
| 1368 |
public boolean needsValidation() { |
1504 |
public boolean needsValidation() { |
| 1369 |
return needsValidation; |
1505 |
return needsValidation; |
| 1370 |
} |
1506 |
} |
| 1371 |
|
1507 |
|
| 1372 |
/** for testing */ |
1508 |
/** |
|
|
1509 |
* Public for testing. |
| 1510 |
* |
| 1511 |
* @since 2.0 |
| 1512 |
*/ |
| 1373 |
public void setUrl(String url) { |
1513 |
public void setUrl(String url) { |
| 1374 |
serverUrlCombo.setText(url); |
1514 |
serverUrlCombo.setText(url); |
| 1375 |
} |
1515 |
} |
| 1376 |
|
1516 |
|
| 1377 |
/** for testing */ |
1517 |
/** |
|
|
1518 |
* Public for testing. |
| 1519 |
* |
| 1520 |
* @since 2.0 |
| 1521 |
*/ |
| 1378 |
public void setUserId(String id) { |
1522 |
public void setUserId(String id) { |
| 1379 |
repositoryUserNameEditor.setStringValue(id); |
1523 |
repositoryUserNameEditor.setStringValue(id); |
| 1380 |
} |
1524 |
} |
| 1381 |
|
1525 |
|
| 1382 |
/** for testing */ |
1526 |
/** |
|
|
1527 |
* Public for testing. |
| 1528 |
* |
| 1529 |
* @since 2.0 |
| 1530 |
*/ |
| 1383 |
public void setPassword(String pass) { |
1531 |
public void setPassword(String pass) { |
| 1384 |
repositoryPasswordEditor.setStringValue(pass); |
1532 |
repositoryPasswordEditor.setStringValue(pass); |
| 1385 |
} |
1533 |
} |
|
Lines 1413-1418
Link Here
|
| 1413 |
} |
1561 |
} |
| 1414 |
} |
1562 |
} |
| 1415 |
|
1563 |
|
|
|
1564 |
/** |
| 1565 |
* Validate settings provided by the {@link #getValidator(TaskRepository) validator}, typically the server settings. |
| 1566 |
* |
| 1567 |
* @since 2.0 |
| 1568 |
*/ |
| 1416 |
protected void validateSettings() { |
1569 |
protected void validateSettings() { |
| 1417 |
final Validator validator = getValidator(createTaskRepository()); |
1570 |
final Validator validator = getValidator(createTaskRepository()); |
| 1418 |
if (validator == null) { |
1571 |
if (validator == null) { |
|
Lines 1453-1458
Link Here
|
| 1453 |
getWizard().getContainer().updateButtons(); |
1606 |
getWizard().getContainer().updateButtons(); |
| 1454 |
} |
1607 |
} |
| 1455 |
|
1608 |
|
|
|
1609 |
/** |
| 1610 |
* @since 3.1 |
| 1611 |
*/ |
| 1612 |
@Override |
| 1613 |
protected IStatus validate() { |
| 1614 |
return null; |
| 1615 |
} |
| 1616 |
|
| 1617 |
/** |
| 1618 |
* @since 2.0 |
| 1619 |
*/ |
| 1456 |
protected void applyValidatorResult(Validator validator) { |
1620 |
protected void applyValidatorResult(Validator validator) { |
| 1457 |
IStatus status = validator.getStatus(); |
1621 |
IStatus status = validator.getStatus(); |
| 1458 |
String message = status.getMessage(); |
1622 |
String message = status.getMessage(); |
|
Lines 1483-1491
Link Here
|
| 1483 |
setErrorMessage(null); |
1647 |
setErrorMessage(null); |
| 1484 |
} |
1648 |
} |
| 1485 |
|
1649 |
|
|
|
1650 |
/** |
| 1651 |
* @since 2.0 |
| 1652 |
*/ |
| 1486 |
protected abstract Validator getValidator(TaskRepository repository); |
1653 |
protected abstract Validator getValidator(TaskRepository repository); |
| 1487 |
|
1654 |
|
| 1488 |
// public for testing |
1655 |
/** |
|
|
1656 |
* Public for testing. |
| 1657 |
* |
| 1658 |
* @since 2.0 |
| 1659 |
*/ |
| 1489 |
public abstract class Validator { |
1660 |
public abstract class Validator { |
| 1490 |
|
1661 |
|
| 1491 |
private IStatus status; |
1662 |
private IStatus status; |