use of nl.tudelft.watchdog.core.ui.preferences.ProjectPreferenceSetting in project watchdog by TestRoots.
the class StartupUIThread method checkWhetherToDisplayProjectWizard.
private void checkWhetherToDisplayProjectWizard() {
ProjectPreferenceSetting setting = preferences.getOrCreateProjectSetting(workspaceName);
if (setting.enableWatchdog && WatchDogUtils.isEmpty(setting.projectId)) {
displayProjectWizard();
savePreferenceStoreIfNeeded();
}
}
use of nl.tudelft.watchdog.core.ui.preferences.ProjectPreferenceSetting in project watchdog by TestRoots.
the class WatchDogStartUp method checkWhetherToStartWatchDog.
private void checkWhetherToStartWatchDog() {
ProjectPreferenceSetting setting = WatchDogGlobals.getPreferences().getOrCreateProjectSetting(project.getName());
if (setting.enableWatchdog) {
WatchDogLogger.getInstance().logInfo("Starting WatchDog ...");
InitializationManager.getInstance(project);
WatchDogUtils.setWatchDogActiveForProject(project);
new ViewToolWindowButtonsAction().setSelected(null, true);
}
}
use of nl.tudelft.watchdog.core.ui.preferences.ProjectPreferenceSetting in project watchdog by TestRoots.
the class WatchDogStartUp method checkWhetherToDisplayUserProjectRegistrationWizard.
/**
* Checks whether there is a registered WatchDog user
*/
private void checkWhetherToDisplayUserProjectRegistrationWizard() {
Preferences preferences = Preferences.getInstance();
ProjectPreferenceSetting projectSetting = preferences.getOrCreateProjectSetting(project.getName());
if (!WatchDogUtils.isEmpty(WatchDogGlobals.getPreferences().getUserId()) || (projectSetting.startupQuestionAsked && !projectSetting.enableWatchdog)) {
return;
}
UserProjectRegistrationWizard wizard = new UserProjectRegistrationWizard("User and Project Registration", project);
wizard.show();
if (wizard.getExitCode() == DialogWrapper.CANCEL_EXIT_CODE) {
if (Messages.YES == Messages.showYesNoDialog(WATCHDOG_UNREGISTERED_WARNING, "WatchDog is not registered!", Messages.getQuestionIcon())) {
makeSilentRegistration();
} else {
userProjectRegistrationCancelled = true;
preferences.registerProjectUse(project.getName(), false);
}
}
}
use of nl.tudelft.watchdog.core.ui.preferences.ProjectPreferenceSetting 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.core.ui.preferences.ProjectPreferenceSetting in project watchdog by TestRoots.
the class PreferencePage method createContents.
@Override
protected Control createContents(Composite parent) {
Color colorRed = new Color(getShell().getDisplay(), 255, 0, 0);
UIUtils.createLabel("Changes in the settings become active after a restart of Eclipse.", parent, colorRed);
UIUtils.createLabel("", parent);
Group localGroup = createGroup(parent, "Local Settings", 1);
UIUtils.createLabel("Here you can define the local WatchDog settings for this workspace.", localGroup);
UIUtils.createLabel("", localGroup);
Composite projectComposite = UIUtils.createGridedComposite(localGroup, 2);
projectComposite.setLayoutData(UIUtils.createFullGridUsageData());
UIUtils.createLabel("Project-ID ", projectComposite);
projectIDInput = UIUtils.createTextInput(projectComposite);
projectIDInput.setTextLimit(ID_LENGTH);
enableWatchdogInput = new Button(localGroup, SWT.CHECK);
enableWatchdogInput.setText("Monitor this workspace with WatchDog ");
ProjectPreferenceSetting workspaceSetting = preferences.getOrCreateProjectSetting(workspace);
projectIDInput.setText(workspaceSetting.projectId);
enableWatchdogInput.setSelection(workspaceSetting.enableWatchdog);
UIUtils.createLabel("", parent);
Group globalGroup = createGroup(parent, "Global Settings", 1);
UIUtils.createLabel("Here you can enter settings that will affect WatchDog no matter which workspace you have opened. ", globalGroup);
UIUtils.createLabel("", globalGroup);
return super.createContents(globalGroup);
}
Aggregations