Skip to content

Commit

Permalink
Fix build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
donat committed Oct 25, 2023
1 parent 2bf8ef0 commit 1ac7f34
Show file tree
Hide file tree
Showing 12 changed files with 227 additions and 240 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/*
* Copyright (c) 2017 the original author or authors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
/*******************************************************************************
* Copyright (c) 2019 Gradle Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*
* Copyright (c) 2017 the original author or authors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
/*******************************************************************************
* Copyright (c) 2019 Gradle Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/

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

import org.eclipse.buildship.ui.internal.util.layout.LayoutUtils;
import org.eclipse.buildship.ui.internal.wizard.workspacecomposite.WorkspaceCompositeWizardMessages;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
Expand All @@ -23,6 +23,9 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.PropertyPage;

import org.eclipse.buildship.ui.internal.util.layout.LayoutUtils;
import org.eclipse.buildship.ui.internal.wizard.workspacecomposite.WorkspaceCompositeWizardMessages;

/**
* Preference page for composite root project.
*
Expand All @@ -39,29 +42,29 @@ public final class GradleCompositeRootProjectPreferencePage extends PropertyPage
private Button selectRootProject;
private Composite rootProjectSettingsComposite;
private Label rootProjectLabel;

private Layout createLayout() {
GridLayout layout = LayoutUtils.newGridLayout(2);
layout.horizontalSpacing = 4;
layout.verticalSpacing = 4;
return layout;
}

@Override
protected Control createContents(Composite parent) {

this.rootProjectSettingsComposite = new Composite(parent, SWT.NONE);
rootProjectSettingsComposite.setLayout(createLayout());

this.overrideSettingsCheckbox = new Button(rootProjectSettingsComposite, SWT.CHECK);
this.rootProjectSettingsComposite = new Composite(parent, SWT.NONE);
this.rootProjectSettingsComposite.setLayout(createLayout());

this.overrideSettingsCheckbox = new Button(this.rootProjectSettingsComposite, SWT.CHECK);
this.overrideSettingsCheckbox.setText("Use project as composite root");
GridDataFactory.swtDefaults().applyTo(rootProjectSettingsComposite);
Label line = new Label(rootProjectSettingsComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
GridDataFactory.swtDefaults().applyTo(this.rootProjectSettingsComposite);

Label line = new Label(this.rootProjectSettingsComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(2, 1).applyTo(line);

// composite root container
Composite workspaceCompositeNameComposite = new Composite(rootProjectSettingsComposite, SWT.NONE);
Composite workspaceCompositeNameComposite = new Composite(this.rootProjectSettingsComposite, SWT.NONE);
GridLayoutFactory.swtDefaults().extendedMargins(0, 0, 0, 10).numColumns(3).applyTo(workspaceCompositeNameComposite);
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).span(3, SWT.DEFAULT).applyTo(workspaceCompositeNameComposite);

Expand All @@ -73,12 +76,12 @@ protected Control createContents(Composite parent) {
// root project text field
this.workspaceCompositeRootProjectLabel = new Text(workspaceCompositeNameComposite, SWT.BORDER);
this.workspaceCompositeRootProjectLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

// root project select button
this.selectRootProject = new Button(workspaceCompositeNameComposite, SWT.PUSH);
this.selectRootProject.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
this.selectRootProject.setText(WorkspaceCompositeWizardMessages.Button_Select_RootProject);
return rootProjectSettingsComposite;
return this.rootProjectSettingsComposite;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
/*
* Copyright (c) 2017 the original author or authors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
/*******************************************************************************
* Copyright (c) 2019 Gradle Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/

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

import org.eclipse.buildship.ui.internal.util.font.FontUtils;
import org.eclipse.buildship.ui.internal.util.layout.LayoutUtils;
import org.eclipse.buildship.ui.internal.util.widget.GradleProjectGroup;
import org.eclipse.buildship.ui.internal.util.widget.UiBuilder;
import org.eclipse.buildship.ui.internal.wizard.workspacecomposite.WorkspaceCompositeWizardMessages;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.PropertyPage;

import org.eclipse.buildship.ui.internal.util.layout.LayoutUtils;
import org.eclipse.buildship.ui.internal.util.widget.GradleProjectGroup;
import org.eclipse.buildship.ui.internal.wizard.workspacecomposite.WorkspaceCompositeWizardMessages;

/**
* Preference page for workspace composite configuration
* Preference page for workspace composite configuration.
*
* @author Sebastian Kuzniarz
*/
Expand All @@ -41,11 +41,11 @@ public final class GradleWorkspaceCompositePreferencePage extends PropertyPage {

@Override
protected Control createContents(Composite parent) {
this.gradleWorkspaceCompositeSettingsComposite = new Composite(parent, SWT.FILL);
gradleWorkspaceCompositeSettingsComposite.setLayout(LayoutUtils.newGridLayout(2));
this.gradleWorkspaceCompositeSettingsComposite = new Composite(parent, SWT.FILL);
this.gradleWorkspaceCompositeSettingsComposite.setLayout(LayoutUtils.newGridLayout(2));

// composite name container
Composite workspaceCompositeNameComposite = new Composite(gradleWorkspaceCompositeSettingsComposite, SWT.FILL);
Composite workspaceCompositeNameComposite = new Composite(this.gradleWorkspaceCompositeSettingsComposite, SWT.FILL);
GridLayoutFactory.fillDefaults().extendedMargins(0, 0, 0, 5).numColumns(2).applyTo(workspaceCompositeNameComposite);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).span(3, SWT.DEFAULT).applyTo(workspaceCompositeNameComposite);

Expand All @@ -57,11 +57,11 @@ protected Control createContents(Composite parent) {
// composite name text field
this.workspaceCompositeNameText = new Text(workspaceCompositeNameComposite, SWT.BORDER);
this.workspaceCompositeNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
this.gradleProjectCheckboxtreeComposite = new GradleProjectGroup(gradleWorkspaceCompositeSettingsComposite);

this.gradleProjectCheckboxtreeComposite = new GradleProjectGroup(this.gradleWorkspaceCompositeSettingsComposite);
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(3, SWT.DEFAULT).applyTo(this.gradleProjectCheckboxtreeComposite);
return gradleWorkspaceCompositeSettingsComposite;

return this.gradleWorkspaceCompositeSettingsComposite;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
/*
* Copyright (c) 2015 the original author or authors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
/*******************************************************************************
* Copyright (c) 2019 Gradle Inc.
*
* Contributors:
* Sebastian Kuzniarz (Diebold Nixdorf Inc.) - initial UI implementation
*/
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/

package org.eclipse.buildship.ui.internal.util.widget;

import org.eclipse.buildship.ui.internal.util.gradle.GradleDistributionViewModel;
import org.eclipse.buildship.ui.internal.wizard.workspacecomposite.WorkspaceCompositeWizardMessages;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
Expand All @@ -23,65 +20,66 @@
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

import org.eclipse.buildship.ui.internal.wizard.workspacecomposite.WorkspaceCompositeWizardMessages;

@SuppressWarnings("unused")
public class GradleProjectGroup extends Group {

private Font font;
private Button newGradleProject;
private Button addExternalGradleProject;
private Composite buttonComposite;
private Tree gradleProjectTree;

public GradleProjectGroup(Composite parent) {
super(parent, SWT.NONE);
setText(WorkspaceCompositeWizardMessages.Group_Label_GradleProjects);
createWidgets();
}

public void createWidgets() {
setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayoutFactory.swtDefaults().numColumns(4).applyTo(this);

this.gradleProjectTree = new Tree(this, SWT.CHECK);
this.gradleProjectTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));

this.buttonComposite = new Composite(this, SWT.NONE);
this.buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true, 1, 1));
GridLayoutFactory.fillDefaults().numColumns(1).applyTo(buttonComposite);

