Skip to content

Commit c9a60c1

Browse files
committed
Make source validation tasks pass
1 parent b562d16 commit c9a60c1

27 files changed

+1082
-995
lines changed

org.eclipse.buildship.ui/src/main/java/org/eclipse/buildship/ui/internal/composite/WorkingSetProperyTester.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
/*
2-
* Copyright (c) 2018 the original author or authors.
3-
* All rights reserved. This program and the accompanying materials
4-
* are made available under the terms of the Eclipse Public License v1.0
5-
* which accompanies this distribution, and is available at
6-
* http://www.eclipse.org/legal/epl-v10.html
7-
*/
1+
/*******************************************************************************
2+
* Copyright (c) 2020 Gradle Inc.
3+
*
4+
* This program and the accompanying materials are made
5+
* available under the terms of the Eclipse Public License 2.0
6+
* which is available at https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
******************************************************************************/
810

911
package org.eclipse.buildship.ui.internal.composite;
1012

org.eclipse.buildship.ui/src/main/java/org/eclipse/buildship/ui/internal/preferences/AbstractPropertiesPage.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
/*
2-
* Copyright (c) 2015 the original author or authors.
3-
* All rights reserved. This program and the accompanying materials
4-
* are made available under the terms of the Eclipse Public License v1.0
5-
* which accompanies this distribution, and is available at
6-
* http://www.eclipse.org/legal/epl-v10.html
1+
/*******************************************************************************
2+
* Copyright (c) 2020 Gradle Inc.
73
*
8-
* Contributors:
9-
* Etienne Studer & Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
10-
* Sebastian Kuzniarz (Diebold Nixdorf Inc.) - refactored HelpContextIdProvider
11-
*/
4+
* This program and the accompanying materials are made
5+
* available under the terms of the Eclipse Public License 2.0
6+
* which is available at https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
******************************************************************************/
1210

1311
package org.eclipse.buildship.ui.internal.preferences;
1412

