Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 16:20:42 +0000
committerJonah Graham2018-11-22 21:47:02 +0000
commit170e654b4796bad1453ae85a427b97317d67a69a (patch)
tree6ca9b8a8fedd5fd25f97eb79c408312e256ff981 /build/org.eclipse.cdt.meson.ui
parent35996a5c5ca5c254959ba48241eaada6dbf8628d (diff)
downloadorg.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.gz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.xz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.zip
Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then Source -> Clean Up... -> choosing: - Format source code - Remove trailing white spaces on all lines and completing the wizard Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
Diffstat (limited to 'build/org.eclipse.cdt.meson.ui')
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/EmptyMesonProjectWizard.java2
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java5
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java8
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/Messages.java5
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonProjectWizard.java2
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFilePage.java4
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFileWizard.java2
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java22
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/AbstractMesonCommandHandler.java22
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java15
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinja.java8
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinjaPage.java20
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/WizardMessages.java5
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/Activator.java2
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/IMesonPropertyPageControl.java16
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyArgs.java4
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCheckbox.java8
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCombo.java9
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyInteger.java18
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java116
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertySpecialCheckbox.java5
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyText.java10
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/Messages.java14
23 files changed, 161 insertions, 161 deletions
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/EmptyMesonProjectWizard.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/EmptyMesonProjectWizard.java
index bb896b88e76..ddbbf561968 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/EmptyMesonProjectWizard.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/EmptyMesonProjectWizard.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - modified for use in Meson build
*******************************************************************************/
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java
index e2bbd93c7c3..0e2359d1ed3 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - modified for use in Meson build
*******************************************************************************/
@@ -176,8 +176,7 @@ public class MesonBuildTab extends CommonBuildTab {
@Override
protected void saveProperties(Map<String, String> properties) {
super.saveProperties(properties);
- properties.put(IMesonConstants.MESON_GENERATOR,
- ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$ //$NON-NLS-2$
+ properties.put(IMesonConstants.MESON_GENERATOR, ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$ //$NON-NLS-2$
properties.put(IMesonConstants.MESON_ARGUMENTS, mesonArgsText.getText().trim());
properties.put(IMesonConstants.BUILD_COMMAND, buildCommandText.getText().trim());
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java
index 310858df892..c99d5ef071d 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - modified for use in Meson build
*******************************************************************************/
@@ -168,7 +168,7 @@ public class MesonPreferencePage extends PreferencePage implements IWorkbenchPre
for (IMesonToolChainFile file : filesToRemove.values()) {
files.remove(file.getPath());
}
-
+
for (IMesonToolChainFile file : filesToAdd.values()) {
files.put(file.getPath(), file);
}
@@ -185,10 +185,10 @@ public class MesonPreferencePage extends PreferencePage implements IWorkbenchPre
for (IMesonToolChainFile file : filesToAdd.values()) {
manager.addToolChainFile(file);
}
-
+
filesToAdd.clear();
filesToRemove.clear();
-
+
return true;
}
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/Messages.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/Messages.java
index a5ce081ea87..5e2ec08c131 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/Messages.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/Messages.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -38,7 +38,6 @@ public class Messages extends NLS {
public static String MesonPropertyPage_FailedToStartMesonGui_Title;
public static String MesonPropertyPage_LaunchMesonGui;
-
public static String NewMesonProjectWizard_Description;
public static String NewMesonProjectWizard_PageTitle;
public static String NewMesonProjectWizard_WindowTitle;
@@ -50,7 +49,6 @@ public class Messages extends NLS {
public static String NewMesonToolChainFilePage_Title;
public static String NewMesonToolChainFilePage_Toolchain;
-
static {
// initialize resource bundle
NLS.initializeMessages("org.eclipse.cdt.internal.meson.ui.messages", Messages.class); //$NON-NLS-1$
@@ -59,4 +57,3 @@ public class Messages extends NLS {
private Messages() {
}
}
-
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonProjectWizard.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonProjectWizard.java
index 0836f86bdc5..198dede7c75 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonProjectWizard.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonProjectWizard.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - modified for use in Meson build
*******************************************************************************/
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFilePage.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFilePage.java
index 52a5caf6567..9567c0d9ec3 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFilePage.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFilePage.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - modified for use in Meson build
*******************************************************************************/
@@ -82,7 +82,7 @@ public class NewMesonToolChainFilePage extends WizardPage {
tcCombo = new Combo(comp, SWT.READ_ONLY);
tcCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
+
try {
IToolChainManager tcManager = Activator.getService(IToolChainManager.class);
toolchains = tcManager.getAllToolChains().toArray(new IToolChain[0]);
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFileWizard.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFileWizard.java
index d9e8c327e44..d7530afd0b7 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFileWizard.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/NewMesonToolChainFileWizard.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - modified for use in Meson build
*******************************************************************************/
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java
index a0259d9e420..5c56c670950 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -24,8 +24,7 @@ import org.eclipse.swt.graphics.Image;
public class SWTImagesFactory {
// The plug-in registry
- private static ImageRegistry imageRegistry = Activator.getPlugin()
- .getImageRegistry();
+ private static ImageRegistry imageRegistry = Activator.getPlugin().getImageRegistry();
// Sub-directory (under the package containing this class) where 16 color
// images are
@@ -33,8 +32,7 @@ public class SWTImagesFactory {
static {
try {
- fgIconBaseURL = new URL(Activator.getPlugin().getBundle()
- .getEntry("/"), "icons/"); //$NON-NLS-1$ //$NON-NLS-2$
+ fgIconBaseURL = new URL(Activator.getPlugin().getBundle().getEntry("/"), "icons/"); //$NON-NLS-1$ //$NON-NLS-2$
} catch (MalformedURLException e) {
Activator.log(e);
}
@@ -42,15 +40,13 @@ public class SWTImagesFactory {
private static final String NAME_PREFIX = Activator.PLUGIN_ID + '.';
private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length();
public static final String IMG_MESON = NAME_PREFIX + "meson-logo.png"; //$NON-NLS-1$
- public static final ImageDescriptor DESC_MESON = createManaged("",
- IMG_MESON);
-
+ public static final ImageDescriptor DESC_MESON = createManaged("", IMG_MESON);
+
private static ImageDescriptor createManaged(String prefix, String name) {
return createManaged(imageRegistry, prefix, name);
}
- private static ImageDescriptor createManaged(ImageRegistry registry,
- String prefix, String name) {
+ private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) {
ImageDescriptor result = ImageDescriptor
.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH)));
registry.put(name, result);
@@ -78,7 +74,7 @@ public class SWTImagesFactory {
/**
* Sets all available image descriptors for the given action.
- *
+ *
* @param action
* - action
* @param type
@@ -86,8 +82,7 @@ public class SWTImagesFactory {
* @param relPath
* - relative path
*/
- public static void setImageDescriptors(IAction action, String type,
- String relPath) {
+ public static void setImageDescriptors(IAction action, String type, String relPath) {
if (relPath.startsWith(NAME_PREFIX)) {
relPath = relPath.substring(NAME_PREFIX_LENGTH);
}
@@ -104,4 +99,3 @@ public class SWTImagesFactory {
}
}
-
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/AbstractMesonCommandHandler.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/AbstractMesonCommandHandler.java
index d8a746d5643..d6abd8cd8f5 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/AbstractMesonCommandHandler.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/AbstractMesonCommandHandler.java
@@ -33,7 +33,7 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.handlers.HandlerUtil;
public abstract class AbstractMesonCommandHandler extends AbstractHandler {
-
+
private IContainer fContainer;
protected abstract void run(Shell activeShell);
@@ -41,7 +41,7 @@ public abstract class AbstractMesonCommandHandler extends AbstractHandler {
protected Object execute1(ExecutionEvent event) {
ISelection k = HandlerUtil.getCurrentSelection(event);
if (!k.isEmpty() && k instanceof IStructuredSelection) {
- Object obj = ((IStructuredSelection)k).getFirstElement();
+ Object obj = ((IStructuredSelection) k).getFirstElement();
IContainer container = getContainer(obj);
if (container != null) {
setSelectedContainer(container);
@@ -56,40 +56,40 @@ public abstract class AbstractMesonCommandHandler extends AbstractHandler {
IContainer fContainer = null;
if (obj instanceof Collection) {
- Collection<Object> c = (Collection<Object>)obj;
+ Collection<Object> c = (Collection<Object>) obj;
Object[] objArray = c.toArray();
if (objArray.length > 0) {
obj = objArray[0];
}
}
if (obj instanceof ICElement) {
- if ( obj instanceof ICContainer || obj instanceof ICProject) {
+ if (obj instanceof ICContainer || obj instanceof ICProject) {
fContainer = (IContainer) ((ICElement) obj).getUnderlyingResource();
} else {
- obj = ((ICElement)obj).getResource();
- if ( obj != null) {
- fContainer = ((IResource)obj).getParent();
+ obj = ((ICElement) obj).getResource();
+ if (obj != null) {
+ fContainer = ((IResource) obj).getParent();
}
}
} else if (obj instanceof IResource) {
if (obj instanceof IContainer) {
fContainer = (IContainer) obj;
} else {
- fContainer = ((IResource)obj).getParent();
+ fContainer = ((IResource) obj).getParent();
}
} else {
fContainer = null;
}
return fContainer;
}
-
+
protected void showError(String title, String content) {
MessageDialog.openError(new Shell(), title, content);
}
/**
* Separate targets to array from a string.
- *
+ *
* @param rawArgList
* @return targets in string[] array. if targets are not formatted properly,
* returns null
@@ -232,7 +232,7 @@ public abstract class AbstractMesonCommandHandler extends AbstractHandler {
}
return cwd;
}
-
+
protected IContainer getSelectedContainer() {
return fContainer;
}
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java
index 4a0d64ad232..8e79f194cba 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -45,18 +45,18 @@ public class RunNinjaCommandHandler extends AbstractMesonCommandHandler {
public Object execute(ExecutionEvent event) {
return execute1(event);
}
-
+
@Override
- public void run (Shell shell) {
+ public void run(Shell shell) {
// Set up console
IConsole console = CCorePlugin.getDefault().getConsole();
IProject project = getSelectedContainer().getAdapter(IProject.class);
console.start(project);
try {
ICBuildConfiguration buildConfig = project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class);
-
+
if (buildConfig instanceof MesonBuildConfiguration) {
- MesonBuildConfiguration config = (MesonBuildConfiguration)buildConfig;
+ MesonBuildConfiguration config = (MesonBuildConfiguration) buildConfig;
RunNinja wizard = new RunNinja(buildConfig);
final WizardDialog dialog = new WizardDialog(shell, wizard);
Display.getDefault().syncExec(() -> {
@@ -86,7 +86,8 @@ public class RunNinjaCommandHandler extends AbstractMesonCommandHandler {
ninjaArgs = ninjaArgList.toArray(new String[0]);
}
try {
- config.build(IncrementalProjectBuilder.FULL_BUILD, null, ninjaEnv, ninjaArgs, console, monitor);
+ config.build(IncrementalProjectBuilder.FULL_BUILD, null, ninjaEnv, ninjaArgs, console,
+ monitor);
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
@@ -103,5 +104,5 @@ public class RunNinjaCommandHandler extends AbstractMesonCommandHandler {
Activator.log(e);
}
}
-
+
}
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinja.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinja.java
index d9ec063d184..ce5d7d8f3d4 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinja.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinja.java
@@ -18,7 +18,7 @@ import org.eclipse.cdt.meson.core.IMesonConstants;
import org.eclipse.jface.wizard.Wizard;
public class RunNinja extends Wizard {
-
+
private RunNinjaPage mainPage;
private ICBuildConfiguration config;
private String envStr;
@@ -47,13 +47,13 @@ public class RunNinja extends Wizard {
config.setProperty(IMesonConstants.NINJA_ARGUMENTS, ninjaArgs);
return true;
}
-
+
public String getEnvStr() {
return envStr;
}
-
+
public String getNinjaArgs() {
return ninjaArgs;
}
-
+
}
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinjaPage.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinjaPage.java
index 92f26ea9b40..7f5c5703880 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinjaPage.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/RunNinjaPage.java
@@ -31,11 +31,11 @@ import org.eclipse.swt.widgets.Text;
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
*/
public class RunNinjaPage extends WizardPage {
-
+
private ICBuildConfiguration config;
private Text envText;
private Text ninjaArgs;
@@ -50,15 +50,15 @@ public class RunNinjaPage extends WizardPage {
@Override
public void createControl(Composite parent) {
-
+
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setLayout(new GridLayout(1, true));
-
+
Label envLabel = new Label(composite, SWT.NONE);
envLabel.setText(WizardMessages.RunNinjaPage_env_label);
envLabel.setLayoutData(new GridData());
-
+
envText = new Text(composite, SWT.BORDER);
String lastEnv = config.getProperty(IMesonConstants.NINJA_ENV);
if (lastEnv == null) {
@@ -68,11 +68,11 @@ public class RunNinjaPage extends WizardPage {
envText.setText(lastEnv);
GridData gdata = new GridData(SWT.FILL, SWT.FILL, true, false);
envText.setLayoutData(gdata);
-
+
Label argLabel = new Label(composite, SWT.NONE);
argLabel.setText(WizardMessages.RunNinjaPage_options_label);
argLabel.setLayoutData(new GridData());
-
+
ninjaArgs = new Text(composite, SWT.BORDER);
String lastNinjaArgs = config.getProperty(IMesonConstants.NINJA_ARGUMENTS);
if (lastNinjaArgs == null) {
@@ -82,7 +82,7 @@ public class RunNinjaPage extends WizardPage {
ninjaArgs.setText(lastNinjaArgs);
GridData gdata2 = new GridData(SWT.FILL, SWT.FILL, true, false);
ninjaArgs.setLayoutData(gdata2);
-
+
setControl(composite);
}
@@ -93,7 +93,7 @@ public class RunNinjaPage extends WizardPage {
public String getEnvStr() {
return envText.getText();
}
-
+
/**
* Return the user-specified ninja arguments
* @return the ninja arg String
@@ -101,5 +101,5 @@ public class RunNinjaPage extends WizardPage {
public String getNinjaArgs() {
return ninjaArgs.getText();
}
-
+
}
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/WizardMessages.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/WizardMessages.java
index 5939ebc4556..22aa11c3647 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/WizardMessages.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/wizards/WizardMessages.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -24,7 +24,7 @@ public final class WizardMessages extends NLS {
public static String RunNinjaPage_env_description;
public static String RunNinjaPage_options_label;
public static String RunNinjaPage_options_description;
-
+
static {
// initialize resource bundle
NLS.initializeMessages("org.eclipse.cdt.internal.meson.ui.wizards.wizardmessages", WizardMessages.class); //$NON-NLS-1$
@@ -33,4 +33,3 @@ public final class WizardMessages extends NLS {
private WizardMessages() {
}
}
-
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/Activator.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/Activator.java
index 3b7a13484b8..479f379963e 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/Activator.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/Activator.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/IMesonPropertyPageControl.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/IMesonPropertyPageControl.java
index 2fcb036015b..b26fbe42c68 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/IMesonPropertyPageControl.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/IMesonPropertyPageControl.java
@@ -7,38 +7,38 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
package org.eclipse.cdt.meson.ui.properties;
public interface IMesonPropertyPageControl {
-
+
/**
* Get the value of the field
* @return field value
*/
String getFieldValue();
-
+
/**
* Get the name of the field to set for meson command
* @return field name
*/
String getFieldName();
-
+
/**
* Has the initial value changed
* @return
*/
boolean isValueChanged();
-
+
/**
* Is this field valid?
* @return
*/
boolean isValid();
-
+
/**
* Get the command line parameter if already configured
* @return String containing command-line for configured build dir
@@ -46,7 +46,7 @@ public interface IMesonPropertyPageControl {
default String getConfiguredString() {
return "-D" + getFieldName() + "=" + getFieldValue(); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
/**
* Get the command line parameter if never configured
* @return String containing command-line parm for unconfigured build dir
@@ -60,5 +60,5 @@ public interface IMesonPropertyPageControl {
* @return error message
*/
String getErrorMessage();
-
+
}
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyArgs.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyArgs.java
index 09beba79675..1d90412dee3 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyArgs.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyArgs.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -20,7 +20,7 @@ public class MesonPropertyArgs extends MesonPropertyText {
public MesonPropertyArgs(Composite composite, String name, String initialValue, String tooltip) {
super(composite, name, initialValue, tooltip);
}
-
+
@Override
public String getConfiguredString() {
// TODO Auto-generated method stub
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCheckbox.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCheckbox.java
index 1cf793c4f6a..1fd22d73650 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCheckbox.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCheckbox.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -20,7 +20,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
public class MesonPropertyCheckbox implements IMesonPropertyPageControl {
-
+
private String name;
private boolean initialValue;
protected Button checkbox;
@@ -44,8 +44,6 @@ public class MesonPropertyCheckbox implements IMesonPropertyPageControl {
label.setLayoutData(data2);
}
-
-
@Override
public String getFieldValue() {
return Boolean.toString(checkbox.getSelection());
@@ -65,7 +63,7 @@ public class MesonPropertyCheckbox implements IMesonPropertyPageControl {
public boolean isValid() {
return true;
}
-
+
@Override
public String getErrorMessage() {
return null;
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCombo.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCombo.java
index d93412c3e1d..bff5d38fa5e 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCombo.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyCombo.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -20,11 +20,11 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
public class MesonPropertyCombo implements IMesonPropertyPageControl {
-
+
private String name;
private String initialValue;
private Combo combo;
-
+
public MesonPropertyCombo(Composite composite, String name, String[] values, String initialValue, String tooltip) {
this.name = name;
this.initialValue = initialValue;
@@ -40,7 +40,6 @@ public class MesonPropertyCombo implements IMesonPropertyPageControl {
combo.setToolTipText(tooltip);
}
-
@Override
public String getFieldValue() {
return combo.getText();
@@ -60,7 +59,7 @@ public class MesonPropertyCombo implements IMesonPropertyPageControl {
public boolean isValid() {
return true;
}
-
+
@Override
public String getErrorMessage() {
return null;
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyInteger.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyInteger.java
index aad5f2dcba2..0aabc5783e9 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyInteger.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyInteger.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -17,22 +17,22 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
public class MesonPropertyInteger extends MesonPropertyText {
-
+
@SuppressWarnings("unused")
private MesonPropertyPage page;
private String errorMessage;
-
- public MesonPropertyInteger(Composite composite, MesonPropertyPage page, String name, String initialValue, String tooltip) {
+
+ public MesonPropertyInteger(Composite composite, MesonPropertyPage page, String name, String initialValue,
+ String tooltip) {
super(composite, name, initialValue, tooltip);
this.page = page;
- text.addModifyListener((e) -> {
+ text.addModifyListener((e) -> {
if (isValid() != page.isValid()) {
- page.update();
+ page.update();
}
});
}
-
@Override
public boolean isValid() {
errorMessage = null;
@@ -44,10 +44,10 @@ public class MesonPropertyInteger extends MesonPropertyText {
}
return false;
}
-
+
@Override
public String getErrorMessage() {
return errorMessage;
}
-
+
}
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java
index 6c16489bc95..477ec7d5f9d 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IAR Systems - initial API and implementation
* Red Hat Inc. - modified for use in Meson build
@@ -57,43 +57,45 @@ import org.eclipse.ui.dialogs.PropertyPage;
* Property page for Meson projects. For unconfigured projects, we use the meson command and parse
* the output of the --help option. Otherwise, we use the meson configure command to find current
* options and what may be changed via a meson configure call.
- *
+ *
* We assume that the build directory is in project/build/configname, which is where
- * the CMake project wizard puts it. We also assume that "cmake-gui" is in the user's
+ * the CMake project wizard puts it. We also assume that "cmake-gui" is in the user's
* PATH.
*/
public class MesonPropertyPage extends PropertyPage {
-
+
private IProject project;
private List<IMesonPropertyPageControl> componentList = new ArrayList<>();
private boolean configured;
private CBuildConfiguration buildConfig;
private Text envText;
private Text projText;
-
+
@Override
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setLayout(new GridLayout(1, true));
-
+
project = (IProject) getElement();
String configName;
try {
- buildConfig = ((CBuildConfiguration)project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class));
- configName = ((CBuildConfiguration)project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class)).getName();
+ buildConfig = ((CBuildConfiguration) project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class));
+ configName = ((CBuildConfiguration) project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class))
+ .getName();
IPath sourceDir = project.getLocation();
String buildDir = project.getLocation().append("build").append(configName).toOSString(); //$NON-NLS-1$
IPath buildPath = new Path(buildDir).append("build.ninja"); //$NON-NLS-1$
configured = buildPath.toFile().exists();
if (configured) {
- ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher(project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class));
+ ICommandLauncher launcher = CommandLauncherManager.getInstance()
+ .getCommandLauncher(project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class));
launcher.setProject(project);
if (launcher instanceof ICBuildCommandLauncher) {
- ((ICBuildCommandLauncher)launcher).setBuildConfiguration(buildConfig);
+ ((ICBuildCommandLauncher) launcher).setBuildConfiguration(buildConfig);
}
- Process p = launcher.execute(new Path("meson"), new String[] { "configure", buildDir}, //$NON-NLS-1$ //$NON-NLS-2$
+ Process p = launcher.execute(new Path("meson"), new String[] { "configure", buildDir }, //$NON-NLS-1$ //$NON-NLS-2$
new String[0], sourceDir, new NullProgressMonitor());
if (p != null) {
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
@@ -112,12 +114,13 @@ public class MesonPropertyPage extends PropertyPage {
}
}
} else {
- ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher(project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class));
+ ICommandLauncher launcher = CommandLauncherManager.getInstance()
+ .getCommandLauncher(project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class));
launcher.setProject(project);
if (launcher instanceof ICBuildCommandLauncher) {
- ((ICBuildCommandLauncher)launcher).setBuildConfiguration(buildConfig);
+ ((ICBuildCommandLauncher) launcher).setBuildConfiguration(buildConfig);
}
- Process p = launcher.execute(new Path("meson"), new String[] { "-h"}, //$NON-NLS-1$ //$NON-NLS-2$
+ Process p = launcher.execute(new Path("meson"), new String[] { "-h" }, //$NON-NLS-1$ //$NON-NLS-2$
new String[0], sourceDir, new NullProgressMonitor());
if (p == null) {
return null;
@@ -149,7 +152,7 @@ public class MesonPropertyPage extends PropertyPage {
}
}
}
-
+
Group group = new Group(composite, SWT.BORDER);
GridLayout layout = new GridLayout(2, true);
layout.marginLeft = 10;
@@ -165,7 +168,6 @@ public class MesonPropertyPage extends PropertyPage {
data.horizontalSpan = 1;
envLabel.setLayoutData(data);
-
String mesonEnv = buildConfig.getProperty(IMesonConstants.MESON_ENV);
envText = new Text(group, SWT.BORDER);
@@ -177,7 +179,7 @@ public class MesonPropertyPage extends PropertyPage {
data.grabExcessHorizontalSpace = true;
data.horizontalSpan = 1;
envText.setLayoutData(data);
-
+
group = new Group(composite, SWT.BORDER);
layout = new GridLayout(2, true);
layout.marginLeft = 10;
@@ -194,26 +196,26 @@ public class MesonPropertyPage extends PropertyPage {
projLabel.setLayoutData(data);
String mesonProjOptions = buildConfig.getProperty(IMesonConstants.MESON_PROJECT_OPTIONS);
-
+
projText = new Text(group, SWT.BORDER);
if (mesonProjOptions != null) {
projText.setText(mesonProjOptions);
- }
+ }
projText.setToolTipText(Messages.MesonPropertyPage_project_tooltip);
data = new GridData(GridData.FILL, GridData.FILL, true, false);
data.grabExcessHorizontalSpace = true;
data.horizontalSpan = 1;
projText.setLayoutData(data);
-
+
// default buildtype based on active build configuration
// user can always override and we will use override from then on
String defaultBuildType = "release"; //$NON-NLS-1$
if (configName.contains("debug")) { //$NON-NLS-1$
defaultBuildType = "debug"; //$NON-NLS-1$
}
- if (argMap.get("buildtype") == null) { //$NON-NLS-1$
- argMap.put("buildtype", defaultBuildType); //$NON-NLS-1$
- }
+ if (argMap.get("buildtype") == null) { //$NON-NLS-1$
+ argMap.put("buildtype", defaultBuildType); //$NON-NLS-1$
+ }
componentList = parseHelpOutput(stdout, composite, argMap, defaultBuildType);
}
}
@@ -224,7 +226,7 @@ public class MesonPropertyPage extends PropertyPage {
return composite;
}
-
+
public void update() {
setErrorMessage(null);
for (IMesonPropertyPageControl control : componentList) {
@@ -234,11 +236,11 @@ public class MesonPropertyPage extends PropertyPage {
}
}
}
-
- public enum ParseState {
- INIT, GROUP, OPTION, OPTION_WITH_VALUES, ARGS
+
+ public enum ParseState {
+ INIT, GROUP, OPTION, OPTION_WITH_VALUES, ARGS
};
-
+
@Override
public boolean performOk() {
List<String> args = new ArrayList<>();
@@ -253,16 +255,19 @@ public class MesonPropertyPage extends PropertyPage {
return true;
}
try {
- String configName = ((CBuildConfiguration)project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class)).getName();
+ String configName = ((CBuildConfiguration) project.getActiveBuildConfig()
+ .getAdapter(ICBuildConfiguration.class)).getName();
IPath sourceDir = project.getLocation();
String buildDir = project.getLocation().append("build").append(configName).toOSString(); //$NON-NLS-1$
- ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher(project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class));
+ ICommandLauncher launcher = CommandLauncherManager.getInstance()
+ .getCommandLauncher(project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class));
launcher.setProject(project);
if (launcher instanceof ICBuildCommandLauncher) {
- ((ICBuildCommandLauncher)launcher).setBuildConfiguration(buildConfig);
+ ((ICBuildCommandLauncher) launcher).setBuildConfiguration(buildConfig);
}
args.add(buildDir);
- Process p = launcher.execute(new Path("meson"), args.toArray(new String[0]), new String[0], sourceDir, new NullProgressMonitor()); //$NON-NLS-1$ //$NON-NLS-2$
+ Process p = launcher.execute(new Path("meson"), args.toArray(new String[0]), new String[0], sourceDir, //$NON-NLS-1$
+ new NullProgressMonitor()); //$NON-NLS-2$
int rc = -1;
IConsole console = CCorePlugin.getDefault().getConsole();
console.start(project);
@@ -317,15 +322,17 @@ public class MesonPropertyPage extends PropertyPage {
}
return true;
}
+
/**
* Parse output of meson help call to determine options to show to user
* @param stdout - ByteArrayOutputStream containing output of command
* @param composite - Composite to add Controls to
* @return - list of Controls
*/
- List<IMesonPropertyPageControl> parseHelpOutput(ByteArrayOutputStream stdout, Composite composite, Map<String, String> argMap, String defaultBuildType) {
+ List<IMesonPropertyPageControl> parseHelpOutput(ByteArrayOutputStream stdout, Composite composite,
+ Map<String, String> argMap, String defaultBuildType) {
List<IMesonPropertyPageControl> controls = new ArrayList<>();
-
+
Group group = new Group(composite, SWT.BORDER);
GridLayout layout = new GridLayout(2, true);
layout.marginLeft = 10;
@@ -350,7 +357,8 @@ public class MesonPropertyPage extends PropertyPage {
if (m.matches()) {
description = m.group(1).trim();
}
- IMesonPropertyPageControl control = new MesonPropertyText(group, optionMatcher.group(2), defaultValue, description);
+ IMesonPropertyPageControl control = new MesonPropertyText(group, optionMatcher.group(2),
+ defaultValue, description);
controls.add(control);
} else if (optionMatcher.group(5) != null) {
String defaultValue = argMap.get(optionMatcher.group(2));
@@ -362,7 +370,8 @@ public class MesonPropertyPage extends PropertyPage {
if (defaultValue == null) {
defaultValue = m.group(3).trim();
}
- IMesonPropertyPageControl control = new MesonPropertyCombo(group, optionMatcher.group(2), values, defaultValue, m.group(1).trim());
+ IMesonPropertyPageControl control = new MesonPropertyCombo(group, optionMatcher.group(2),
+ values, defaultValue, m.group(1).trim());
controls.add(control);
}
} else {
@@ -370,18 +379,19 @@ public class MesonPropertyPage extends PropertyPage {
if (argMap.containsKey(optionMatcher.group(2))) {
defaultValue = Boolean.parseBoolean(argMap.get(optionMatcher.group(2)));
}
- IMesonPropertyPageControl control = new MesonPropertySpecialCheckbox(group, optionMatcher.group(2), defaultValue, optionMatcher.group(6));
+ IMesonPropertyPageControl control = new MesonPropertySpecialCheckbox(group,
+ optionMatcher.group(2), defaultValue, optionMatcher.group(6));
controls.add(control);
}
}
-
+
}
} catch (UnsupportedEncodingException e) {
return controls;
}
return controls;
}
-
+
/**
* Parse output of meson configure call to determine options to show to user
* @param stdout - ByteArrayOutputStream containing output of command
@@ -390,14 +400,15 @@ public class MesonPropertyPage extends PropertyPage {
*/
List<IMesonPropertyPageControl> parseConfigureOutput(ByteArrayOutputStream stdout, Composite composite) {
List<IMesonPropertyPageControl> controls = new ArrayList<>();
-
+
try {
String[] lines = stdout.toString(StandardCharsets.UTF_8.name()).split("\\r?\\n"); //$NON-NLS-1$
ParseState state = ParseState.INIT;
Pattern optionPattern = Pattern.compile(Messages.MesonPropertyPage_option_pattern);
Pattern optionWithValuesPattern = Pattern.compile(Messages.MesonPropertyPage_option_with_values_pattern);
Pattern optionLine = Pattern.compile("(\\w+)\\s+([\\w,\\-,/]+)\\s+(.*)$"); //$NON-NLS-1$
- Pattern optionWithValuesLine = Pattern.compile("(\\w+)\\s+([\\w,\\-,/]+)\\s+\\[([\\w,\\-,/]+)((,\\s+[\\w,\\-]+)*)\\]\\s+(.*)$");
+ Pattern optionWithValuesLine = Pattern
+ .compile("(\\w+)\\s+([\\w,\\-,/]+)\\s+\\[([\\w,\\-,/]+)((,\\s+[\\w,\\-]+)*)\\]\\s+(.*)$");
Pattern compilerOrLinkerArgs = Pattern.compile(Messages.MesonPropertyPage_compiler_or_link_args);
Pattern argLine = Pattern.compile("(\\w+)\\s+\\[([^\\]]*)\\]"); //$NON-NLS-1$
Pattern groupPattern = Pattern.compile("(([^:]*)):"); //$NON-NLS-1$
@@ -467,7 +478,8 @@ public class MesonPropertyPage extends PropertyPage {
argValue = argValue.replaceAll("',", ""); //$NON-NLS-1$ //$NON-NLS-2$
argValue = argValue.replaceAll("'", ""); //$NON-NLS-1$ //$NON-NLS-2$
String argDescription = Messages.MesonPropertyPage_arg_description;
- IMesonPropertyPageControl argControl = new MesonPropertyText(parent, argName, argValue, argDescription);
+ IMesonPropertyPageControl argControl = new MesonPropertyText(parent, argName, argValue,
+ argDescription);
controls.add(argControl);
}
state = ParseState.INIT;
@@ -495,14 +507,17 @@ public class MesonPropertyPage extends PropertyPage {
// do nothing
}
if (isInteger) {
- IMesonPropertyPageControl control = new MesonPropertyInteger(parent, this, name, value, description);
+ IMesonPropertyPageControl control = new MesonPropertyInteger(parent, this, name, value,
+ description);
controls.add(control);
- } else if (Messages.MesonPropertyPage_true.equals(value) ||
- Messages.MesonPropertyPage_false.equals(value)) {
- IMesonPropertyPageControl control = new MesonPropertyCheckbox(parent, name, Boolean.getBoolean(value), description);
+ } else if (Messages.MesonPropertyPage_true.equals(value)
+ || Messages.MesonPropertyPage_false.equals(value)) {
+ IMesonPropertyPageControl control = new MesonPropertyCheckbox(parent, name,
+ Boolean.getBoolean(value), description);
controls.add(control);
} else {
- IMesonPropertyPageControl control = new MesonPropertyText(parent, name, value, description);
+ IMesonPropertyPageControl control = new MesonPropertyText(parent, name, value,
+ description);
controls.add(control);
}
} else {
@@ -532,12 +547,13 @@ public class MesonPropertyPage extends PropertyPage {
String possibleValue = m4.group(3);
String extraValues = m4.group(4);
String description = m4.group(6);
- String[] values = new String[] {possibleValue};
+ String[] values = new String[] { possibleValue };
if (!extraValues.isEmpty()) {
values = extraValues.split(",\\s+");
values[0] = possibleValue;
}
- IMesonPropertyPageControl control = new MesonPropertyCombo(parent, name, values, value, description);
+ IMesonPropertyPageControl control = new MesonPropertyCombo(parent, name, values, value,
+ description);
controls.add(control);
} else {
if (line.contains(":")) { //$NON-NLS-1$
@@ -558,5 +574,5 @@ public class MesonPropertyPage extends PropertyPage {
}
return controls;
}
-
+
} \ No newline at end of file
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertySpecialCheckbox.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertySpecialCheckbox.java
index 53ebba9509e..1bd5e1c3f27 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertySpecialCheckbox.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertySpecialCheckbox.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -16,7 +16,7 @@ package org.eclipse.cdt.meson.ui.properties;
import org.eclipse.swt.widgets.Composite;
public class MesonPropertySpecialCheckbox extends MesonPropertyCheckbox {
-
+
public MesonPropertySpecialCheckbox(Composite composite, String name, boolean initialValue, String tooltip) {
super(composite, name, initialValue, tooltip);
}
@@ -29,5 +29,4 @@ public class MesonPropertySpecialCheckbox extends MesonPropertyCheckbox {
return "";
}
-
}
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyText.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyText.java
index e5c31e00eca..951ce10b46e 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyText.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyText.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -20,11 +20,11 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
public class MesonPropertyText implements IMesonPropertyPageControl {
-
+
private String name;
private String initialValue;
protected Text text;
-
+
public MesonPropertyText(Composite composite, String name, String initialValue, String tooltip) {
this.name = name;
if (initialValue == null) {
@@ -51,12 +51,12 @@ public class MesonPropertyText implements IMesonPropertyPageControl {
public String getFieldName() {
return name;
}
-
+
@Override
public boolean isValueChanged() {
return !text.getText().equals(initialValue);
}
-
+
@Override
public boolean isValid() {
return true;
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/Messages.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/Messages.java
index 9fe0cbf0983..6ac9f2cf986 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/Messages.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/Messages.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -25,18 +25,17 @@ public class Messages extends NLS {
public static String MesonPropertyPage_meson_error;
public static String MesonPropertyPage_configure_failed;
public static String MesonPropertyPage_terminated_rc;
-
-
+
public static String MesonPropertyPage_env_group;
public static String MesonPropertyPage_env_tooltip;
public static String MesonPropertyPage_env_label;
-
+
public static String MesonPropertyPage_project_group;
public static String MesonPropertyPage_project_tooltip;
public static String MesonPropertyPage_project_label;
-
+
public static String MesonPropertyPage_options_group;
-
+
public static String MesonPropertyPage_prefix_tooltip;
public static String MesonPropertyPage_libdir_tooltip;
public static String MesonPropertyPage_libexecdir_tooltip;
@@ -64,7 +63,7 @@ public class Messages extends NLS {
public static String MesonPropertyPage_true;
public static String MesonPropertyPage_false;
-
+
static {
// initialize resource bundle
NLS.initializeMessages("org.eclipse.cdt.meson.ui.properties.messages", Messages.class); //$NON-NLS-1$
@@ -73,4 +72,3 @@ public class Messages extends NLS {
private Messages() {
}
}
-

Back to the top