this.newGradleProject = new Button(buttonComposite, SWT.PUSH);
this.newGradleProject.setText(WorkspaceCompositeWizardMessages.Button_New_GradleProject);
this.newGradleProject.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

this.addExternalGradleProject = new Button(buttonComposite, SWT.PUSH);
this.addExternalGradleProject.setText(WorkspaceCompositeWizardMessages.Button_Add_ExternalGradleProject);
this.addExternalGradleProject.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

fillCheckboxTreeWithFakeData();
}


private void fillCheckboxTreeWithFakeData() {
for (int i = 0; i < 4; i++) {
TreeItem iItem = new TreeItem(this.gradleProjectTree, 0);
iItem.setText("TreeItem (0) -" + i);
for (int j = 0; j < 4; j++) {
TreeItem jItem = new TreeItem(iItem, 0);
jItem.setText("TreeItem (1) -" + j);
for (int k = 0; k < 4; k++) {
TreeItem kItem = new TreeItem(jItem, 0);
kItem.setText("TreeItem (2) -" + k);
for (int l = 0; l < 4; l++) {
TreeItem lItem = new TreeItem(kItem, 0);
lItem.setText("TreeItem (3) -" + l);
}
}
}
}
}

@Override
protected void checkSubclass() {
private Font font;
private Button newGradleProject;
private Button addExternalGradleProject;
private Composite buttonComposite;
private Tree gradleProjectTree;

public GradleProjectGroup(Composite parent) {
super(parent, SWT.NONE);
setText(WorkspaceCompositeWizardMessages.Group_Label_GradleProjects);
createWidgets();
}

public void createWidgets() {
setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayoutFactory.swtDefaults().numColumns(4).applyTo(this);

this.gradleProjectTree = new Tree(this, SWT.CHECK);
this.gradleProjectTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));

this.buttonComposite = new Composite(this, SWT.NONE);
this.buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true, 1, 1));
GridLayoutFactory.fillDefaults().numColumns(1).applyTo(this.buttonComposite);

this.newGradleProject = new Button(this.buttonComposite, SWT.PUSH);
this.newGradleProject.setText(WorkspaceCompositeWizardMessages.Button_New_GradleProject);
this.newGradleProject.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

this.addExternalGradleProject = new Button(this.buttonComposite, SWT.PUSH);
this.addExternalGradleProject.setText(WorkspaceCompositeWizardMessages.Button_Add_ExternalGradleProject);
this.addExternalGradleProject.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

fillCheckboxTreeWithFakeData();
}

private void fillCheckboxTreeWithFakeData() {
for (int i = 0; i < 4; i++) {
TreeItem iItem = new TreeItem(this.gradleProjectTree, 0);
iItem.setText("TreeItem (0) -" + i);
for (int j = 0; j < 4; j++) {
TreeItem jItem = new TreeItem(iItem, 0);
jItem.setText("TreeItem (1) -" + j);
for (int k = 0; k < 4; k++) {
TreeItem kItem = new TreeItem(jItem, 0);
kItem.setText("TreeItem (2) -" + k);
for (int l = 0; l < 4; l++) {
TreeItem lItem = new TreeItem(kItem, 0);
lItem.setText("TreeItem (3) -" + l);
}
}
}
}
}

@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
}
}
Loading

0 comments on commit 1ac7f34

Please sign in to comment.