use of nl.tudelft.watchdog.intellij.ui.wizards.projectregistration.ProjectRegistrationWizard in project watchdog by TestRoots.
the class WatchDogStartUp method checkWhetherToDisplayProjectWizard.
private void checkWhetherToDisplayProjectWizard() {
ProjectPreferenceSetting setting = WatchDogGlobals.getPreferences().getOrCreateProjectSetting(project.getName());
if (setting.enableWatchdog && WatchDogUtils.isEmpty(setting.projectId)) {
ProjectRegistrationWizard wizard = new ProjectRegistrationWizard("Project Registration", project);
wizard.show();
if (wizard.getExitCode() == DialogWrapper.CANCEL_EXIT_CODE) {
registerAnonymousProject(WatchDogGlobals.getPreferences().getUserId());
}
}
}
use of nl.tudelft.watchdog.intellij.ui.wizards.projectregistration.ProjectRegistrationWizard in project watchdog by TestRoots.
the class PreferencePage method checkAndUpdateProjectID.
private void checkAndUpdateProjectID(String projectID) {
String projectName = WatchDogUtils.getProjectName();
if (!preferences.isAuthenticationEnabled() || !preferences.getOrCreateProjectSetting(projectName).enableWatchdog) {
preferences.registerProjectId(WatchDogUtils.getProjectName(), projectID);
return;
}
if (projectID.length() < ID_LENGTH) {
if (enableWatchdogInput.isSelected() && WatchDogUtils.isEmptyOrHasOnlyWhitespaces(projectIDInput.getText()) && !WatchDogUtils.isEmptyOrHasOnlyWhitespaces(userIDInput.getText())) {
new ProjectRegistrationWizard("Project Registration", WatchDogUtils.getProject()).show();
return;
}
Messages.showErrorDialog("Project ID must have 40 characters!", "Invalid Input");
isModified = true;
} else {
String url = NetworkUtils.buildExistingProjectURL(projectID);
switch(NetworkUtils.urlExistsAndReturnsStatus200(url)) {
case SUCCESSFUL:
preferences.registerProjectId(WatchDogUtils.getProjectName(), projectID);
break;
case UNSUCCESSFUL:
case NETWORK_ERROR:
Messages.showErrorDialog("Project ID does not exist!", "Invalid Input");
isModified = true;
break;
}
}
}
Aggregations