@@ -32,8 +30,8 @@
3230
*/
3331
public abstract class AbstractPropertiesPage extends WizardPage {
3432

35-
private final CompositeConfiguration configuration;
36-
33+
private final CompositeConfiguration configuration;
34+
3735
/**
3836
* Constructor setting up the main messages and the validation facility for this wizard page.
3937
*
@@ -51,10 +49,10 @@ protected AbstractPropertiesPage(String name, String title, String defaultMessag
5149

5250
// set the basic message and the attached image
5351
setTitle(title);
54-
setDescription(defaultMessage);
52+
setDescription(defaultMessage);
5553
setImageDescriptor(ImageDescriptor.createFromFile(GradleCreateWorkspaceCompositeWizardPage.class, "/icons/full/wizban/wizard.png")); //$NON-NLS-1$
5654
}
57-
55+
5856
protected CompositeConfiguration getConfiguration() {
5957
return this.configuration;
6058
}

org.eclipse.buildship.ui/src/main/java/org/eclipse/buildship/ui/internal/preferences/GradleCompositeImportOptionsPreferencePage.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ protected Control createContents(Composite parent) {
6565
}
6666

6767
private void initValues() {
68-
IWorkingSet composite = getTargetComposite();
69-
68+
IWorkingSet composite = getTargetComposite();
69+
7070
BuildConfiguration buildConfig = CorePlugin.configurationManager().loadCompositeConfiguration(composite).getBuildConfiguration();
7171

7272
boolean overrideWorkspaceSettings = buildConfig.isOverrideWorkspaceSettings();
@@ -95,25 +95,25 @@ private void addListeners() {
9595

9696
@Override
9797
public boolean performOk() {
98-
IWorkingSet composite = getTargetComposite();
99-
ConfigurationManager manager = CorePlugin.configurationManager();
100-
CompositeConfiguration currentConfig = manager.loadCompositeConfiguration(composite);
101-
102-
BuildConfiguration updatedConfig = manager.createBuildConfiguration(currentConfig.getBuildConfiguration().getRootProjectDirectory(),
103-
this.gradleProjectSettingsComposite.getOverrideBuildSettingsCheckbox().getSelection(),
104-
this.gradleProjectSettingsComposite.getGradleDistributionGroup().getDistribution().toGradleDistribution(),
105-
this.gradleProjectSettingsComposite.getAdvancedOptionsGroup().getGradleUserHome(),
106-
this.gradleProjectSettingsComposite.getAdvancedOptionsGroup().getJavaHome(),
107-
this.gradleProjectSettingsComposite.getBuildScansCheckbox().getSelection(),
108-
this.gradleProjectSettingsComposite.getOfflineModeCheckbox().getSelection(),
109-
this.gradleProjectSettingsComposite.getAutoSyncCheckbox().getSelection(),
110-
this.gradleProjectSettingsComposite.getAdvancedOptionsGroup().getArguments(),
111-
this.gradleProjectSettingsComposite.getAdvancedOptionsGroup().getJvmArguments(),
112-
this.gradleProjectSettingsComposite.getShowConsoleViewCheckbox().getSelection(),
113-
this.gradleProjectSettingsComposite.getShowExecutionsViewCheckbox().getSelection());
114-
CompositeConfiguration compConf = new DefaultCompositeConfiguration(currentConfig.getCompositeDir(), composite.getElements(), updatedConfig, currentConfig.projectAsCompositeRoot() ,currentConfig.getRootProject());
115-
manager.saveCompositeConfiguration(compConf);
116-
return true;
98+
IWorkingSet composite = getTargetComposite();
99+
ConfigurationManager manager = CorePlugin.configurationManager();
100+
CompositeConfiguration currentConfig = manager.loadCompositeConfiguration(composite);
101+
102+
BuildConfiguration updatedConfig = manager.createBuildConfiguration(currentConfig.getBuildConfiguration().getRootProjectDirectory(),
103+
this.gradleProjectSettingsComposite.getOverrideBuildSettingsCheckbox().getSelection(),
104+
this.gradleProjectSettingsComposite.getGradleDistributionGroup().getDistribution().toGradleDistribution(),
105+
this.gradleProjectSettingsComposite.getAdvancedOptionsGroup().getGradleUserHome(),
106+
this.gradleProjectSettingsComposite.getAdvancedOptionsGroup().getJavaHome(),
107+
this.gradleProjectSettingsComposite.getBuildScansCheckbox().getSelection(),
108+
this.gradleProjectSettingsComposite.getOfflineModeCheckbox().getSelection(),
109+
this.gradleProjectSettingsComposite.getAutoSyncCheckbox().getSelection(),
110+
this.gradleProjectSettingsComposite.getAdvancedOptionsGroup().getArguments(),
111+
this.gradleProjectSettingsComposite.getAdvancedOptionsGroup().getJvmArguments(),
112+
this.gradleProjectSettingsComposite.getShowConsoleViewCheckbox().getSelection(),
113+
this.gradleProjectSettingsComposite.getShowExecutionsViewCheckbox().getSelection());
114+
CompositeConfiguration compConf = new DefaultCompositeConfiguration(currentConfig.getCompositeDir(), composite.getElements(), updatedConfig, currentConfig.projectAsCompositeRoot() ,currentConfig.getRootProject());
115+
manager.saveCompositeConfiguration(compConf);
116+
return true;
117117
}
118118

119119
@SuppressWarnings("cast")

org.eclipse.buildship.ui/src/main/java/org/eclipse/buildship/ui/internal/preferences/GradleCompositeRootProjectPreferencePage.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@ private Layout createLayout() {
6868
}
6969

7070
public GradleCompositeRootProjectPreferencePage() {
71-
this.rootProjectValidator = Validators.optionalDirectoryValidator("Root project");
71+
this.rootProjectValidator = Validators.optionalDirectoryValidator("Root project");
7272
}
7373

7474
@Override
7575
protected Control createContents(Composite parent) {
76-
this.rootProjectSettingsComposite = buildRootProjectSettingsComposite(parent);
76+
this.rootProjectSettingsComposite = buildRootProjectSettingsComposite(parent);
7777
addListeners();
7878
initValues();
7979
return this.rootProjectSettingsComposite;
8080
}
8181

82-
private Composite buildRootProjectSettingsComposite(Composite parent) {
83-
Composite rootProjectComposite = new Composite(parent, SWT.WRAP);
84-
rootProjectComposite.setLayout(createLayout());
82+
private Composite buildRootProjectSettingsComposite(Composite parent) {
83+
Composite rootProjectComposite = new Composite(parent, SWT.WRAP);
84+
rootProjectComposite.setLayout(createLayout());
8585

8686
this.projectAsCompositeRootCheckbox = new Button(rootProjectComposite, SWT.CHECK);
8787
this.projectAsCompositeRootCheckbox.setText("Use project as composite root");
@@ -112,17 +112,17 @@ private Composite buildRootProjectSettingsComposite(Composite parent) {
112112
this.selectRootProject.setText(WorkspaceCompositeWizardMessages.Button_Select_RootProject);
113113
this.selectRootProject.setEnabled(false);
114114
return rootProjectComposite;
115-
}
115+
}
116116

117117
private void initValues() {
118-
IWorkingSet composite = getTargetComposite();
118+
IWorkingSet composite = getTargetComposite();
119119

120120
this.compositeConfig = CorePlugin.configurationManager().loadCompositeConfiguration(composite);
121121
boolean useProjectAsCompositeRoot = this.compositeConfig.projectAsCompositeRoot();
122122

123123
this.projectAsCompositeRootCheckbox.setSelection(useProjectAsCompositeRoot);
124-
this.workspaceCompositeRootProjectLabel.setText(this.compositeConfig.getRootProject().toString());
125-
updateEnablement();
124+
this.workspaceCompositeRootProjectLabel.setText(this.compositeConfig.getRootProject().toString());
125+
updateEnablement();
126126
}
127127

128128
private void addListeners() {
@@ -143,8 +143,8 @@ public void widgetDefaultSelected(SelectionEvent e) {
143143
File rootProjectDir = this.workspaceCompositeRootProjectLabel.getText().isEmpty() ? null: new File(this.workspaceCompositeRootProjectLabel.getText());
144144
this.workspaceCompositeRootProjectLabel.addModifyListener(new ValidatingListener<>(this, () -> rootProjectDir, this.rootProjectValidator));
145145

146-
this.selectRootProject.addSelectionListener(new DirectoryDialogSelectionListener(this.getShell(), this.workspaceCompositeRootProjectLabel, "Root project"));
147-
}
146+
this.selectRootProject.addSelectionListener(new DirectoryDialogSelectionListener(this.getShell(), this.workspaceCompositeRootProjectLabel, "Root project"));
147+
}
148148
}
149149

150150
public void updateEnablement() {
@@ -168,16 +168,16 @@ public void dispose() {
168168

169169
@Override
170170
public boolean performOk() {
171-
IWorkingSet composite = getTargetComposite();
172-
ConfigurationManager manager = CorePlugin.configurationManager();
173-
CompositeConfiguration currentConfig = manager.loadCompositeConfiguration(composite);
174-
175-
CompositeConfiguration compConf = new DefaultCompositeConfiguration(currentConfig.getCompositeDir(),
176-
composite.getElements(),
177-
currentConfig.getBuildConfiguration(),
178-
this.projectAsCompositeRootCheckbox.getSelection(),
179-
new File(this.workspaceCompositeRootProjectLabel.getText()));
180-
manager.saveCompositeConfiguration(compConf);
181-
return true;
171+
IWorkingSet composite = getTargetComposite();
172+
ConfigurationManager manager = CorePlugin.configurationManager();
173+
CompositeConfiguration currentConfig = manager.loadCompositeConfiguration(composite);
174+
175+
CompositeConfiguration compConf = new DefaultCompositeConfiguration(currentConfig.getCompositeDir(),
176+
composite.getElements(),
177+
currentConfig.getBuildConfiguration(),
178+
this.projectAsCompositeRootCheckbox.getSelection(),
179+
new File(this.workspaceCompositeRootProjectLabel.getText()));
180+
manager.saveCompositeConfiguration(compConf);
181+
return true;
182182
}
183183
}

0 commit comments

Comments
 (0)