Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2011-11-17 17:34:21 -0500
committerAndrew Gvozdev2011-11-17 17:34:21 -0500
commit2a1cddd71635c39ae336ba43bb89cecbfb09e21f (patch)
treec7a504d11610c16c23c34e29bba23ba0b280bb81 /build/org.eclipse.cdt.managedbuilder.ui
parente47db971decd8fd15ce52984be3de50b6eaa24de (diff)
downloadorg.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.tar.gz
org.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.tar.xz
org.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.zip
auto-clean: @Override annotations + organize imports + unnecessary
casts/$NON-NLS + trailing white spaces
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildAllConfigurationsAction.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java50
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAllConfigurationsAction.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildAction.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildDialog.java43
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java25
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetAction.java25
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetDialog.java50
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ArtifactTab.java65
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java220
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java110
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/CPropertyVarsTab.java139
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java84
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java39
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewBuildConfigurationDialog.java103
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java147
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java91
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyTab.java207
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java22
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSelectionDialog.java134
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsPrefStore.java100
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CDTConfigWizardPage.java37
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java27
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPage.java31
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageData.java54
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java23
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java51
28 files changed, 1031 insertions, 883 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildAllConfigurationsAction.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildAllConfigurationsAction.java
index 371244d31d..1ec00968ca 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildAllConfigurationsAction.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildAllConfigurationsAction.java
@@ -31,11 +31,13 @@ import org.eclipse.ui.internal.ide.actions.BuildUtilities;
public class BuildAllConfigurationsAction implements IObjectActionDelegate {
private ArrayList<IProject> projects = null;
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
projects = CleanAndBuildAction.getSelectedCdtProjects(selection);
action.setEnabled(projects.size() > 0);
}
+ @Override
public void run(IAction action) {
// Setup the global build console
CUIPlugin.getDefault().startGlobalConsole();
@@ -47,7 +49,7 @@ public class BuildAllConfigurationsAction implements IObjectActionDelegate {
if (cfgds != null && cfgds.length > 0) {
// save all dirty editors
BuildUtilities.saveEditors(null);
-
+
Job buildFilesJob = new BuildConfigurationsJob(cfgds, 0, IncrementalProjectBuilder.INCREMENTAL_BUILD);
buildFilesJob.schedule();
}
@@ -56,6 +58,7 @@ public class BuildAllConfigurationsAction implements IObjectActionDelegate {
}
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java
index 02ab009f96..3da83ce298 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java
@@ -4,7 +4,7 @@
* 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
- *
+ *
* Contributors:
* Texas Instruments - initial API and implementation
*******************************************************************************/
@@ -13,32 +13,33 @@ package org.eclipse.cdt.managedbuilder.internal.ui.actions;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+
import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.core.resources.ICommand;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.core.GeneratedMakefileBuilder;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator;
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionDelegate;
import org.eclipse.ui.internal.ide.actions.BuildUtilities;
@@ -57,7 +58,7 @@ public class BuildFilesAction extends ActionDelegate implements
private IAction action = null;
/**
- *
+ *
*/
public BuildFilesAction() {
this(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
@@ -75,7 +76,7 @@ public class BuildFilesAction extends ActionDelegate implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
@Override
@@ -95,9 +96,10 @@ public class BuildFilesAction extends ActionDelegate implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {
workbenchWindow = window;
@@ -108,7 +110,7 @@ public class BuildFilesAction extends ActionDelegate implements
* interface. The conversion is a bare cast operation (if the object is
* instance of <code>IFile</code>, or an adaptation (if the object is
* instance of <code>IAdaptable</code>).
- *
+ *
* @param object
* the object to be cast to <code>IFile</code>
* @return a reference to an IFile corresponding to the object provided, or
@@ -149,7 +151,7 @@ public class BuildFilesAction extends ActionDelegate implements
/**
* Returns a list of resources currently selected.
* "Buildable" means buildable by MBS.
- *
+ *
* @return a list of resources
*/
private List<IFile> getSelectedBuildableFiles() {
@@ -253,7 +255,7 @@ public class BuildFilesAction extends ActionDelegate implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
@@ -274,18 +276,18 @@ public class BuildFilesAction extends ActionDelegate implements
}
private boolean shouldBeEnabled() {
-
+
// fix for Bugzilla 139663
// if build automatically is turned on, then this menu should be turned off as
// it will trigger the auto build
Preferences preferences = ResourcesPlugin.getPlugin().getPluginPreferences();
-
+
if(preferences.getBoolean(ResourcesPlugin.PREF_AUTO_BUILDING))
{
// auto building is on... do not enable the menu
return false;
}
-
+
ISelectionService selectionService = workbenchWindow
.getSelectionService();
ISelection selection = selectionService.getSelection();
@@ -309,7 +311,7 @@ public class BuildFilesAction extends ActionDelegate implements
IManagedBuildInfo buildInfo = ManagedBuildManager
.getBuildInfo(file.getProject());
- if (buildInfo == null || !buildInfo.isValid()
+ if (buildInfo == null || !buildInfo.isValid()
|| buildInfo.getDefaultConfiguration() == null
|| !buildInfo.getDefaultConfiguration().isManagedBuildOn()) {
return false;
@@ -361,7 +363,7 @@ public class BuildFilesAction extends ActionDelegate implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
* org.eclipse.jface.viewers.ISelection)
*/
@@ -370,7 +372,7 @@ public class BuildFilesAction extends ActionDelegate implements
// update state
update();
}
-
+
/*
* Returns the projects to build.
@@ -389,7 +391,7 @@ public class BuildFilesAction extends ActionDelegate implements
}
}
}
-
+
return projectsToBuild;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAllConfigurationsAction.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAllConfigurationsAction.java
index d8f0e1c5b7..13b2c60c7f 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAllConfigurationsAction.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAllConfigurationsAction.java
@@ -31,11 +31,13 @@ import org.eclipse.ui.internal.ide.actions.BuildUtilities;
public class CleanAllConfigurationsAction implements IObjectActionDelegate {
private ArrayList<IProject> projects = null;
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
projects = CleanAndBuildAction.getSelectedCdtProjects(selection);
action.setEnabled(projects.size() > 0);
}
+ @Override
public void run(IAction action) {
// Setup the global build console
CUIPlugin.getDefault().startGlobalConsole();
@@ -47,7 +49,7 @@ public class CleanAllConfigurationsAction implements IObjectActionDelegate {
if (cfgds != null && cfgds.length > 0) {
// save all dirty editors
BuildUtilities.saveEditors(null);
-
+
Job buildFilesJob = new BuildConfigurationsJob(cfgds, IncrementalProjectBuilder.CLEAN_BUILD, 0);
buildFilesJob.schedule();
}
@@ -56,6 +58,7 @@ public class CleanAllConfigurationsAction implements IObjectActionDelegate {
}
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildAction.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildAction.java
index e26b3be45b..d643ed8c47 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildAction.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildAction.java
@@ -28,30 +28,33 @@ import org.eclipse.ui.IWorkbenchPart;
public class CleanAndBuildAction implements IObjectActionDelegate {
private ArrayList<IProject> projects = null;
+ @Override
public void run(IAction action) {
if (projects!=null) {
CleanAndBuildDialog dialog = new CleanAndBuildDialog(projects.toArray(new IProject[projects.size()]));
dialog.open();
}
}
-
+
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
projects = getSelectedCdtProjects(selection);
action.setEnabled(projects.size() > 0);
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/**
* @return list of CDT projects from the selection.
- *
+ *
* @param selection - selected items.
*/
public static ArrayList<IProject> getSelectedCdtProjects(ISelection selection) {
ArrayList<IProject> projects = new ArrayList<IProject>();
-
+
if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
Object[] selected = ((IStructuredSelection)selection).toArray();
if (selected.length > 0) {
@@ -61,7 +64,7 @@ public class CleanAndBuildAction implements IObjectActionDelegate {
prj = (IProject)sel;
else if (sel instanceof ICProject)
prj = ((ICProject)sel).getProject();
-
+
if (prj != null && CoreModel.getDefault().isNewStyleProject(prj)) {
projects.add(prj);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildDialog.java
index f43357e872..26d2de9de1 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildDialog.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanAndBuildDialog.java
@@ -68,32 +68,38 @@ public class CleanAndBuildDialog extends MessageDialog {
private int cleanKind;
private int buildKind;
-
+
private class ConfigurationLabelProvider implements ILabelProvider {
WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
+ @Override
public void addListener(ILabelProviderListener listener) {
workbenchLabelProvider.addListener(listener);
}
+ @Override
public void dispose() {
workbenchLabelProvider.dispose();
}
+ @Override
public boolean isLabelProperty(Object element, String property) {
return workbenchLabelProvider.isLabelProperty(element, property);
}
+ @Override
public void removeListener(ILabelProviderListener listener) {
workbenchLabelProvider.removeListener(listener);
}
+ @Override
public Image getImage(Object element) {
if (element instanceof ICConfigurationDescription)
return ManagedBuilderUIImages.get(ManagedBuilderUIImages.IMG_BUILD_CONFIG);
return workbenchLabelProvider.getImage(element);
}
+ @Override
public String getText(Object element) {
if (element instanceof ICConfigurationDescription) {
ICConfigurationDescription cfgDescription = (ICConfigurationDescription) element;
@@ -112,18 +118,21 @@ public class CleanAndBuildDialog extends MessageDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
@@ -131,6 +140,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
if (element instanceof IProject[])
return ((IProject[]) element).length > 0;
@@ -150,6 +160,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
if (element instanceof IProject) {
return projects;
@@ -164,6 +175,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof IProject[])
return (IProject[]) parentElement;
@@ -182,7 +194,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/**
* Creates a new Clean and Build dialog.
- *
+ *
* @param projects - the currently selected projects
*/
public CleanAndBuildDialog(IProject[] projects) {
@@ -195,7 +207,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
*/
@Override
@@ -204,10 +216,10 @@ public class CleanAndBuildDialog extends MessageDialog {
if (buttonId != IDialogConstants.OK_ID) {
return;
}
-
+
// save all dirty editors
BuildUtilities.saveEditors(null);
-
+
if (selected!=null) {
List<ICConfigurationDescription> cfgDescriptions = new ArrayList<ICConfigurationDescription>();
for (Object sel : selected) {
@@ -215,7 +227,7 @@ public class CleanAndBuildDialog extends MessageDialog {
cfgDescriptions.add((ICConfigurationDescription)sel);
}
}
-
+
if (cleanKind!=0 || buildKind!=0) {
ICConfigurationDescription[] cfgdArray = cfgDescriptions.toArray(new ICConfigurationDescription[cfgDescriptions.size()]);
Job buildJob = new BuildConfigurationsJob(cfgdArray, cleanKind, buildKind);
@@ -226,7 +238,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
*/
@Override
@@ -276,7 +288,7 @@ public class CleanAndBuildDialog extends MessageDialog {
data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
data.heightHint = IDialogConstants.ENTRY_FIELD_WIDTH;
cfgCheckboxViewer.getControl().setLayoutData(data);
-
+
ArrayList<ICConfigurationDescription> initialSelection = new ArrayList<ICConfigurationDescription>(projects.length);
for (IProject prj : projects) {
ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(prj, false);
@@ -287,6 +299,7 @@ public class CleanAndBuildDialog extends MessageDialog {
}
cfgCheckboxViewer.expandAll();
cfgCheckboxViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
updateEnablement();
selected = cfgCheckboxViewer.getCheckedElements();
@@ -308,7 +321,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.window.Window#close()
*/
@Override
@@ -319,7 +332,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.window.Window#getInitialLocation(org.eclipse.swt.graphics.Point)
*/
@Override
@@ -330,7 +343,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.window.Window#getInitialSize()
*/
@Override
@@ -343,7 +356,7 @@ public class CleanAndBuildDialog extends MessageDialog {
* Returns the initial location which is persisted in the IDE Plugin dialog settings under the provided
* dialog settings section name. If location is not persisted in the settings, the {@code null} is
* returned.
- *
+ *
* @param dialogSettingsSectionName - The name of the dialog settings section
* @return The initial location or {@code null}
*/
@@ -370,7 +383,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/**
* Persists the location and dimensions of the shell and other user settings in the plugin's dialog
* settings under the provided dialog settings section name
- *
+ *
* @param shell - The shell whose geometry is to be stored
* @param dialogSettingsSectionName - The name of the dialog settings section
*/
@@ -388,7 +401,7 @@ public class CleanAndBuildDialog extends MessageDialog {
* Returns the initial size which is the larger of the <code>initialSize</code> or the size persisted in
* the IDE UI Plugin dialog settings under the provided dialog setttings section name. If no size is
* persisted in the settings, the {@code initialSize} is returned.
- *
+ *
* @param initialSize - The initialSize to compare against
* @param dialogSettingsSectionName - The name of the dialog settings section
* @return the initial size
@@ -407,7 +420,7 @@ public class CleanAndBuildDialog extends MessageDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.dialogs.Dialog#isResizable()
*/
@Override
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java
index 281951adf0..49e3f420d5 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java
@@ -53,7 +53,7 @@ public class CleanFilesAction extends ActionDelegate implements
private IAction action = null;
/**
- *
+ *
*/
public CleanFilesAction() {
this(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
@@ -71,7 +71,7 @@ public class CleanFilesAction extends ActionDelegate implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
@Override
@@ -91,9 +91,10 @@ public class CleanFilesAction extends ActionDelegate implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {
workbenchWindow = window;
@@ -104,7 +105,7 @@ public class CleanFilesAction extends ActionDelegate implements
* interface. The conversion is a bare cast operation (if the object is
* instance of <code>IFile</code>, or an adaptation (if the object is
* instance of <code>IAdaptable</code>).
- *
+ *
* @param object
* the object to be cast to <code>IFile</code>
* @return a reference to an IFile corresponding to the object provided, or
@@ -145,7 +146,7 @@ public class CleanFilesAction extends ActionDelegate implements
/**
* Returns a list of buildable resources currently selected.
* "Buildable" means buildable by MBS.
- *
+ *
* @return a list of resources
*/
private List<IFile> getSelectedBuildableFiles() {
@@ -192,7 +193,7 @@ public class CleanFilesAction extends ActionDelegate implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
@@ -252,7 +253,7 @@ public class CleanFilesAction extends ActionDelegate implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
@@ -268,19 +269,19 @@ public class CleanFilesAction extends ActionDelegate implements
}
private boolean shouldBeEnabled() {
-
-
+
+
// fix for Bugzilla 139663
// if build automatically is turned on, then this menu should be turned off as
// it will trigger the auto build
Preferences preferences = ResourcesPlugin.getPlugin().getPluginPreferences();
-
+
if(preferences.getBoolean(ResourcesPlugin.PREF_AUTO_BUILDING))
{
// auto building is on... do not enable the menu
return false;
}
-
+
ISelectionService selectionService = workbenchWindow
.getSelectionService();
ISelection selection = selectionService.getSelection();
@@ -338,7 +339,7 @@ public class CleanFilesAction extends ActionDelegate implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
* org.eclipse.jface.viewers.ISelection)
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetAction.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetAction.java
index 830ad21401..fbc2ef7708 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetAction.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetAction.java
@@ -14,9 +14,9 @@ import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
import org.eclipse.cdt.managedbuilder.core.IProjectType;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
import org.eclipse.cdt.ui.CUIPlugin;
-import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -33,21 +33,21 @@ public class ConvertTargetAction
implements IObjectActionDelegate {
private IProject selectedProject = null;
-
+
public static final String PREFIX = "ProjectConvert"; //$NON-NLS-1$
public static final String PROJECT_CONVERTER_DIALOG = PREFIX + ".title"; //$NON-NLS-1$
-
+
public static void initStartup() {
return;
}
-
+
@Override
public void selectionChanged(IAction action, ISelection selection) {
if (selection instanceof IStructuredSelection) {
IStructuredSelection sel = (IStructuredSelection) selection;
Object obj = sel.getFirstElement();
if (obj instanceof IProject) {
- IProject project = (IProject)obj;
+ IProject project = (IProject)obj;
// Save the selected project.
setSelectedProject(project);
return;
@@ -68,15 +68,15 @@ public class ConvertTargetAction
}
return projectType;
}
-
+
@Override
public void run(IAction action) {
Shell shell = CUIPlugin.getActiveWorkbenchShell();
-
+
// Check whether the converters available for the selected project
// If there are no converters display error dialog otherwise display converters list
-
+
if( ManagedBuildManager.hasTargetConversionElements(getProjectType(getSelectedProject())) == true ) {
handleConvertTargetAction();
} else {
@@ -87,9 +87,9 @@ public class ConvertTargetAction
private void handleConvertTargetAction() {
Shell shell = ManagedBuilderUIPlugin.getDefault().getShell();
-
+
String projectName = getSelectedProject().getName();
- String title = NLS.bind(Messages.ProjectConvert_title, new String(projectName));
+ String title = NLS.bind(Messages.ProjectConvert_title, new String(projectName));
ConvertTargetDialog dialog = new ConvertTargetDialog(shell, getSelectedProject(), title);
if ( dialog.open() == ConvertTargetDialog.OK ) {
if ( ConvertTargetDialog.isConversionSuccessful() == false) {
@@ -99,9 +99,10 @@ public class ConvertTargetAction
}
return;
}
-
+
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // TODO Auto-generated method stub
+ // TODO Auto-generated method stub
}
/**
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetDialog.java
index 1c3dbd8f99..dbc97ae271 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetDialog.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/ConvertTargetDialog.java
@@ -46,30 +46,30 @@ public class ConvertTargetDialog extends Dialog {
private Map<String, IConfigurationElement> conversionElements;
private IConfigurationElement selectedConversionElement;
private static boolean isConversionSuccessful = false;
-
+
public static final String PREFIX = "ProjectConvert"; //$NON-NLS-1$
public static final String CONVERTERS_LIST = PREFIX +".convertersList"; //$NON-NLS-1$
-
-
+
+
/**
* @param parentShell
- * @param project
+ * @param project
* @param title The title of the dialog
*/
protected ConvertTargetDialog(Shell parentShell, IProject project, String title) {
super(parentShell);
this.title = title;
setProject(project);
-
+
conversionElements = ManagedBuildManager.getConversionElements(getProjectType());
-
- setShellStyle(getShellStyle()|SWT.RESIZE);
+
+ setShellStyle(getShellStyle()|SWT.RESIZE);
}
-
+
@Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
-
+
handleConverterSelection();
IConvertManagedBuildObject convertBuildObject = null;
try {
@@ -84,7 +84,7 @@ public class ConvertTargetDialog extends Dialog {
"fromId"); //$NON-NLS-1$
String toId = getSelectedConversionElement().getAttribute(
"toId"); //$NON-NLS-1$
-
+
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject());
if (info != null) {
IManagedProject managedProject = info.getManagedProject();
@@ -100,15 +100,15 @@ public class ConvertTargetDialog extends Dialog {
}
} else {
setConversionSuccessful(false);
- }
+ }
} else {
setConversionSuccessful(false);
}
- }
+ }
super.buttonPressed(buttonId);
}
-
+
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
@@ -118,45 +118,47 @@ public class ConvertTargetDialog extends Dialog {
@Override
protected Control createDialogArea(Composite parent) {
-
+
Composite comp = new Composite(parent, SWT.NULL);
comp.setFont(parent.getFont());
comp.setLayout(new GridLayout(1, true));
comp.setLayoutData(new GridData(GridData.FILL_BOTH));
-
+
// Create the converters list group area
final Group convertersListGroup = new Group(comp, SWT.NONE);
convertersListGroup.setFont(parent.getFont());
convertersListGroup.setText(Messages.ProjectConvert_convertersList);
convertersListGroup.setLayout(new GridLayout(1, false));
convertersListGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-
+
// Create the current config List
convertersList = new List(convertersListGroup, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER);
convertersList.setFont(convertersListGroup.getFont());
GridData data = new GridData(GridData.FILL_BOTH);
convertersList.setLayoutData(data);
convertersList.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent event) {
convertersList = null;
}
});
convertersList.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent(Event e) {
validateState();
- }
+ }
});
Object [] objs = getConversionElements().keySet().toArray();
String [] names = new String[objs.length];
for (int i = 0; i < objs.length; i++) {
Object object = objs[i];
- names[i] = (String)object;
+ names[i] = (String)object;
}
convertersList.setItems(names);
validateState();
return comp;
}
-
+
private void handleConverterSelection() {
// Determine which configuration was selected
int selectionIndex = convertersList.getSelectionIndex();
@@ -168,16 +170,16 @@ public class ConvertTargetDialog extends Dialog {
setSelectedConversionElement(selectedElement);
return;
}
-
+
private void validateState() {
Button b = getButton(IDialogConstants.OK_ID);
if (b != null)
- b.setEnabled(convertersList.getSelectionIndex() != -1);
+ b.setEnabled(convertersList.getSelectionIndex() != -1);
}
-
+
private Map<String, IConfigurationElement> getConversionElements() {
if (conversionElements == null) {
- conversionElements = new HashMap<String, IConfigurationElement>();
+ conversionElements = new HashMap<String, IConfigurationElement>();
}
return conversionElements;
}
@@ -195,7 +197,7 @@ public class ConvertTargetDialog extends Dialog {
}
return projectType;
}
-
+
public IProject getProject() {
return project;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ArtifactTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ArtifactTab.java
index 10abd67ad2..c63ade46bf 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ArtifactTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ArtifactTab.java
@@ -48,13 +48,13 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
private Combo t2, t3, t4;
private Combo c1;
private int savedPos = -1; // current project type
- private IConfiguration fCfg;
+ private IConfiguration fCfg;
private IBuildPropertyValue[] values;
private ITool tTool;
private boolean canModify = true;
-
+
private enum FIELD {NAME, EXT, PREF}
-
+
private Set<String> set2 = new TreeSet<String>();
private Set<String> set3 = new TreeSet<String>();
private Set<String> set4 = new TreeSet<String>();
@@ -66,7 +66,7 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
Label l1 = new Label(usercomp, SWT.NONE);
l1.setLayoutData(new GridData(GridData.BEGINNING));
- l1.setText(Messages.ArtifactTab_0);
+ l1.setText(Messages.ArtifactTab_0);
c1 = new Combo(usercomp, SWT.READ_ONLY | SWT.DROP_DOWN | SWT.BORDER);
c1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
c1.addSelectionListener(new SelectionAdapter() {
@@ -75,32 +75,35 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
typeChanged();
}});
c1.setOrientation(SWT.LEFT_TO_RIGHT);
-
+
Label l2 = new Label(usercomp, SWT.NONE);
l2.setLayoutData(new GridData(GridData.BEGINNING));
- l2.setText(Messages.ArtifactTab_1);
+ l2.setText(Messages.ArtifactTab_1);
t2 = setCombo(FIELD.NAME, set2);
t2.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (canModify)
fCfg.setArtifactName(t2.getText());
}} );
-
+
Label l3 = new Label(usercomp, SWT.NONE);
l3.setLayoutData(new GridData(GridData.BEGINNING));
- l3.setText(Messages.ArtifactTab_2);
+ l3.setText(Messages.ArtifactTab_2);
t3 = setCombo(FIELD.EXT, set3);
t3.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (canModify)
fCfg.setArtifactExtension(t3.getText());
}} );
-
+
l4 = new Label(usercomp, SWT.NONE);
l4.setLayoutData(new GridData(GridData.BEGINNING));
- l4.setText(Messages.ArtifactTab_3);
+ l4.setText(Messages.ArtifactTab_3);
t4 = setCombo(FIELD.PREF, set4);
t4.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (canModify) {
if(tTool != null)
@@ -130,7 +133,7 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
ManagedBuilderUIPlugin.log(ex);
}
}
-
+
@Override
public void updateData(ICResourceDescription cfgd) {
if (cfgd == null) return;
@@ -157,24 +160,24 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
}
}
}
-
+
updateCombo(t2);
updateCombo(t3);
updateCombo(t4);
-
+
String s = fCfg.getArtifactName();
if (! page.isMultiCfg() && (s == null || s.trim().length() == 0)) {
s = getResDesc().getConfiguration().getProjectDescription().getName();
getCfg().setArtifactName(s);
}
-
+
canModify = false;
-
+
t2.setText(s);
t3.setText(fCfg.getArtifactExtension());
-
+
if (page.isMultiCfg()) {
- if (l4 != null)
+ if (l4 != null)
l4.setVisible(true);
if (t4 != null) {
t4.setVisible(true);
@@ -183,34 +186,34 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
} else {
tTool = fCfg.calculateTargetTool();
if(tTool != null){
- if (l4 != null)
+ if (l4 != null)
l4.setVisible(true);
if (t4 != null) {
t4.setVisible(true);
t4.setText(tTool.getOutputPrefix());
}
} else {
- if (l4 != null)
+ if (l4 != null)
l4.setVisible(false);
- if (t4 != null)
+ if (t4 != null)
t4.setVisible(false);
}
}
canModify = true;
}
-
+
@Override
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
IConfiguration cfg1 = getCfg(src.getConfiguration());
IConfiguration cfg2 = getCfg(dst.getConfiguration());
cfg2.setArtifactName(cfg1.getArtifactName());
cfg2.setArtifactExtension(cfg1.getArtifactExtension());
-
+
ITool t1 = cfg1.calculateTargetTool();
ITool t2 = cfg2.calculateTargetTool();
- if (t1 != null && t2 != null)
+ if (t1 != null && t2 != null)
t2.setOutputPrefixForPrimaryOutput(t1.getOutputPrefix());
-
+
try {
IBuildPropertyValue bv = cfg1.getBuildArtefactType();
if (bv != null)
@@ -219,13 +222,13 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
ManagedBuilderUIPlugin.log(e);
}
}
-
+
@Override
protected void performDefaults() {
fCfg.setArtifactName(fCfg.getManagedProject().getDefaultArtifactName());
fCfg.setArtifactExtension(null);
// workaround for bad extension setting (always "exe"):
- // set wrong project type temporary
+ // set wrong project type temporary
// and then set right one back
if (c1.getItemCount() > 1) {
int right = c1.getSelectionIndex();
@@ -259,7 +262,7 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
}
@Override
protected void updateButtons() {} // Do nothing. No buttons to update.
-
+
private Combo setCombo(FIELD field, Set<String> set) {
Combo combo = new Combo(usercomp, SWT.BORDER);
combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -268,14 +271,14 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
updateCombo(combo);
return combo;
}
-
+
@SuppressWarnings("unchecked")
private void updateCombo(Combo combo) {
FIELD field = (FIELD)combo.getData(ENUM);
Set<String> set = (Set<String>)combo.getData(SSET);
if (field == null || set == null)
return;
-
+
canModify = false;
String oldStr = combo.getText();
combo.removeAll();
@@ -284,7 +287,7 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
String s = null;
switch (field) {
case NAME:
- s = c.getArtifactName();
+ s = c.getArtifactName();
break;
case EXT:
s = c.getArtifactExtension();
@@ -297,7 +300,7 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
if (s != null && s.trim().length() > 0)
set.add(s.trim());
}
- if (set.size() > 0)
+ if (set.size() > 0)
combo.setItems(set.toArray(new String[set.size()]));
combo.setText(oldStr);
canModify = true;
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java
index 87ce6f2c98..b940a747ef 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsUI.java
@@ -70,7 +70,7 @@ import org.osgi.framework.Bundle;
* Option settings page in project properties Build Settings under Tool Settings tab.
*/
public class BuildOptionSettingsUI extends AbstractToolSettingUI {
- private Map<String, FieldEditor> fieldsMap =
+ private Map<String, FieldEditor> fieldsMap =
new HashMap<String, FieldEditor>();
private IOptionCategory category;
private IHoldsOptions optionHolder;
@@ -79,10 +79,10 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
/** The index of the current IHoldsOptions in ohs */
private int curr = -1;
private Map<String, CustomFieldEditorDescriptor> customFieldEditorDescriptorIndex;
- private Map<FieldEditor, Composite> fieldEditorsToParentMap =
+ private Map<FieldEditor, Composite> fieldEditorsToParentMap =
new HashMap<FieldEditor, Composite>();
/** True if the user selected "Display tool option tips at a fixed location" in Preferences */
- private boolean displayFixedTip;
+ private boolean displayFixedTip;
/** type of mouse action the displayFixedTip responds to.
** currently set to Enter rather than Hover since the former seems more responsive **/
private final static int selectAction = SWT.MouseEnter;
@@ -90,7 +90,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
private class TipInfo {
private String name;
private String tip;
-
+
public TipInfo(String name, String tip) {
this.name = name;
this.tip = tip;
@@ -102,10 +102,10 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
return tip;
}
}
-
+
public BuildOptionSettingsUI(AbstractCBuildPropertyTab page,
- IResourceInfo info, IHoldsOptions optionHolder,
+ IResourceInfo info, IHoldsOptions optionHolder,
IOptionCategory _category) {
this(page, info, optionHolder, _category, false);
}
@@ -118,11 +118,11 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
* @param displayFixedTip - {@code true} if tooltips for the option are
* displayed at fixed area on the bottom of the dialog or
* {@code false} as a regular tooltip hover
- *
+ *
* @since 7.0
*/
public BuildOptionSettingsUI(AbstractCBuildPropertyTab page,
- IResourceInfo info, IHoldsOptions optionHolder,
+ IResourceInfo info, IHoldsOptions optionHolder,
IOptionCategory cat, boolean displayFixedTip) {
super(info);
this.category = cat;
@@ -130,7 +130,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
this.optionHolder = optionHolder;
buildPropPage = page;
if (info instanceof MultiItemsHolder) {
- MultiResourceInfo mri = (MultiResourceInfo)info;
+ MultiResourceInfo mri = (MultiResourceInfo)info;
IResourceInfo[] ris = (IResourceInfo[])mri.getItems();
String id = category.getId();
@@ -175,7 +175,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
curr = 0;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#computeSize()
*/
@@ -189,37 +189,37 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
*/
@Override
protected void createFieldEditors() {
- // true if the user selected "Display tool option tips at a fixed location" in Preferences AND
+ // true if the user selected "Display tool option tips at a fixed location" in Preferences AND
// and we are displaying the tool tip box on this page because one or more option has non-empty tool tip.
boolean pageHasToolTipBox = isToolTipBoxNeeded();
-
+
// Get the preference store for the build settings
super.createFieldEditors();
// Iterate over the options in the category and create a field editor
// for each
Object[][] options = category.getOptions(fInfo, optionHolder);
-
+
for (int index = 0; index < options.length; ++index) {
// Get the option
IHoldsOptions holder = (IHoldsOptions)options[index][0];
if (holder == null) break; // The array may not be full
IOption opt = (IOption)options[index][1];
-
+
// check to see if the option has an applicability calculator
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
IBuildObject config = fInfo;
if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt)) {
-
+
String optId = getToolSettingsPrefStore().getOptionId(opt);
String nameStr = TextProcessor.process(opt.getName());
String tipStr = TextProcessor.process(opt.getToolTip());
String contextId = opt.getContextId();
-
+
if (pageHasToolTipBox && (tipStr==null || tipStr.trim().length()==0)) {
- tipStr = Messages.BuildOptionSettingsUI_0;
+ tipStr = Messages.BuildOptionSettingsUI_0;
}
-
+
try {
// Figure out which type the option is and add a proper field
// editor for it
@@ -250,12 +250,12 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
}
}
}
-
+
if(fieldEditor == null) {
switch (opt.getValueType()) {
case IOption.STRING: {
StringFieldEditor stringField;
-
+
// If browsing is set, use a field editor that has a
// browse button of the appropriate type.
switch (opt.getBrowseType()) {
@@ -271,7 +271,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
}
}
} break;
-
+
case IOption.BROWSE_FILE: {
stringField = new FileFieldEditor(optId, nameStr, fieldEditorParent) {
/**
@@ -295,17 +295,18 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
}
((FileFieldEditor)stringField).setFileExtensions(opt.getBrowseFilterExtensions());
} break;
-
+
case IOption.BROWSE_NONE: {
final StringFieldEditorM local = new StringFieldEditorM(optId, nameStr, fieldEditorParent);
stringField = local;
local.getTextControl().addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
+ @Override
+ public void modifyText(ModifyEvent e) {
local.valueChanged();
}
});
} break;
-
+
default: {
throw new BuildException(null);
}
@@ -319,26 +320,26 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
text.addListener(selectAction, tipSetListener);
} else {
label.setToolTipText(tipStr);
- text.setToolTipText(tipStr);
+ text.setToolTipText(tipStr);
}
- if (!contextId.equals(AbstractPage.EMPTY_STR)) {
+ if (!contextId.equals(AbstractPage.EMPTY_STR)) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(text, contextId);
}
fieldEditor = stringField;
} break;
-
+
case IOption.BOOLEAN: {
fieldEditor = new TriStateBooleanFieldEditor(
- optId,
- nameStr,
+ optId,
+ nameStr,
tipStr,
- fieldEditorParent,
- contextId,
+ fieldEditorParent,
+ contextId,
ohs,
curr);
// tipStr is handled in TriStateBooleanFieldEditor constructor
} break;
-
+
case IOption.ENUMERATED: {
String selId = opt.getSelectedEnum();
String sel = opt.getEnumName(selId);
@@ -350,19 +351,19 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
String[] enumNames = opt.getApplicableValues();
Vector<String> enumValidList = new Vector<String>();
for (int i = 0; i < enumNames.length; ++i) {
- if (opt.getValueHandler().isEnumValueAppropriate(config,
+ if (opt.getValueHandler().isEnumValueAppropriate(config,
opt.getOptionHolder(), opt, opt.getValueHandlerExtraArgument(), enumNames[i])) {
enumValidList.add(enumNames[i]);
}
}
String[] enumValidNames = new String[enumValidList.size()];
enumValidList.copyInto(enumValidNames);
-
+
// if (displayFixedTip==false), tooltip was already set in BuildOptionComboFieldEditor constructor.
String tooltipHoverStr = displayFixedTip ? null : tipStr;
- fieldEditor = new BuildOptionComboFieldEditor(optId, nameStr,
+ fieldEditor = new BuildOptionComboFieldEditor(optId, nameStr,
tooltipHoverStr, contextId, enumValidNames, sel, fieldEditorParent);
-
+
if (pageHasToolTipBox) {
Combo combo = ((BuildOptionComboFieldEditor)fieldEditor).getComboControl();
Label label = fieldEditor.getLabelControl(fieldEditorParent);
@@ -372,7 +373,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
label.addListener(selectAction, tipSetListener);
}
} break;
-
+
case IOption.INCLUDE_PATH:
case IOption.STRING_LIST:
case IOption.PREPROCESSOR_SYMBOLS:
@@ -387,11 +388,11 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
case IOption.UNDEF_INCLUDE_FILES:
case IOption.UNDEF_LIBRARY_PATHS:
case IOption.UNDEF_LIBRARY_FILES:
- case IOption.UNDEF_MACRO_FILES:
+ case IOption.UNDEF_MACRO_FILES:
{
// if (displayFixedTip==false), tooltip was already set in FileListControlFieldEditor constructor.
String tooltipHoverStr = displayFixedTip ? null : tipStr;
- fieldEditor = new FileListControlFieldEditor(optId, nameStr,
+ fieldEditor = new FileListControlFieldEditor(optId, nameStr,
tooltipHoverStr, contextId, fieldEditorParent, opt.getBrowseType());
if(opt.getBrowseFilterPath() != null) {
try {
@@ -407,15 +408,15 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
if (pageHasToolTipBox) {
Label label = fieldEditor.getLabelControl(fieldEditorParent);
label.setData(new TipInfo(nameStr,tipStr));
- label.addListener(selectAction, tipSetListener);
+ label.addListener(selectAction, tipSetListener);
}
} break;
-
+
default:
throw new BuildException(null);
}
}
-
+
setFieldEditorEnablement(holder, opt, applicabilityCalculator, fieldEditor, fieldEditorParent);
addField(fieldEditor);
@@ -427,37 +428,37 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
}
}
}
-
+
/**
- * Instantiates the custom-field editor registered under the given id.
+ * Instantiates the custom-field editor registered under the given id.
*/
private FieldEditor createCustomFieldEditor(String customFieldEditorId) {
if(this.customFieldEditorDescriptorIndex == null) {
loadCustomFieldEditorDescriptors();
}
-
+
CustomFieldEditorDescriptor editorDescriptor = this.customFieldEditorDescriptorIndex.get(customFieldEditorId);
if(editorDescriptor != null) {
return editorDescriptor.createEditor();
}
-
+
return null;
}
-
+
/**
- * Holds all the information necessary to instantiate a custom field-editor.
+ * Holds all the information necessary to instantiate a custom field-editor.
* Also acts as a factory - instantiates and returns a non-initialized field-editor.
*/
private class CustomFieldEditorDescriptor
{
private final String editorClassName;
private final String bundleName;
-
+
CustomFieldEditorDescriptor(String editorClassName, String bundleName) {
this.editorClassName = editorClassName;
this.bundleName = bundleName;
}
-
+
FieldEditor createEditor() {
try {
Bundle bundle = Platform.getBundle(this.bundleName);
@@ -474,11 +475,11 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
catch(Exception x) {
ManagedBuilderUIPlugin.log(x);
}
-
+
return null;
}
}
-
+
/**
* Loads all the registered custom field-editor descriptors.
* Synchronization is not necessary as this would always be invoked on the UI thread.
@@ -486,28 +487,28 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
private void loadCustomFieldEditorDescriptors() {
if(this.customFieldEditorDescriptorIndex != null)
return;
-
+
this.customFieldEditorDescriptorIndex = new HashMap<String, CustomFieldEditorDescriptor>();
-
+
IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(
ManagedBuilderUIPlugin.getUniqueIdentifier() + ".buildDefinitionsUI"); //$NON-NLS-1$
-
+
for(IExtension e : ep.getExtensions()) {
for(IConfigurationElement providerElement : e.getConfigurationElements()) {
String editorId = providerElement.getAttribute("id"); //$NON-NLS-1$
String editorClassName = providerElement.getAttribute("class"); //$NON-NLS-1$
String bundleName = providerElement.getContributor().getName();
-
+
this.customFieldEditorDescriptorIndex.put(editorId, new CustomFieldEditorDescriptor(editorClassName, bundleName));
}
}
}
-
+
/**
* Answers <code>true</code> if the settings page has been created for the
* option category specified in the argument.
- *
+ *
* @see org.eclipse.cdt.managedbuilder.ui.properties.AbstractToolSettingUI#isFor(java.lang.Object, java.lang.Object)
*/
@Override
@@ -518,7 +519,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
}
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
@@ -527,22 +528,22 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
// Write the field editor contents out to the preference store
boolean ok = super.performOk();
// Write the preference store values back to the build model
-
+
Object[][] clonedOptions;
// IResourceConfiguration realRcCfg = null;
IConfiguration realCfg = null;
IBuildObject handler = null;
-
+
realCfg = buildPropPage.getCfg(); //.getRealConfig(clonedConfig);
if(realCfg == null) return false;
handler = realCfg;
clonedOptions = category.getOptions(fInfo, optionHolder);
-
+
for (int i = 0; i < clonedOptions.length; i++) {
IHoldsOptions clonedHolder = (IHoldsOptions)clonedOptions[i][0];
if (clonedHolder == null) break; // The array may not be full
IOption clonedOption = (IOption)clonedOptions[i][1];
-
+
IHoldsOptions realHolder = clonedHolder; // buildPropPage.getRealHoldsOptions(clonedHolder);
IOption realOption = clonedOption; // buildPropPage.getRealOption(clonedOption, clonedHolder);
if(realOption == null) continue;
@@ -564,7 +565,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
case IOption.ENUMERATED :
String enumVal = clonedOption.getStringValue();
String enumId = clonedOption.getEnumeratedId(enumVal);
- setOption = ManagedBuildManager.setOption(realCfg, realHolder, realOption,
+ setOption = ManagedBuildManager.setOption(realCfg, realHolder, realOption,
(enumId != null && enumId.length() > 0) ? enumId : enumVal);
// Reset the preference store since the Id may have changed
// if (setOption != option) {
@@ -575,7 +576,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
break;
case IOption.STRING :
String strVal = clonedOption.getStringValue();
- setOption = ManagedBuildManager.setOption(realCfg, realHolder, realOption, strVal);
+ setOption = ManagedBuildManager.setOption(realCfg, realHolder, realOption, strVal);
// Reset the preference store since the Id may have changed
// if (setOption != option) {
// getToolSettingsPrefStore().setValue(setOption.getId(), strVal);
@@ -597,11 +598,11 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
case IOption.UNDEF_INCLUDE_FILES:
case IOption.UNDEF_LIBRARY_PATHS:
case IOption.UNDEF_LIBRARY_FILES:
- case IOption.UNDEF_MACRO_FILES:
+ case IOption.UNDEF_MACRO_FILES:
@SuppressWarnings("unchecked")
String[] listVal = ((List<String>)clonedOption.getValue()).toArray(new String[0]);
- setOption = ManagedBuildManager.setOption(realCfg, realHolder, realOption, listVal);
-
+ setOption = ManagedBuildManager.setOption(realCfg, realHolder, realOption, listVal);
+
// Reset the preference store since the Id may have changed
// if (setOption != option) {
// getToolSettingsPrefStore().setValue(setOption.getId(), listStr);
@@ -613,32 +614,32 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
break;
}
- // Call an MBS CallBack function to inform that Settings related to Apply/OK button
+ // Call an MBS CallBack function to inform that Settings related to Apply/OK button
// press have been applied.
if (setOption == null)
setOption = realOption;
-
+
if (setOption.getValueHandler().handleValue(
- handler,
- setOption.getOptionHolder(),
+ handler,
+ setOption.getOptionHolder(),
setOption,
- setOption.getValueHandlerExtraArgument(),
+ setOption.getValueHandlerExtraArgument(),
IManagedOptionValueHandler.EVENT_APPLY)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say log a message.
} else {
- // Event handling Failed.
+ // Event handling Failed.
}
-
+
} catch (BuildException e) {
} catch (ClassCastException e) {
}
-
+
}
return ok;
}
-
+
/**
* Update field editors in this page when the page is loaded.
*/
@@ -653,7 +654,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
if (holder == null)
break; // The array may not be full
IOption opt = (IOption) options[index][1];
- String prefName = getToolSettingsPrefStore().getOptionId(opt);
+ String prefName = getToolSettingsPrefStore().getOptionId(opt);
// is the option on this page?
if (fieldsMap.containsKey(prefName)) {
@@ -663,7 +664,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
updateEnumList( fieldEditor, opt, holder, fInfo );
}
} catch ( BuildException be ) {}
-
+
// check to see if the option has an applicability calculator
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
if (applicabilityCalculator != null) {
@@ -672,7 +673,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
}
}
}
-
+
Collection<FieldEditor> fieldsList = fieldsMap.values();
for (FieldEditor editor : fieldsList) {
if (editor instanceof TriStateBooleanFieldEditor)
@@ -680,7 +681,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
editor.load();
}
}
-
+
private void setFieldEditorEnablement(IHoldsOptions holder, IOption option,
IOptionApplicability optionApplicability, FieldEditor fieldEditor, Composite parent) {
if (optionApplicability == null)
@@ -694,7 +695,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
fieldEditor.setEnabled(true, parent);
}
}
-
+
private boolean hasStr(String tipStr) {
return (tipStr!=null && tipStr.trim().length()>0);
}
@@ -706,7 +707,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
public void propertyChange(PropertyChangeEvent event) {
// allow superclass to handle as well
super.propertyChange(event);
-
+
Object source = event.getSource();
IOption changedOption = null;
IHoldsOptions changedHolder = null;
@@ -714,10 +715,10 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
if(source instanceof FieldEditor){
FieldEditor fe = (FieldEditor)source;
-
+
if (fe instanceof TriStateBooleanFieldEditor)
((TriStateBooleanFieldEditor)fe).set3(false);
-
+
id = fe.getPreferenceName();
Object[] option = this.getToolSettingsPrefStore().getOption(id);
@@ -725,11 +726,11 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
if (option == null) {
int n = id.lastIndexOf('.');
if (n > 0) {
- id = id.substring(0, n);
+ id = id.substring(0, n);
option = getToolSettingsPrefStore().getOption(id);
}
}
-
+
if(option != null){
changedOption = (IOption)option[1];
changedHolder = (IHoldsOptions)option[0];
@@ -753,7 +754,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
String enumId = changedOption.getEnumeratedId(name);
ManagedBuildManager.setOption(fInfo,changedHolder,changedOption,
(enumId != null && enumId.length() > 0) ? enumId : name);
-
+
}
break;
case IOption.INCLUDE_PATH:
@@ -793,7 +794,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
if (holder == null)
break; // The array may not be full
IOption opt = (IOption) options[index][1];
- String optId = getToolSettingsPrefStore().getOptionId(opt);
+ String optId = getToolSettingsPrefStore().getOptionId(opt);
// is the option on this page?
if (fieldsMap.containsKey(optId)) {
@@ -807,32 +808,32 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
updateEnumList( fieldEditor, opt, holder, fInfo );
}
} catch ( BuildException be ) {}
-
+
if (applicabilityCalculator != null) {
Composite parent = fieldEditorsToParentMap.get(fieldEditor);
setFieldEditorEnablement(holder, opt, applicabilityCalculator, fieldEditor, parent);
}
}
}
-
+
Collection<FieldEditor> xxx = fieldsMap.values();
for (FieldEditor editor : xxx) {
if(id == null || !id.equals(editor.getPreferenceName()))
editor.load();
}
}
-
+
@Override
public void setValues() {
updateFields();
}
-
+
/**
* @param optionHolder - option holder such as {@link ITool}
* @param category - option category
- *
+ *
* @return true if the page needs to have the tool tip box.
- *
+ *
* @since 7.0
*/
protected boolean needToolTipBox(IHoldsOptions optionHolder, IOptionCategory category) {
@@ -843,7 +844,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
if (holder == null) break; // The array may not be full
IOption opt = (IOption)options[index][1];
String tipStr = TextProcessor.process(opt.getToolTip());
-
+
// check to see if the option has an applicability calculator
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
IBuildObject config = fInfo;
@@ -855,7 +856,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
}
}
}
- // A tool option summary page does not list individual options
+ // A tool option summary page does not list individual options
// so never should have the box
return false;
}
@@ -864,9 +865,9 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
* The items shown in an enumerated option may depend on other option values.
* Whenever an option changes, check and update the valid enum values in
* the combo fieldeditor.
- *
+ *
* See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=154053
- *
+ *
* @param fieldEditor enumerated combo fieldeditor
* @param opt enumerated option type to update
* @param holder the option holder
@@ -892,7 +893,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
Vector<String> enumValidList = new Vector<String>();
for (int i = 0; i < enumNames.length; ++i) {
- if (opt.getValueHandler().isEnumValueAppropriate(config,
+ if (opt.getValueHandler().isEnumValueAppropriate(config,
opt.getOptionHolder(), opt, opt.getValueHandlerExtraArgument(), enumNames[i])) {
if ( selectedEnumName.equals(enumNames[i]) ) {
// the currently selected enum is part of the new item list, no need to select a new value.
@@ -924,8 +925,9 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
((BuildOptionComboFieldEditor)fieldEditor).setOptions(enumValidNames);
fieldEditor.load();
}
-
+
private final Listener tipSetListener = new Listener() {
+ @Override
public void handleEvent(Event event) {
Object data = event.widget.getData();
if (data!=null && buildPropPage!=null) {
@@ -934,10 +936,10 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
}
}
};
-
+
/**
- *
- *
+ *
+ *
*
*/
class TriStateBooleanFieldEditor extends BooleanFieldEditor {
@@ -947,7 +949,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
protected int current = 0;
public TriStateBooleanFieldEditor(String name, String labelText, String tooltip, Composite parent, String contextId, IHoldsOptions[] ho, int curr) {
super(name, labelText, parent);
- holders = ho;
+ holders = ho;
current = curr;
button = getChangeControl(parent);
if (displayFixedTip && isToolTipBoxNeeded()) {
@@ -959,7 +961,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
if (!contextId.equals(AbstractPage.EMPTY_STR)) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(button, contextId);
}
-
+
}
@Override
protected void valueChanged(boolean oldValue, boolean newValue) {
@@ -978,7 +980,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
for (int i=0; i<holders.length; i++) {
op = holders[i].getOptionBySuperClassId(id);
try {
- if (op != null)
+ if (op != null)
vals[op.getBooleanValue() ? 1 : 0]++;
} catch (BuildException e) {}
}
@@ -996,11 +998,11 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
}
super.doLoad(); // default case
}
-
+
void set3(boolean state) {
enable3 = state;
}
}
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java
index 52fa64ca92..49668e95e8 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java
@@ -57,9 +57,9 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
private ICResourceDescription cfgdescr;
private IFileInfo rcfg;
private boolean canModify = true;
-
- private static final String label1 = Messages.BuildStepsTab_0;
- private static final String label2 = Messages.BuildStepsTab_1;
+
+ private static final String label1 = Messages.BuildStepsTab_0;
+ private static final String label2 = Messages.BuildStepsTab_1;
private static final String PATH_SEPERATOR = ";"; //$NON-NLS-1$
private static final String rcbsToolId = new String("org.eclipse.cdt.managedbuilder.ui.rcbs"); //$NON-NLS-1$
private static final String rcbsToolName = new String("Resource Custom Build Step"); //$NON-NLS-1$
@@ -67,42 +67,43 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
private static final String rcbsToolInputTypeName = new String("Resource Custom Build Step Input Type"); //$NON-NLS-1$
private static final String rcbsToolOutputTypeId = new String("org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype"); //$NON-NLS-1$
private static final String rcbsToolOutputTypeName = new String("Resource Custom Build Step Output Type"); //$NON-NLS-1$
-
+
private enum FIELD {PRECMD, PREANN, PSTCMD, PSTANN}
private Set<String> set1 = new TreeSet<String>();
private Set<String> set2 = new TreeSet<String>();
private Set<String> set3 = new TreeSet<String>();
private Set<String> set4 = new TreeSet<String>();
-
+
private static final String[] rcbsApplicabilityRules = {
new String(Messages.ResourceCustomBuildStepBlock_label_applicability_rule_override),
// new String(ManagedBuilderMessages_getResourceString("ResourceCustomBuildStepBlock_label_applicability_rule_before")),
// new String(ManagedBuilderMessages_getResourceString("ResourceCustomBuildStepBlock_label_applicability_rule_after")),
new String(Messages.ResourceCustomBuildStepBlock_label_applicability_rule_disable),
};
-
-
+
+
@Override
public void createControls(Composite parent) {
super.createControls(parent);
usercomp.setLayout(new GridLayout(1, false));
- if (page.isForProject())
+ if (page.isForProject())
createForProject();
else
createForFile();
}
/**
- *
+ *
*/
private void createForProject() {
- Group g1 = setupGroup (usercomp, Messages.BuildStepsTab_2, 1, GridData.FILL_HORIZONTAL);
+ Group g1 = setupGroup (usercomp, Messages.BuildStepsTab_2, 1, GridData.FILL_HORIZONTAL);
setupLabel(g1, label1, 1, GridData.BEGINNING);
preCmd = setCombo(g1, FIELD.PRECMD, set1);
preCmd.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
- if (canModify &&
+ if (canModify &&
!preCmd.getText().equals(getCfg().getPrebuildStep()))
getCfg().setPrebuildStep(preCmd.getText());
}});
@@ -110,39 +111,42 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
setupLabel(g1, label2, 1, GridData.BEGINNING);
preDes = setCombo(g1, FIELD.PREANN, set2);
preDes.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
- if (canModify &&
- !preDes.getText().equals(getCfg().getPreannouncebuildStep()))
+ if (canModify &&
+ !preDes.getText().equals(getCfg().getPreannouncebuildStep()))
getCfg().setPreannouncebuildStep(preDes.getText());
}});
- Group g2 = setupGroup (usercomp, Messages.BuildStepsTab_3, 1, GridData.FILL_HORIZONTAL);
+ Group g2 = setupGroup (usercomp, Messages.BuildStepsTab_3, 1, GridData.FILL_HORIZONTAL);
setupLabel(g2, label1, 1, GridData.BEGINNING);
postCmd = setCombo(g2, FIELD.PSTCMD, set3);
postCmd.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
- if (canModify &&
- !postCmd.getText().equals(getCfg().getPostbuildStep()))
+ if (canModify &&
+ !postCmd.getText().equals(getCfg().getPostbuildStep()))
getCfg().setPostbuildStep(postCmd.getText());
}});
setupLabel(g2, label2, 1, GridData.BEGINNING);
postDes = setCombo(g2, FIELD.PSTANN, set4);
postDes.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
- if (canModify &&
- !postDes.getText().equals(getCfg().getPostannouncebuildStep()))
+ if (canModify &&
+ !postDes.getText().equals(getCfg().getPostannouncebuildStep()))
getCfg().setPostannouncebuildStep(postDes.getText());
}});
}
/**
- *
+ *
*/
private void createForFile() {
- Group g1 = setupGroup (usercomp, Messages.BuildStepsTab_4, 1, GridData.FILL_HORIZONTAL);
+ Group g1 = setupGroup (usercomp, Messages.BuildStepsTab_4, 1, GridData.FILL_HORIZONTAL);
setupLabel(g1, Messages.ResourceCustomBuildStepBlock_label_applicability, 1, GridData.BEGINNING);
-
+
combo = new Combo(g1, SWT.READ_ONLY | SWT.DROP_DOWN | SWT.BORDER);
combo.setItems(rcbsApplicabilityRules);
combo.addSelectionListener(new SelectionAdapter() {
@@ -150,10 +154,11 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
public void widgetSelected(SelectionEvent e) {
rcfg.setRcbsApplicability(sel2app(combo.getSelectionIndex()));
}});
-
- setupLabel(g1, Messages.BuildStepsTab_5, 1, GridData.BEGINNING);
+
+ setupLabel(g1, Messages.BuildStepsTab_5, 1, GridData.BEGINNING);
preCmd = setCombo(g1, FIELD.PRECMD, set1);
preCmd.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (canModify && tool != null) {
IInputType[] ein = tool.getInputTypes();
@@ -166,9 +171,10 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
}
}});
- setupLabel(g1, Messages.BuildStepsTab_6, 1, GridData.BEGINNING);
+ setupLabel(g1, Messages.BuildStepsTab_6, 1, GridData.BEGINNING);
preDes = setCombo(g1, FIELD.PREANN, set2);
preDes.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (canModify && tool != null) {
IOutputType[] out = tool.getOutputTypes();
@@ -180,20 +186,22 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
setupLabel(g1, label1, 1, GridData.BEGINNING);
postCmd = setCombo(g1, FIELD.PSTCMD, set3);
postCmd.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
- if (canModify && tool != null)
+ if (canModify && tool != null)
tool.setToolCommand(postCmd.getText());
}});
setupLabel(g1, label2, 1, GridData.BEGINNING);
postDes = setCombo(g1, FIELD.PSTANN, set4);
postDes.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (canModify && tool != null)
tool.setAnnouncement(postDes.getText());
}});
}
-
+
@Override
public void updateData(ICResourceDescription cfgd) {
if (cfgd == null) return;
@@ -201,15 +209,15 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
cfgdescr = cfgd;
update();
}
-
+
private void update() {
canModify = false; // avoid changing
-
+
updateCombo(preCmd);
updateCombo(preDes);
updateCombo(postCmd);
updateCombo(postDes);
-
+
if (page.isForProject()) {
preCmd.setText(config.getPrebuildStep());
preDes.setText(config.getPreannouncebuildStep());
@@ -219,7 +227,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
rcfg = (IFileInfo)getResCfg(cfgdescr);
combo.select(app2sel(rcfg.getRcbsApplicability()));
tool = getRcbsTool(rcfg);
-
+
if(tool != null){
preCmd.setText(getInputTypes(tool));
preDes.setText(getOutputNames(tool));
@@ -232,7 +240,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
postDes.setText(EMPTY_STR);
}
}
- canModify = true;
+ canModify = true;
}
private String getInputTypes(ITool t) {
@@ -254,11 +262,11 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
return s;
}
-
+
private ITool getRcbsTool(IFileInfo rcConfig){
ITool rcbsTools[] = getRcbsTools(rcConfig);
- ITool rcbsTool = null;
-
+ ITool rcbsTool = null;
+
if(rcbsTools != null)
rcbsTool = rcbsTools[0];
else {
@@ -275,7 +283,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
private ITool[] getRcbsTools(IResourceInfo rcConfig){
List<ITool> list = new ArrayList<ITool>();
ITool tools[] = rcConfig.getTools();
-
+
for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
if (tool.getCustomBuildStep() && !tool.isExtensionElement()) {
@@ -291,9 +299,9 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
private String createList(String[] items) {
if(items == null)
return new String();
-
+
StringBuffer path = new StringBuffer(EMPTY_STR);
-
+
for (int i = 0; i < items.length; i++) {
path.append(items[i]);
if (i < (items.length - 1)) {
@@ -314,15 +322,15 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
cfg2.setPostannouncebuildStep(cfg1.getPostannouncebuildStep());
} else {
if (page.isMultiCfg()) {
- ICResourceDescription[] ris1 = (ICResourceDescription[])((ICMultiResourceDescription)src).getItems();
+ ICResourceDescription[] ris1 = (ICResourceDescription[])((ICMultiResourceDescription)src).getItems();
ICResourceDescription[] ris2 = (ICResourceDescription[])((ICMultiResourceDescription)dst).getItems();
for (int i=0; i<ris1.length; i++)
applyToFile(ris1[i], ris2[i]);
- } else
+ } else
applyToFile(src, dst);
}
}
-
+
private void applyToFile(ICResourceDescription src, ICResourceDescription dst) {
IFileInfo rcfg1 = (IFileInfo)getResCfg(src);
IFileInfo rcfg2 = (IFileInfo)getResCfg(dst);
@@ -339,7 +347,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
add2[0].setPaths(createList(add1[0].getPaths()));
}
}
- IOutputType[] tmp1 = tool1.getOutputTypes();
+ IOutputType[] tmp1 = tool1.getOutputTypes();
IOutputType[] tmp2 = tool2.getOutputTypes();
// if (tmp1 != null && tmp2 != null && tmp1.length > 0 && tmp2.length > 0) {
if (valid(tmp1) && valid(tmp2)) {
@@ -348,7 +356,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
tool2.setToolCommand(tool1.getToolCommand());
tool2.setAnnouncement(tool1.getAnnouncement());
}
-
+
private int sel2app(int index){
String sel = combo.getItem(index);
if(Messages.ResourceCustomBuildStepBlock_label_applicability_rule_override.equals(sel)){
@@ -362,7 +370,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
}
private boolean valid(Object[] arr) { return (arr != null && arr.length > 0); }
-
+
private int app2sel(int val){
switch(val){
case IResourceConfiguration.KIND_APPLY_RCBS_TOOL_AFTER:
@@ -376,8 +384,8 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
return combo.indexOf(Messages.ResourceCustomBuildStepBlock_label_applicability_rule_override);
}
}
-
-
+
+
// This page can be displayed for managed project only
@Override
public boolean canBeVisible() {
@@ -393,7 +401,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
} else
return getCfg().getBuilder().isManagedBuildOn();
}
- else
+ else
return false;
}
@@ -412,7 +420,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
IAdditionalInput[] add = ein[0].getAdditionalInputs();
if (valid(add)) add[0].setPaths(null);
}
- IOutputType[] tmp = tool.getOutputTypes();
+ IOutputType[] tmp = tool.getOutputTypes();
if (valid(tmp)) tmp[0].setOutputNames(null);
tool.setToolCommand(null);
tool.setAnnouncement(null);
@@ -421,7 +429,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
}
@Override
protected void updateButtons() {} // Do nothing. No buttons to update.
-
+
private Combo setCombo(Composite c, FIELD field, Set<String> set) {
Combo combo = new Combo(c, SWT.BORDER);
setupControl(combo, 1, GridData.FILL_HORIZONTAL);
@@ -432,7 +440,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
updateCombo(combo);
return combo;
}
-
+
@SuppressWarnings("unchecked")
private void updateCombo(Combo combo) {
FIELD field = (FIELD)combo.getData(ENUM);
@@ -452,7 +460,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
if (r != null && r instanceof ICFileDescription)
t = getRcbsTool((IFileInfo)getResCfg(r));
if (t == null)
- continue; // there's no specific resconfig for this configuration
+ continue; // there's no specific resconfig for this configuration
}
String s = null;
switch (field) {
@@ -473,7 +481,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
set.add(s.trim());
}
}
- if (set.size() > 0)
+ if (set.size() > 0)
combo.setItems(set.toArray(new String[set.size()]));
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/CPropertyVarsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/CPropertyVarsTab.java
index 97320ff184..94d5854dea 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/CPropertyVarsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/CPropertyVarsTab.java
@@ -78,7 +78,7 @@ import org.eclipse.swt.widgets.TableColumn;
/**
* displays the build macros for the given context
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -87,20 +87,20 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
private static final ICdtVariableManager vmgr = CCorePlugin.getDefault().getCdtVariableManager();
private static final IUserVarSupplier fUserSup = CCorePlugin.getUserVarSupplier();
- private static final EnvCmp comparator = new EnvCmp();
+ private static final EnvCmp comparator = new EnvCmp();
private ICConfigurationDescription cfgd = null;
private IStorableCdtVariables prefvars = null;
-
+
//currently the "CWD" and "PWD" macros are not displayed in UI
private static final String fHiddenMacros[] = new String[]{
"CWD", //$NON-NLS-1$
"PWD" //$NON-NLS-1$
};
-
+
private boolean fShowSysMacros = false;
private Set<String> fIncorrectlyDefinedMacrosNames = new HashSet<String>();
-
+
private TableViewer tv;
private Label fStatusLabel;
private StringListModeControl stringListModeControl;
@@ -118,28 +118,35 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
};
private static final ColumnLayoutData[] fTableColumnLayouts = {new ColumnPixelData(100), new ColumnPixelData(100), new ColumnPixelData(250)};
-
+
private class MacroContentProvider implements IStructuredContentProvider{
+ @Override
public Object[] getElements(Object inputElement) { return (Object[])inputElement; }
+ @Override
public void dispose() { }
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
-
+
private class MacroLabelProvider extends LabelProvider implements ITableLabelProvider, IFontProvider , ITableFontProvider, IColorProvider{
@Override
public Image getImage(Object element) { return null; }
@Override
public String getText(Object element) { return getColumnText(element, 0); }
+ @Override
public Font getFont(Object element) { return getFont(element, 0); }
+ @Override
public Image getColumnImage(Object element, int columnIndex) { return null; }
+ @Override
public Color getBackground(Object element){
ICdtVariable var = (ICdtVariable)element;
if(isUserVar(var))
return BACKGROUND_FOR_USER_VAR;
- return null;
+ return null;
}
-
+
+ @Override
public String getColumnText(Object element, int columnIndex) {
ICdtVariable var = (ICdtVariable)element;
switch(columnIndex){
@@ -167,11 +174,12 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
return "? " + var.getValueType(); //$NON-NLS-1$
}
case 2:
- return getString(var);
+ return getString(var);
}
return EMPTY_STR;
}
-
+
+ @Override
public Font getFont(Object element, int columnIndex) {
ICdtVariable var = (ICdtVariable)element;
if(columnIndex == 0 && isUserVar(var))
@@ -179,6 +187,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
return null;
}
+ @Override
public Color getForeground(Object element){
if(fIncorrectlyDefinedMacrosNames.contains(((ICdtVariable)element).getName()))
return JFaceResources.getColorRegistry().get(JFacePreferences.ERROR_COLOR);
@@ -187,12 +196,12 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
}
/*
- * called when the user macro selection was changed
+ * called when the user macro selection was changed
*/
private void handleSelectionChanged(SelectionChangedEvent event){
updateButtons();
}
-
+
@Override
protected void updateButtons() {
Object[] obs = ((IStructuredSelection)tv.getSelection()).toArray();
@@ -201,7 +210,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
if (obs != null && obs.length > 0) {
canEdit = (obs.length == 1);
for (int i=0; i<obs.length; i++) {
- if (obs[i] instanceof ICdtVariable && isUserVar((ICdtVariable)obs[i])) {
+ if (obs[i] instanceof ICdtVariable && isUserVar((ICdtVariable)obs[i])) {
canDel = true;
break;
}
@@ -210,7 +219,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
buttonSetEnabled(1, canEdit);
buttonSetEnabled(2, canDel);
}
-
+
/*
* called when a custom button was pressed
*/
@@ -229,9 +238,9 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
}
tv.getTable().setFocus();
}
-
+
private void replaceMacros() {
- if (!page.isMultiCfg() ||
+ if (!page.isMultiCfg() ||
cfgd == null ||
CDTPrefUtil.getMultiCfgStringListWriteMode() != CDTPrefUtil.WMODE_REPLACE)
return;
@@ -251,16 +260,16 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
if (cfgd instanceof ICMultiItemsHolder)
return (ICConfigurationDescription[])
((ICMultiItemsHolder)cfgd).getItems();
- else
+ else
return new ICConfigurationDescription[] {cfgd};
}
-
+
private void addOrEdit(ICdtVariable macro, boolean forAll) {
- if( ! canCreate(macro))
+ if( ! canCreate(macro))
return;
if (cfgd != null) {
if (forAll) {
- for (ICConfigurationDescription c : page.getCfgsEditable())
+ for (ICConfigurationDescription c : page.getCfgsEditable())
fUserSup.createMacro(macro, c);
} else {
if (page.isMultiCfg() && cfgd instanceof ICMultiItemsHolder) {
@@ -275,7 +284,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
prefvars.createMacro(macro);
updateData();
}
-
+
private void handleAddButton() {
NewVarDialog dlg = new NewVarDialog(usercomp.getShell(), null, cfgd, getVariables());
if(dlg.open() == Dialog.OK)
@@ -304,7 +313,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
fUserSup.deleteMacro(macros[i].getName(), cfs[k]);
replaceMacros();
}
- else
+ else
fUserSup.deleteMacro(macros[i].getName(), cfgd);
}
else if (chkVars())
@@ -314,7 +323,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
}
}
}
-
+
/*
* returnes the selected user-defined macros
*/
@@ -324,7 +333,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
List<ICdtVariable> list = ((IStructuredSelection)tv.getSelection()).toList();
return list.toArray(new ICdtVariable[list.size()]);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults()
*/
@@ -346,7 +355,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
updateData();
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
@@ -356,11 +365,11 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
initButtons(new String[] {ADD_STR, EDIT_STR, DEL_STR});
usercomp.setLayout(new GridLayout(2, true));
createTableControl();
-
- // Create a "show parent levels" button
+
+ // Create a "show parent levels" button
final Button b = new Button(usercomp, SWT.CHECK);
b.setFont(usercomp.getFont());
- b.setText(Messages.CPropertyVarsTab_0);
+ b.setText(Messages.CPropertyVarsTab_0);
b.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b.setSelection(fShowSysMacros);
b.addSelectionListener(new SelectionAdapter() {
@@ -370,26 +379,27 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
updateData(getResDesc());
}
});
-
+
stringListModeControl = new StringListModeControl(page, usercomp, 1);
stringListModeControl.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
updateData();
}
});
-
+
fStatusLabel = new Label(usercomp, SWT.LEFT);
fStatusLabel.setFont(usercomp.getFont());
fStatusLabel.setText(EMPTY_STR);
fStatusLabel.setLayoutData(new GridData(GridData.BEGINNING));
fStatusLabel.setForeground(JFaceResources.getColorRegistry().get(JFacePreferences.ERROR_COLOR));
}
-
+
private void createTableControl(){
TableViewer tableViewer;
tableViewer = new TableViewer(usercomp, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI
| SWT.FULL_SELECTION);
-
+
Table table = tableViewer.getTable();
TableLayout tableLayout = new TableLayout();
for (int i = 0; i < fTableColumnNames.length; i++) {
@@ -405,33 +415,37 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
tableViewer.setContentProvider(new MacroContentProvider());
tableViewer.setLabelProvider(new MacroLabelProvider());
tableViewer.setSorter(new ViewerSorter());
-
+
tableViewer.setColumnProperties(fEditableTableColumnProps);
tv = tableViewer;
tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
handleSelectionChanged(event);
}
});
tableViewer.addDoubleClickListener(new IDoubleClickListener() {
-
+
+ @Override
public void doubleClick(DoubleClickEvent event) {
if (!tv.getSelection().isEmpty()) { buttonPressed(1); }
}
});
-
+
table.addKeyListener(new KeyListener(){
+ @Override
public void keyPressed(KeyEvent e){
if(e.keyCode == SWT.DEL) buttonPressed(2);
}
+ @Override
public void keyReleased(KeyEvent e){}
});
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 2;
table.setLayoutData(gd);
}
-
+
/*
* answers whether the macro of a given name can be sreated
@@ -447,9 +461,9 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
return false;
}
}
- return true;
+ return true;
}
-
+
@Override
public void updateData(ICResourceDescription _cfgd) {
if (_cfgd == null) {
@@ -461,13 +475,13 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
}
updateData();
}
-
+
private boolean chkVars() {
if (prefvars == null)
prefvars = fUserSup.getWorkspaceVariablesCopy();
return (prefvars != null);
}
-
+
private void checkVariableIntegrity() {
try{
if (page.isMultiCfg() && cfgd instanceof ICMultiItemsHolder) {
@@ -496,17 +510,17 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
} else
return vmgr.getVariables(cfgd);
}
-
+
private void updateData() {
if(tv == null) return;
-
+
checkVariableIntegrity();
// get variables
ICdtVariable[] _vars = getVariables();
if (_vars == null) return;
stringListModeControl.updateStringListModeControl();
-
+
if (cfgd == null) {
chkVars();
if (fShowSysMacros) {
@@ -523,7 +537,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
}
// add system vars not rewritten by user's
for (int j=0; j<_vars.length; j++) {
- if (_vars[j] != null && !vmgr.isUserVariable(_vars[j], null))
+ if (_vars[j] != null && !vmgr.isUserVariable(_vars[j], null))
lst.add(_vars[j]);
}
_vars = lst.toArray(new ICdtVariable[lst.size()]);
@@ -531,17 +545,17 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
_vars = prefvars.getMacros();
}
}
-
+
ArrayList<ICdtVariable> list = new ArrayList<ICdtVariable>(_vars.length);
for(int i = 0; i < _vars.length; i++){
- if(_vars[i] != null && (fShowSysMacros || isUserVar(_vars[i])))
+ if(_vars[i] != null && (fShowSysMacros || isUserVar(_vars[i])))
list.add(_vars[i]);
}
Collections.sort(list, CDTListComparator.getInstance());
tv.setInput(list.toArray(new ICdtVariable[list.size()]));
updateButtons();
}
-
+
private void updateState(CdtVariableException e){
fIncorrectlyDefinedMacrosNames.clear();
if(e != null){
@@ -557,7 +571,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
else
fStatusLabel.setVisible(false);
}
-
+
/**
* Checks whether variable is user's.
* @param v - variable to check.
@@ -572,15 +586,15 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
if (vmgr.isUserVariable(v, cfs[i]))
return true;
return false;
- } else
- return vmgr.isUserVariable(v, cfgd);
+ } else
+ return vmgr.isUserVariable(v, cfgd);
}
-
+
private String getString(ICdtVariable v) {
- if (fUserSup.isDynamic(v))
+ if (fUserSup.isDynamic(v))
return Messages.MacrosBlock_label_value_eclipse_dynamic;
- String value = EMPTY_STR;
- try {
+ String value = EMPTY_STR;
+ try {
if (CdtVariableResolver.isStringListVariable(v.getValueType()))
value = vmgr.convertStringListToString(v.getStringListValue(), VALUE_DELIMITER);
else
@@ -588,12 +602,12 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
} catch (CdtVariableException e1) {}
return value;
}
-
+
@Override
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
if (cfgd != null) {// only for project, not for prefs
if (page.isMultiCfg()) {
- if (src instanceof ICMultiItemsHolder &&
+ if (src instanceof ICMultiItemsHolder &&
dst instanceof ICMultiItemsHolder) {
ICMultiItemsHolder s = (ICMultiItemsHolder)src;
ICMultiItemsHolder d = (ICMultiItemsHolder)dst;
@@ -615,8 +629,8 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
}
/**
- * Unlike other pages, workspace variables
- * should be stored explicitly on "OK".
+ * Unlike other pages, workspace variables
+ * should be stored explicitly on "OK".
*/
@Override
protected void performOK() {
@@ -628,7 +642,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
prefvars = null;
super.performOK();
}
-
+
@Override
protected void performCancel() {
prefvars = null;
@@ -642,7 +656,8 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
}
private static class EnvCmp implements Comparator<Object> {
-
+
+ @Override
public int compare(Object a0, Object a1) {
if (a0 == null || a1 == null)
return 0;
@@ -657,7 +672,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
if (s1 == null)
s1 = AbstractPage.EMPTY_STR;
return(s0.compareTo(s1));
- } else
+ } else
return 0;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
index e4f2f804e6..1cb3196cbe 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
@@ -118,7 +118,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
* .Composite)
@@ -130,13 +130,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
usercomp.setLayout(new GridLayout(1, false));
if (page.isForProject() || page.isForPrefs()) {
- Group scopeGroup = setupGroup(usercomp, Messages.DiscoveryTab_0,
+ Group scopeGroup = setupGroup(usercomp, Messages.DiscoveryTab_0,
1, GridData.FILL_HORIZONTAL);
scopeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
scopeComboBox = new Combo(scopeGroup, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
scopeComboBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- scopeComboBox.add(Messages.DiscoveryTab_1);
- scopeComboBox.add(Messages.DiscoveryTab_2);
+ scopeComboBox.add(Messages.DiscoveryTab_1);
+ scopeComboBox.add(Messages.DiscoveryTab_2);
scopeComboBox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -188,10 +188,10 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
}
private void createScannerConfigControls(Composite parent) {
- autoDiscoveryGroup = setupGroup(parent, Messages.ScannerConfigOptionsDialog_scGroup_label,
+ autoDiscoveryGroup = setupGroup(parent, Messages.ScannerConfigOptionsDialog_scGroup_label,
2, GridData.FILL_HORIZONTAL);
- autoDiscoveryCheckBox = setupCheck(autoDiscoveryGroup, Messages.ScannerConfigOptionsDialog_scGroup_enabled_button,
+ autoDiscoveryCheckBox = setupCheck(autoDiscoveryGroup, Messages.ScannerConfigOptionsDialog_scGroup_enabled_button,
2, GridData.FILL_HORIZONTAL);
autoDiscoveryCheckBox.addSelectionListener(new SelectionAdapter() {
@Override
@@ -207,7 +207,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
}
});
reportProblemsCheckBox = setupCheck(autoDiscoveryGroup,
- Messages.ScannerConfigOptionsDialog_scGroup_problemReporting_enabled_button,
+ Messages.ScannerConfigOptionsDialog_scGroup_problemReporting_enabled_button,
2, GridData.FILL_HORIZONTAL);
reportProblemsCheckBox.addSelectionListener(new SelectionAdapter() {
@Override
@@ -217,7 +217,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
});
// Add profile combo box
- setupLabel(autoDiscoveryGroup, Messages.ScannerConfigOptionsDialog_scGroup_selectedProfile_combo,
+ setupLabel(autoDiscoveryGroup, Messages.ScannerConfigOptionsDialog_scGroup_selectedProfile_combo,
1, GridData.BEGINNING);
profileComboBox = new Combo(autoDiscoveryGroup, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
profileComboBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -230,29 +230,29 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
handleDiscoveryProfileChanged();
}
});
-
+
// "Clear" label
@SuppressWarnings("unused")
- Label clearLabel = ControlFactory.createLabel(autoDiscoveryGroup, Messages.DiscoveryTab_ClearDisoveredEntries);
+ Label clearLabel = ControlFactory.createLabel(autoDiscoveryGroup, Messages.DiscoveryTab_ClearDisoveredEntries);
// "Clear" button
- Button clearButton = ControlFactory.createPushButton(autoDiscoveryGroup, Messages.DiscoveryTab_Clear);
+ Button clearButton = ControlFactory.createPushButton(autoDiscoveryGroup, Messages.DiscoveryTab_Clear);
GridData gd = (GridData) clearButton.getLayoutData();
gd.grabExcessHorizontalSpace = true;
//Bug 331783 - NLS: "Clear" button label in Makefile Project preferences truncated
//gd.widthHint = 80;
gd.horizontalAlignment = SWT.RIGHT;
-
+
final Shell shell = parent.getShell();
clearButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
- String title = Messages.DiscoveryTab_ClearEntries;
+ String title = Messages.DiscoveryTab_ClearEntries;
try {
clearDiscoveredEntries();
- MessageDialog.openInformation(shell, title, Messages.DiscoveryTab_DiscoveredEntriesCleared);
+ MessageDialog.openInformation(shell, title, Messages.DiscoveryTab_DiscoveredEntriesCleared);
} catch (CoreException e) {
- MessageDialog.openError(shell, title, Messages.DiscoveryTab_ErrorClearingEntries + e.getLocalizedMessage());
+ MessageDialog.openError(shell, title, Messages.DiscoveryTab_ErrorClearingEntries + e.getLocalizedMessage());
}
}
});
@@ -289,10 +289,10 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
private void updateData() {
int selScope = 0;
- String lblText = Messages.DiscoveryTab_5;
+ String lblText = Messages.DiscoveryTab_5;
if (!cbi.isPerRcTypeDiscovery()) {
selScope = 1;
- lblText = Messages.DiscoveryTab_8;
+ lblText = Messages.DiscoveryTab_8;
}
if (scopeComboBox != null)
scopeComboBox.select(selScope);
@@ -318,7 +318,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
s = tool.getName();
}
if (s == null)
- s = Messages.DiscoveryTab_3;
+ s = Messages.DiscoveryTab_3;
}
IScannerConfigBuilderInfo2 bi2 = infoMap.get(cfgInfoContext);
TableItem ti = new TableItem(resTable, SWT.NONE);
@@ -332,7 +332,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
resTable.select((pos < len && pos > -1) ? pos : 0);
handleToolSelected();
} else {
- setVisibility(Messages.DiscoveryTab_6);
+ setVisibility(Messages.DiscoveryTab_6);
}
}
@@ -361,7 +361,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
return toolchain!=null
&& (toolchain.getId().equals(MAKEFILE_PROJECT_TOOLCHAIN_ID) || isMakefileProjectToolChain(toolchain.getSuperClass()));
}
-
+
private void handleToolSelected() {
if (resTable.getSelectionCount() == 0)
return;
@@ -400,13 +400,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
// configuration-wide (all in tool-chain)
IConfiguration cfg = iContext.getConfiguration();
IToolChain toolchain = cfg!=null ? cfg.getToolChain() : null;
-
+
if (toolchain==null) {
ManagedBuilderUIPlugin.log(new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(),
"Toolchain=null while trying to get discovery profile per project")); //$NON-NLS-1$
return;
}
-
+
if (isMakefileProjectToolChain(toolchain)) {
// for generic Makefile project let user choose any profile
contextProfiles = new TreeSet<String>(profilesList);
@@ -417,19 +417,19 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
// GCC profile is a sensible default for user to start with
contextProfiles.add(GCC_PER_PROJECT_PROFILE);
}
-
+
} else {
// per language (i.e. input type)
ITool tool = iContext.getTool();
- if (tool==null)
+ if (tool==null)
return;
-
+
contextProfiles = CfgScannerConfigUtil.getAllScannerDiscoveryProfileIds(tool);
}
}
-
+
visibleProfilesList = new ArrayList<String>(contextProfiles);
-
+
realPages = new AbstractDiscoveryPage[visibleProfilesList.size()];
String[] labels = new String[visibleProfilesList.size()];
String[] profiles = new String[visibleProfilesList.size()];
@@ -537,11 +537,11 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
}
/**
- *
+ *
*/
private void initializeProfilePageMap() {
GCCPerProjectSCDProfilePage.isSIConsoleEnabled = DefaultRunSIProvider.isConsoleEnabled();
-
+
pagesList = new ArrayList<DiscoveryProfilePageConfiguration>(5);
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(NAMESPACE, POINT);
if (point == null)
@@ -556,7 +556,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
/**
* Create a profile page only on request
- *
+ *
* @author vhirsl
*/
protected static class DiscoveryProfilePageConfiguration {
@@ -602,13 +602,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
ManagedBuilderUIPlugin.log(e);
}
} else {
- IStatus status = new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(), Messages.DiscoveryTab_7);
+ IStatus status = new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(), Messages.DiscoveryTab_7);
ManagedBuilderUIPlugin.log(status);
}
}
clearChangedDiscoveredInfos();
-
+
DefaultRunSIProvider.setConsoleEnabled(GCCPerProjectSCDProfilePage.isSIConsoleEnabled);
}
@@ -632,7 +632,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
realPages[i].performApply();
realPages[i].setVisible(false);
}
- }
+ }
}
buildInfo.setSelectedProfileId(savedId);
handleDiscoveryProfileChanged();
@@ -743,18 +743,22 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
/**
* IBuildInfoContainer methods - called from dynamic pages
*/
+ @Override
public IScannerConfigBuilderInfo2 getBuildInfo() {
return buildInfo;
}
+ @Override
public CfgInfoContext getContext() {
return iContext;
}
+ @Override
public IProject getProject() {
return page.getProject();
}
+ @Override
public ICConfigurationDescription getConfiguration() {
return getResDesc().getConfiguration();
}
@@ -771,7 +775,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
}
}
updateData();
-
+
DefaultRunSIProvider.setConsoleEnabled(false);
}
@@ -782,7 +786,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
private void clearDiscoveredEntries() throws CoreException {
CfgInfoContext cfgInfoContext = getContext();
-
+
IConfiguration cfg = cfgInfoContext.getConfiguration();
if (cfg==null) {
cfg = cfgInfoContext.getResourceInfo().getParent();
@@ -792,16 +796,16 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
"Unexpected cfg=null while trying to clear discovery entries"); //$NON-NLS-1$
throw new CoreException(status);
}
-
+
IProject project = (IProject) cfg.getOwner();
-
+
DiscoveredPathInfo pathInfo = new DiscoveredPathInfo(project);
InfoContext infoContext = cfgInfoContext.toInfoContext();
-
+
// 1. Remove scanner info from .metadata/.plugins/org.eclipse.cdt.make.core/Project.sc
DiscoveredScannerInfoStore dsiStore = DiscoveredScannerInfoStore.getInstance();
dsiStore.saveDiscoveredScannerInfoToState(project, infoContext, pathInfo);
-
+
// 2. Remove scanner info from CfgDiscoveredPathManager cache and from the Tool
CfgDiscoveredPathManager cdpManager = CfgDiscoveredPathManager.getInstance();
cdpManager.removeDiscoveredInfo(project, cfgInfoContext);
@@ -814,7 +818,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
ScannerConfigProfileManager scpManager = ScannerConfigProfileManager.getInstance();
String selectedProfileId = buildInfo2.getSelectedProfileId();
SCProfileInstance profileInstance = scpManager.getSCProfileInstance(project, infoContext, selectedProfileId);
-
+
IScannerInfoCollector collector = profileInstance.getScannerInfoCollector();
if (collector instanceof IScannerInfoCollectorCleaner) {
((IScannerInfoCollectorCleaner) collector).deleteAll(project);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java
index a0042a1a78..3ec9508f18 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControlFieldEditor.java
@@ -37,7 +37,7 @@ import org.eclipse.ui.PlatformUI;
/**
* Field editor that uses FileListControl for user input.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -75,7 +75,7 @@ public class FileListControlFieldEditor extends FieldEditor {
* @param name the name of the preference this field editor works on
* @param labelText the label text of the field editor
* @param tooltip the tooltip text of the field editor
- * @param contextId
+ * @param contextId
* @param parent the parent of the field editor's control
* @param type the browseType of the file list control
*/
@@ -87,7 +87,7 @@ public class FileListControlFieldEditor extends FieldEditor {
Composite parent,
int type) {
this(name, labelText, parent, type);
- // can't use setToolTip(tooltip) as label not created yet
+ // can't use setToolTip(tooltip) as label not created yet
getLabelControl(parent).setToolTipText(tooltip);
if (!contextId.equals("")) PlatformUI.getWorkbench().getHelpSystem().setHelp(list.getListControl(), contextId); //$NON-NLS-1$
}
@@ -107,7 +107,7 @@ public class FileListControlFieldEditor extends FieldEditor {
// Currently just the label has the tooltip
getLabelControl().setToolTipText(tooltip);
}
-
+
/**
* Returns the field editor's tool tip text, or null if it has
* not been set.
@@ -145,23 +145,23 @@ public class FileListControlFieldEditor extends FieldEditor {
/**
* Sets the filter-path for the underlying Browse dialog. Only applies when browseType is 'file' or 'dir'.
* @param filterPath
- *
+ *
* @since 7.0
*/
public void setFilterPath(String filterPath) {
list.setFilterPath(filterPath);
}
-
+
/**
* Sets the filter-extensions for the underlying Browse dialog. Only applies when browseType is 'file'.
* @param filterExtensions
- *
+ *
* @since 7.0
*/
public void setFilterExtensions(String[] filterExtensions) {
list.setFilterExtensions(filterExtensions);
}
-
+
/**
* Fills this field editor's basic controls into the given parent.
*/
@@ -181,14 +181,15 @@ public class FileListControlFieldEditor extends FieldEditor {
list = new FileListControl(topLayout, getLabelText(), getType(), false);
list.addChangeListener(new IFileListChangeListener(){
+ @Override
public void fileListChanged(FileListControl fileList, String oldValue[], String newValue[]) {
handleFileListChange(fileList,oldValue,newValue);
}
-
+
});
topLayout.setLayout(layout);
}
-
+
private void handleFileListChange(FileListControl fileList, String oldValue[], String newValue[]){
// values = fileList.getItems();
fireValueChanged(
@@ -206,7 +207,7 @@ public class FileListControlFieldEditor extends FieldEditor {
}
/**
- * @return the file list control
+ * @return the file list control
*/
protected List getListControl() {
return list.getListControl();
@@ -218,7 +219,7 @@ public class FileListControlFieldEditor extends FieldEditor {
@Override
protected void doLoad() {
if (list != null) {
- IPreferenceStore store = getPreferenceStore();
+ IPreferenceStore store = getPreferenceStore();
if (store != null) {
String s = store.getString(getPreferenceName());
String[] array = parseString(s);
@@ -275,7 +276,7 @@ public class FileListControlFieldEditor extends FieldEditor {
if (s != null)
getPreferenceStore().setValue(getPreferenceName(), s);
}
-
+
public String[] getStringListValue(){
return list.getItems();
}
@@ -291,11 +292,11 @@ public class FileListControlFieldEditor extends FieldEditor {
}
/**
- * Answers a <code>String</code> containing the strings passed in the
+ * Answers a <code>String</code> containing the strings passed in the
* argument separated by the DEFAULT_SEPERATOR
- *
+ *
* @param items An array of strings
- * @return
+ * @return
*/
private String createList(String[] items) {
StringBuffer path = new StringBuffer(""); //$NON-NLS-1$
@@ -310,7 +311,7 @@ public class FileListControlFieldEditor extends FieldEditor {
}
/**
- * Parse the string with the separator and returns the string array.
+ * Parse the string with the separator and returns the string array.
* @param stringList
* @return
*/
@@ -338,12 +339,12 @@ public class FileListControlFieldEditor extends FieldEditor {
protected void adjustForNumColumns(int numColumns) {
((GridData)topLayout.getLayoutData()).horizontalSpan = numColumns;
}
-
+
@Override
public Label getLabelControl(Composite parent) {
return list.getLabelControl();
}
-
+
@Override
public void setEnabled(boolean enabled, Composite parent) {
list.setEnabled(enabled);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewBuildConfigurationDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewBuildConfigurationDialog.java
index c73c5c5361..2de88d5edb 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewBuildConfigurationDialog.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewBuildConfigurationDialog.java
@@ -42,10 +42,10 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
/**
- * Build-system specific version
+ * Build-system specific version
* for "add new configuration" dialog
* in "Manage configurations" feature
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -71,11 +71,11 @@ public class NewBuildConfigurationDialog extends Dialog {
private String newDescription;
final private String title;
-
+
/**
* @param parentShell
* @param managedTarget
- * @param nameList A list of names (Strings) that have been added by the user but have not yet been added to the target
+ * @param nameList A list of names (Strings) that have been added by the user but have not yet been added to the target
* @param title The title of the dialog
*/
protected NewBuildConfigurationDialog(Shell parentShell,
@@ -87,24 +87,24 @@ public class NewBuildConfigurationDialog extends Dialog {
this.title = title;
des = prjd;
setShellStyle(getShellStyle()|SWT.RESIZE);
-
+
newName = new String();
newDescription = new String();
-
+
parentConfig = null;
// The default behaviour is to clone the settings
clone = true;
-
+
// Populate the list of default and defined configurations
definedCfgds = new IConfiguration[_cfgds.length];
- for (int i=0; i<_cfgds.length; i++)
+ for (int i=0; i<_cfgds.length; i++)
definedCfgds[i] = ManagedBuildManager.getConfigurationForDescription(_cfgds[i]);
- defaultCfgds = _defs;
+ defaultCfgds = _defs;
}
-
+
/* (non-Javadoc)
* Method declared on Dialog. Cache the name and base config selections.
- * We don't have to worry that the index or name is wrong because we
+ * We don't have to worry that the index or name is wrong because we
* enable the OK button IFF those conditions are met.
*/
@Override
@@ -113,15 +113,15 @@ public class NewBuildConfigurationDialog extends Dialog {
String description = new String();
String nameAndDescription = new String();
String baseConfigNameAndDescription = new String();
-
+
newName = configName.getText().trim();
newDescription = configDescription.getText().trim();
-
+
if (clone) {
- baseConfigNameAndDescription = cloneConfigSelector.getItem(cloneConfigSelector.getSelectionIndex());
+ baseConfigNameAndDescription = cloneConfigSelector.getItem(cloneConfigSelector.getSelectionIndex());
for (int i = 0; i < definedCfgds.length; i++) {
description = definedCfgds[i].getDescription();
-
+
if( (description == null) || (description.equals("")) ){ //$NON-NLS-1$
nameAndDescription = definedCfgds[i].getName();
} else {
@@ -129,7 +129,7 @@ public class NewBuildConfigurationDialog extends Dialog {
}
if (nameAndDescription.equals(baseConfigNameAndDescription)) {
parentConfig = definedCfgds[i];
- break;
+ break;
}
}
} else {
@@ -137,7 +137,7 @@ public class NewBuildConfigurationDialog extends Dialog {
baseConfigNameAndDescription = copyConfigSelector.getItem(copyConfigSelector.getSelectionIndex());
for (int i = 0; i < defaultCfgds.length; i++) {
description = defaultCfgds[i].getDescription();
-
+
if( (description == null) || (description.equals("")) ) { //$NON-NLS-1$
nameAndDescription = defaultCfgds[i].getName();
} else {
@@ -145,7 +145,7 @@ public class NewBuildConfigurationDialog extends Dialog {
}
if (nameAndDescription.equals(baseConfigNameAndDescription)) {
parentConfig = defaultCfgds[i];
- break;
+ break;
}
}
}
@@ -202,7 +202,7 @@ public class NewBuildConfigurationDialog extends Dialog {
final Label nameLabel = new Label(group1, SWT.LEFT);
nameLabel.setFont(parent.getFont());
nameLabel.setText(Messages.NewConfiguration_label_name);
-
+
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 1;
gd.grabExcessHorizontalSpace = false;
@@ -217,11 +217,12 @@ public class NewBuildConfigurationDialog extends Dialog {
gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
configName.setLayoutData(gd);
configName.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validateState();
}
});
-
+
// Add a label and a text widget for Configuration's description
final Label descriptionLabel = new Label(group1, SWT.LEFT);
descriptionLabel.setFont(parent.getFont());
@@ -235,12 +236,12 @@ public class NewBuildConfigurationDialog extends Dialog {
configDescription.setFont(group1.getFont());
configDescription.setText(getNewDescription());
configDescription.setFocus();
-
+
gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = 2;
gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
configDescription.setLayoutData(gd);
-
+
// Create a group for the radio buttons
final Group group = new Group(composite, SWT.NONE);
@@ -254,7 +255,7 @@ public class NewBuildConfigurationDialog extends Dialog {
SelectionListener radioListener = new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent event) {
+ public void widgetSelected(SelectionEvent event) {
clone = btnClone.getSelection();
updateComboState();
}
@@ -265,7 +266,7 @@ public class NewBuildConfigurationDialog extends Dialog {
btnCopy.setText(Messages.NewConfiguration_label_copy);
setButtonLayoutData(btnCopy);
btnCopy.addSelectionListener(radioListener);
-
+
copyConfigSelector = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
copyConfigSelector.setFont(group.getFont());
int index = copyConfigSelector.indexOf(newName);
@@ -277,11 +278,11 @@ public class NewBuildConfigurationDialog extends Dialog {
copyConfigSelector.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- validateState();
+ validateState();
}
- });
+ });
copyConfigSelector.setEnabled(false);
-
+
// Create a radio button and combo for clonable configs
btnClone = new Button(group, SWT.RADIO);
btnClone.setFont(group.getFont());
@@ -289,7 +290,7 @@ public class NewBuildConfigurationDialog extends Dialog {
setButtonLayoutData(btnClone);
btnClone.addSelectionListener(radioListener);
btnClone.setSelection(true);
-
+
cloneConfigSelector = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
cloneConfigSelector.setFont(group.getFont());
cloneConfigSelector.setItems(getDefinedConfigNamesAndDescriptions());
@@ -302,13 +303,13 @@ public class NewBuildConfigurationDialog extends Dialog {
cloneConfigSelector.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- validateState();
+ validateState();
}
- });
-
+ });
+
updateComboState();
updateDefaultConfigs();
-
+
statusLabel = new Label(composite, SWT.CENTER);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
@@ -323,7 +324,7 @@ public class NewBuildConfigurationDialog extends Dialog {
/**
* updates the list of default configurations
*/
-
+
private void updateDefaultConfigs(){
// IConfiguration cfgs[] = managedProject.getProjectType().getConfigurations();
if(defaultCfgds.length != 0){
@@ -334,12 +335,12 @@ public class NewBuildConfigurationDialog extends Dialog {
else
namesAndDescriptions[i] = defaultCfgds[i].getName() + "( " + defaultCfgds[i].getDescription() + " )"; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
int selectionIndex = copyConfigSelector.getSelectionIndex();
String oldSelection = null;
if(selectionIndex != -1)
oldSelection = copyConfigSelector.getItem(selectionIndex);
-
+
copyConfigSelector.setItems(namesAndDescriptions);
if(oldSelection != null)
selectionIndex = copyConfigSelector.indexOf(oldSelection);
@@ -352,10 +353,10 @@ public class NewBuildConfigurationDialog extends Dialog {
}
validateState();
}
-
+
/*
* Returns the array of configuration names defined for this managed project.
- * This list will be used to populate the list of configurations to
+ * This list will be used to populate the list of configurations to
* clone.
*/
private String [] getDefinedConfigNamesAndDescriptions() {
@@ -366,7 +367,7 @@ public class NewBuildConfigurationDialog extends Dialog {
else
namesAndDescriptions[i] = definedCfgds[i].getName() + "( " + definedCfgds[i].getDescription() +" )"; //$NON-NLS-1$ //$NON-NLS-2$
}
- return namesAndDescriptions;
+ return namesAndDescriptions;
}
/**
@@ -376,10 +377,10 @@ public class NewBuildConfigurationDialog extends Dialog {
public String getNewName() {
return newName;
}
-
+
protected boolean isDuplicateName(String newName) {
for (int i = 0; i < definedCfgds.length; i++) {
- if (definedCfgds[i].getName().equals(newName))
+ if (definedCfgds[i].getName().equals(newName))
return true;
}
return false;
@@ -394,7 +395,7 @@ public class NewBuildConfigurationDialog extends Dialog {
}
/* (non-Javadoc)
- * Radio button selection event handler calls this helper method to
+ * Radio button selection event handler calls this helper method to
* enable or disable the radio buttons.
*/
protected void updateComboState() {
@@ -405,7 +406,7 @@ public class NewBuildConfigurationDialog extends Dialog {
}
/* (non-Javadoc)
- * Checks the argument for leading whitespaces and invalid directory name characters.
+ * Checks the argument for leading whitespaces and invalid directory name characters.
* @param name
* @return <I>true</i> is the name is a valid directory name with no whitespaces
*/
@@ -413,7 +414,7 @@ public class NewBuildConfigurationDialog extends Dialog {
// Names must be at least one character in length
if (name.trim().length() == 0)
return false;
-
+
// Iterate over the name checking for bad characters
char[] chars = name.toCharArray();
// No whitespaces at the start of a name
@@ -443,11 +444,11 @@ public class NewBuildConfigurationDialog extends Dialog {
/* (non-Javadoc)
* Update the status message and button state based on the input selected
* by the user
- *
+ *
*/
private void validateState() {
String s = null;
- String currentName = configName.getText();
+ String currentName = configName.getText();
// Trim trailing whitespace
while (currentName.length() > 0 && Character.isWhitespace(currentName.charAt(currentName.length()-1))) {
currentName = currentName.substring(0, currentName.length()-1);
@@ -466,7 +467,7 @@ public class NewBuildConfigurationDialog extends Dialog {
} else if (!validateName(currentName)) {
// TODO Create a decent I18N string to describe this problem
s = NLS.bind(Messages.NewConfiguration_error_invalidName, currentName);
- }
+ }
if (statusLabel == null) return;
Button b = getButton(IDialogConstants.OK_ID);
if (s != null) {
@@ -484,9 +485,9 @@ public class NewBuildConfigurationDialog extends Dialog {
}
/**
- * Create a new configuration, using the values currently set in
+ * Create a new configuration, using the values currently set in
* the dialog.
- *
+ *
* Always returns null - in fact, return value
* is kept for compatibility only.
*/
@@ -497,7 +498,7 @@ public class NewBuildConfigurationDialog extends Dialog {
Configuration config = new Configuration(mp, cfg, id, true, false);
config.setName(getNewName());
config.setDescription(getNewDescription());
-
+
String target = config.getArtifactName();
if (target == null || target.length() == 0)
config.setArtifactName(mp.getDefaultArtifactName());
@@ -506,8 +507,8 @@ public class NewBuildConfigurationDialog extends Dialog {
try {
des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
} catch (CoreException e) {
- System.out.println(Messages.NewBuildConfigurationDialog_0);
- System.out.println(Messages.NewBuildConfigurationDialog_1 + e.getLocalizedMessage());
+ System.out.println(Messages.NewBuildConfigurationDialog_0);
+ System.out.println(Messages.NewBuildConfigurationDialog_1 + e.getLocalizedMessage());
}
return null;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java
index 9a063484f7..2a2e3768d6 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java
@@ -66,10 +66,10 @@ import org.eclipse.swt.widgets.Text;
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class NewCfgDialog implements INewCfgDialog {
- private static final String NULL = "[null]"; //$NON-NLS-1$
+ private static final String NULL = "[null]"; //$NON-NLS-1$
private static final String SEPARATOR = " > "; //$NON-NLS-1$
private static final String ART = MBSWizardHandler.ARTIFACT;
- private static final String NOT = Messages.NewCfgDialog_3;
+ private static final String NOT = Messages.NewCfgDialog_3;
// Widgets
private Text configName;
private Text configDescription;
@@ -77,8 +77,8 @@ public class NewCfgDialog implements INewCfgDialog {
private Combo realConfigSelector;
private Button b_cloneFromProject;
private Button b_cloneFromExtension;
- private Button b_importFromOtherProject;
- private Button b_importPredefined;
+ private Button b_importFromOtherProject;
+ private Button b_importPredefined;
private Combo importSelector;
private Combo importDefSelector;
private Label statusLabel;
@@ -87,13 +87,13 @@ public class NewCfgDialog implements INewCfgDialog {
private ICProjectDescription des;
private IConfiguration[] cfgds;
private IConfiguration[] rcfgs;
- private IConfiguration parentConfig;
+ private IConfiguration parentConfig;
private String newName;
private String newDescription;
private String title;
private Map<String, IConfiguration> imported;
private Map<String, IConfiguration> importedDef;
-
+
protected Shell parentShell;
private class LocalDialog extends Dialog {
@@ -103,7 +103,7 @@ public class NewCfgDialog implements INewCfgDialog {
}
/* (non-Javadoc)
* Method declared on Dialog. Cache the name and base config selections.
- * We don't have to worry that the index or name is wrong because we
+ * We don't have to worry that the index or name is wrong because we
* enable the OK button IFF those conditions are met.
*/
@Override
@@ -111,7 +111,7 @@ public class NewCfgDialog implements INewCfgDialog {
if (buttonId == IDialogConstants.OK_ID) {
newName = configName.getText().trim();
newDescription = configDescription.getText().trim();
- if (b_cloneFromProject.getSelection())
+ if (b_cloneFromProject.getSelection())
parentConfig = cfgds[cloneConfigSelector.getSelectionIndex()];
else if (b_cloneFromExtension.getSelection()) // real cfg
parentConfig = rcfgs[realConfigSelector.getSelectionIndex()];
@@ -128,7 +128,7 @@ public class NewCfgDialog implements INewCfgDialog {
}
super.buttonPressed(buttonId);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
@@ -151,7 +151,7 @@ public class NewCfgDialog implements INewCfgDialog {
}
setButtons();
}
-
+
@Override
protected Control createDialogArea(Composite parent) {
@@ -169,12 +169,12 @@ public class NewCfgDialog implements INewCfgDialog {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
group1.setLayoutData(gd);
-
+
// bug 187634: Add a label to warn user that configuration name will be used directly
// as a directory name in the filesystem.
Label warningLabel = new Label(group1, SWT.BEGINNING | SWT.WRAP);
warningLabel.setFont(parent.getFont());
- warningLabel.setText(Messages.NewConfiguration_label_warning);
+ warningLabel.setText(Messages.NewConfiguration_label_warning);
gd = new GridData(SWT.FILL, SWT.BEGINNING, true, false, 3, 1);
gd.widthHint = 300;
warningLabel.setLayoutData(gd);
@@ -183,7 +183,7 @@ public class NewCfgDialog implements INewCfgDialog {
final Label nameLabel = new Label(group1, SWT.LEFT);
nameLabel.setFont(parent.getFont());
nameLabel.setText(Messages.NewConfiguration_label_name);
-
+
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 1;
gd.grabExcessHorizontalSpace = false;
@@ -198,11 +198,12 @@ public class NewCfgDialog implements INewCfgDialog {
gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
configName.setLayoutData(gd);
configName.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
setButtons();
}
});
-
+
// Add a label and a text widget for Configuration's description
final Label descriptionLabel = new Label(group1, SWT.LEFT);
descriptionLabel.setFont(parent.getFont());
@@ -216,12 +217,12 @@ public class NewCfgDialog implements INewCfgDialog {
configDescription.setFont(group1.getFont());
configDescription.setText(newDescription);
configDescription.setFocus();
-
+
gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = 2;
gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
configDescription.setLayoutData(gd);
-
+
final Group group = new Group(composite, SWT.NONE);
group.setFont(composite.getFont());
group.setText(Messages.NewConfiguration_label_group);
@@ -232,16 +233,16 @@ public class NewCfgDialog implements INewCfgDialog {
group.setLayoutData(gd);
b_cloneFromProject = new Button(group, SWT.RADIO);
- b_cloneFromProject.setText(Messages.NewCfgDialog_0);
+ b_cloneFromProject.setText(Messages.NewCfgDialog_0);
gd = new GridData(GridData.BEGINNING);
b_cloneFromProject.setLayoutData(gd);
b_cloneFromProject.setSelection(true);
b_cloneFromProject.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- setButtons();
+ setButtons();
}
- });
+ });
cloneConfigSelector = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
cloneConfigSelector.setFont(group.getFont());
@@ -253,20 +254,20 @@ public class NewCfgDialog implements INewCfgDialog {
cloneConfigSelector.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- setButtons();
+ setButtons();
}
- });
-
+ });
+
b_cloneFromExtension = new Button(group, SWT.RADIO);
- b_cloneFromExtension.setText(Messages.NewCfgDialog_1);
+ b_cloneFromExtension.setText(Messages.NewCfgDialog_1);
gd = new GridData(GridData.BEGINNING);
b_cloneFromExtension.setLayoutData(gd);
b_cloneFromExtension.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- setButtons();
+ setButtons();
}
- });
+ });
String[] extCfgs = getConfigNamesAndDescriptions(rcfgs, true);
realConfigSelector = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
@@ -280,24 +281,24 @@ public class NewCfgDialog implements INewCfgDialog {
realConfigSelector.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- setButtons();
+ setButtons();
}
- });
-
+ });
+
if(extCfgs.length == 0)
b_cloneFromExtension.setEnabled(false);
/* import */
b_importFromOtherProject = new Button(group, SWT.RADIO);
- b_importFromOtherProject.setText(Messages.NewCfgDialog_4);
+ b_importFromOtherProject.setText(Messages.NewCfgDialog_4);
gd = new GridData(GridData.BEGINNING);
b_importFromOtherProject.setLayoutData(gd);
b_importFromOtherProject.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- setButtons();
+ setButtons();
}
- });
+ });
importSelector = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
importSelector.setFont(group.getFont());
importSelector.setItems(getImportItems());
@@ -309,21 +310,21 @@ public class NewCfgDialog implements INewCfgDialog {
importSelector.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- setButtons();
+ setButtons();
}
- });
+ });
/* import predefined */
b_importPredefined = new Button(group, SWT.RADIO);
- b_importPredefined.setText(Messages.NewCfgDialog_5);
+ b_importPredefined.setText(Messages.NewCfgDialog_5);
gd = new GridData(GridData.BEGINNING);
b_importPredefined.setLayoutData(gd);
b_importPredefined.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- setButtons();
+ setButtons();
}
- });
+ });
importDefSelector = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
importDefSelector.setFont(group.getFont());
importDefSelector.setItems(getImportDefItems());
@@ -335,10 +336,10 @@ public class NewCfgDialog implements INewCfgDialog {
importDefSelector.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- setButtons();
+ setButtons();
}
- });
-
+ });
+
statusLabel = new Label(composite, SWT.CENTER);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
@@ -348,15 +349,15 @@ public class NewCfgDialog implements INewCfgDialog {
return composite;
}
-
+
/* (non-Javadoc)
* Update the status message and button state based on the input selected
* by the user
- *
+ *
*/
private void setButtons() {
String s = null;
- String currentName = configName.getText();
+ String currentName = configName.getText();
// Trim trailing whitespace
while (currentName.length() > 0 && Character.isWhitespace(currentName.charAt(currentName.length()-1))) {
currentName = currentName.substring(0, currentName.length()-1);
@@ -374,7 +375,7 @@ public class NewCfgDialog implements INewCfgDialog {
s = NLS.bind(Messages.NewConfiguration_error_caseName, currentName);
} else if (!validateName(currentName)) {
s = Messages.NewConfiguration_error_invalidName;
- }
+ }
if (statusLabel == null) return;
Button b = getButton(IDialogConstants.OK_ID);
if (s != null) {
@@ -386,10 +387,10 @@ public class NewCfgDialog implements INewCfgDialog {
if (b != null) b.setEnabled(true);
}
if (b_importFromOtherProject.getSelection() && importSelector.getSelectionIndex() == 0)
- if (b != null) b.setEnabled(false);
+ if (b != null) b.setEnabled(false);
if (b_importPredefined.getSelection() && importDefSelector.getSelectionIndex() == 0)
- if (b != null) b.setEnabled(false);
-
+ if (b != null) b.setEnabled(false);
+
cloneConfigSelector.setEnabled(b_cloneFromProject.getSelection());
realConfigSelector.setEnabled(b_cloneFromExtension.getSelection());
importSelector.setEnabled(b_importFromOtherProject.getSelection());
@@ -397,27 +398,30 @@ public class NewCfgDialog implements INewCfgDialog {
}
}
+ @Override
public int open() {
if (parentShell == null) return 1;
- LocalDialog dlg = new LocalDialog(parentShell);
+ LocalDialog dlg = new LocalDialog(parentShell);
return dlg.open();
}
-
+
/**
*/
public NewCfgDialog() {
newName = new String();
newDescription = new String();
}
-
+
+ @Override
public void setShell(Shell shell) {
parentShell = shell;
- }
-
+ }
+
+ @Override
public void setProject(ICProjectDescription prj) {
des = prj;
- ICConfigurationDescription[] descs = des.getConfigurations();
- cfgds = new IConfiguration[descs.length];
+ ICConfigurationDescription[] descs = des.getConfigurations();
+ cfgds = new IConfiguration[descs.length];
ArrayList<IConfiguration> lst = new ArrayList<IConfiguration>();
for (int i = 0; i < descs.length; ++i) {
cfgds[i] = ManagedBuildManager.getConfigurationForDescription(descs[i]);
@@ -426,7 +430,7 @@ public class NewCfgDialog implements INewCfgDialog {
if (cfg != null) {
IProjectType pType = cfg.getProjectType();
if(pType != null){
- IConfiguration[] cfs = pType.getConfigurations();
+ IConfiguration[] cfs = pType.getConfigurations();
for (IConfiguration c : cfs) {
if (c != null && !lst.contains(c))
lst.add(c);
@@ -437,10 +441,11 @@ public class NewCfgDialog implements INewCfgDialog {
rcfgs = lst.toArray(new IConfiguration[lst.size()]);
}
+ @Override
public void setTitle(String _title) {
title = _title;
}
-
+
private String [] getConfigNamesAndDescriptions(IConfiguration[] arr, boolean check) {
String [] names = new String[arr.length];
@@ -461,13 +466,13 @@ public class NewCfgDialog implements INewCfgDialog {
for (int i=0; i<names.length; i++) {
IToolChain tc = arr[i].getToolChain();
String s = (tc == null) ? NULL : tc.getName();
- names[i] = names[i] + " : " + s; //$NON-NLS-1$
- }
+ names[i] = names[i] + " : " + s; //$NON-NLS-1$
+ }
}
}
- return names;
+ return names;
}
-
+
private String getNameAndDescription(IConfiguration cfg) {
String name = cfg.getName();
if (name == null) name = NULL;
@@ -479,7 +484,7 @@ public class NewCfgDialog implements INewCfgDialog {
protected boolean isDuplicateName(String newName) {
for (int i = 0; i < cfgds.length; i++) {
- if (cfgds[i].getName().equals(newName))
+ if (cfgds[i].getName().equals(newName))
return true;
}
return false;
@@ -494,7 +499,7 @@ public class NewCfgDialog implements INewCfgDialog {
}
/* (non-Javadoc)
- * Checks the argument for leading whitespaces and invalid directory name characters.
+ * Checks the argument for leading whitespaces and invalid directory name characters.
* @param name
* @return <I>true</i> is the name is a valid directory name with no whitespaces
*/
@@ -502,7 +507,7 @@ public class NewCfgDialog implements INewCfgDialog {
// Names must be at least one character in length
if (name.trim().length() == 0)
return false;
-
+
// Iterate over the name checking for bad characters
char[] chars = name.toCharArray();
// No whitespaces at the start of a name
@@ -529,9 +534,9 @@ public class NewCfgDialog implements INewCfgDialog {
}
return true;
}
-
+
/**
- * Create a new configuration, using the values currently set in
+ * Create a new configuration, using the values currently set in
* the dialog.
*/
private void newConfiguration() {
@@ -567,7 +572,7 @@ public class NewCfgDialog implements INewCfgDialog {
config.setConfigurationDescription(cfgDes);
config.setName(newName);
config.setDescription(newDescription);
-
+
String target = config.getArtifactName();
if (target == null || target.length() == 0)
config.setArtifactName(mp.getDefaultArtifactName());
@@ -578,23 +583,23 @@ public class NewCfgDialog implements INewCfgDialog {
if (cfgDes == null) {
throw new CoreException(new Status(IStatus.ERROR,
"org.eclipse.cdt.managedbuilder.ui", -1, //$NON-NLS-1$
- Messages.NewCfgDialog_2, null));
+ Messages.NewCfgDialog_2, null));
}
} catch (CoreException e) {
ManagedBuilderUIPlugin.log(e);
}
}
-
+
private String[] getImportItems() {
imported = new HashMap<String, IConfiguration>();
if (des != null) {
IProject[] ps = des.getProject().getWorkspace().getRoot().getProjects();
for (IProject p : ps) {
- ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(p, false);
+ ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(p, false);
if (prjd == null)
continue;
ICConfigurationDescription[] cfgs = prjd.getConfigurations();
- if (cfgs == null || cfgs.length == 0)
+ if (cfgs == null || cfgs.length == 0)
continue;
for (ICConfigurationDescription d : cfgs) {
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(d);
@@ -620,7 +625,7 @@ public class NewCfgDialog implements INewCfgDialog {
for (IToolChain tc : tcs) {
if (tc.isSystemObject() || tc.isAbstract() || ! tc.isSupported())
continue;
- // prefix: "X" shown if toolchain is not supported by platform.
+ // prefix: "X" shown if toolchain is not supported by platform.
String pre = ManagedBuildManager.isPlatformOk(tc) ? " " : "X "; //$NON-NLS-1$ //$NON-NLS-2$
for (IConfiguration c : ManagedBuildManager.getExtensionConfigurations(tc, ART, id)) {
if (c.isSystemObject() || ! c.isSupported())
@@ -636,7 +641,7 @@ public class NewCfgDialog implements INewCfgDialog {
}
private IConfiguration getConfigFromName(String s, Map<String, IConfiguration> imp) {
- if (imp == null)
+ if (imp == null)
return null;
return imp.get(s);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java
index 5f3410aef6..f9812cd59d 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties;
-import com.ibm.icu.text.Collator;
import java.util.Arrays;
import java.util.Comparator;
@@ -20,8 +19,8 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacro;
-import org.eclipse.cdt.managedbuilder.macros.IBuildMacro;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
+import org.eclipse.cdt.managedbuilder.macros.IBuildMacro;
import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
import org.eclipse.cdt.utils.ui.controls.FileListControl;
import org.eclipse.jface.dialogs.Dialog;
@@ -47,9 +46,11 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import com.ibm.icu.text.Collator;
+
/**
* the dialog used to create or edit the build macro
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -62,7 +63,7 @@ public class NewVarDialog extends Dialog {
private ICdtVariable fEditedMacro;
//the resulting macro. Can be accessed only when the dialog is closed
private ICdtVariable fResultingMacro;
-
+
private boolean fTotalSizeCalculated;
private String fTypedName;
@@ -77,10 +78,10 @@ public class NewVarDialog extends Dialog {
private Button fBrowseButton;
private Combo fTypeSelector;
private Composite fListEditorContainier;
-
+
private FileListControl fListEditor;
private ICConfigurationDescription cfgd;
- private ICdtVariable[] vars;
+ private ICdtVariable[] vars;
public NewVarDialog(Shell parentShell, ICdtVariable editedMacro, ICConfigurationDescription _cfgd, ICdtVariable[] _vars) {
super(parentShell);
@@ -102,7 +103,7 @@ public class NewVarDialog extends Dialog {
if (fTitle != null)
shell.setText(fTitle);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@@ -118,9 +119,9 @@ public class NewVarDialog extends Dialog {
Label nameLabel = new Label(comp, SWT.LEFT);
nameLabel.setFont(comp.getFont());
- nameLabel.setText(Messages.NewVarDialog_0);
+ nameLabel.setText(Messages.NewVarDialog_0);
nameLabel.setLayoutData(new GridData());
-
+
fMacroNameEdit = new CCombo(comp, SWT.BORDER);
fMacroNameEdit.setItems(getMacroNames());
fMacroNameEdit.setFont(comp.getFont());
@@ -129,6 +130,7 @@ public class NewVarDialog extends Dialog {
gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH + 50;
fMacroNameEdit.setLayoutData(gd);
fMacroNameEdit.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
handleMacroNameModified();
}
@@ -142,7 +144,7 @@ public class NewVarDialog extends Dialog {
if (fEditedMacro == null && cfgd != null && !(cfgd instanceof ICMultiItemsHolder)) {
Button c_all = new Button(comp, SWT.CHECK);
- c_all.setText(Messages.NewVarDialog_1);
+ c_all.setText(Messages.NewVarDialog_1);
gd = new GridData(GridData.BEGINNING);
gd.horizontalSpan = 3;
c_all.setLayoutData(gd);
@@ -153,13 +155,13 @@ public class NewVarDialog extends Dialog {
}
});
}
-
+
Label typeLabel = new Label(comp, SWT.LEFT);
typeLabel.setFont(comp.getFont());
typeLabel.setText(Messages.NewBuildMacroDialog_label_type);
gd = new GridData();
typeLabel.setLayoutData(gd);
-
+
fTypeSelector = new Combo(comp, SWT.READ_ONLY | SWT.DROP_DOWN | SWT.BORDER);
gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
gd.horizontalSpan = 2;
@@ -178,6 +180,7 @@ public class NewVarDialog extends Dialog {
setSelectedType(IBuildMacro.VALUE_TEXT);
fTypeSelector.addListener(SWT.Selection, new Listener () {
+ @Override
public void handleEvent(Event e) {
handleTypeModified();
}
@@ -187,9 +190,9 @@ public class NewVarDialog extends Dialog {
fMacroValueLabel.setFont(comp.getFont());
fMacroValueLabel.setText(Messages.NewBuildMacroDialog_label_value);
gd = new GridData();
- gd.horizontalSpan = 1;
+ gd.horizontalSpan = 1;
fMacroValueLabel.setLayoutData(gd);
-
+
fMacroValueEdit = new Text(comp, SWT.SINGLE | SWT.BORDER);
fMacroValueEdit.setFont(comp.getFont());
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -197,6 +200,7 @@ public class NewVarDialog extends Dialog {
gd.horizontalSpan = 1;
fMacroValueEdit.setLayoutData(gd);
fMacroValueEdit.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
handleMacroValueModified();
}
@@ -211,12 +215,12 @@ public class NewVarDialog extends Dialog {
handleBrowseButtonPressed();
}
});
-
+
gd = new GridData();
gd.widthHint = IDialogConstants.BUTTON_WIDTH;
gd.horizontalSpan = 1;
fBrowseButton.setLayoutData(gd);
-
+
fListEditorContainier = new Composite(comp,0);
gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 3;
@@ -236,7 +240,7 @@ public class NewVarDialog extends Dialog {
}
return comp;
}
-
+
/*
* get the names to be displayed in the var Name combo.
*/
@@ -250,7 +254,8 @@ public class NewVarDialog extends Dialog {
names[i] = vars[i].getName();
final Collator collator = Collator.getInstance();
Arrays.sort(names, new Comparator<String>() {
- public int compare(final String a, final String b) {
+ @Override
+ public int compare(final String a, final String b) {
final String strA = a.toUpperCase();
final String strB = b.toUpperCase();
return collator.compare(strA,strB);
@@ -276,7 +281,7 @@ public class NewVarDialog extends Dialog {
break;
}
}
-
+
private int getBrowseType(int type){
int browseType = IOption.BROWSE_NONE;
switch(type){
@@ -304,15 +309,15 @@ public class NewVarDialog extends Dialog {
*/
private void handleMacroNameSelection(){
int index = fMacroNameEdit.getSelectionIndex();
- if (index != -1)
+ if (index != -1)
loadVarSettings(fMacroNameEdit.getItem(index));
}
-
+
private void loadVarSettings(String name) {
ICdtVariable v = null;
for (int i=0; i<vars.length; i++) {
- if (vars[i].getName().equals(name)) {
- v = vars[i];
+ if (vars[i].getName().equals(name)) {
+ v = vars[i];
break;
}
}
@@ -321,21 +326,21 @@ public class NewVarDialog extends Dialog {
else
loadVar(name,IBuildMacro.VALUE_TEXT,EMPTY_STRING);
}
-
+
private void loadVar(String name, int type, String value[]){
setSelectedType(type);
setSelectedMacroName(notNull(name));
fListEditor.setList(value);
updateWidgetState();
}
-
+
private void loadVar(String name, int type, String value){
setSelectedType(type);
setSelectedMacroName(notNull(name));
fMacroValueEdit.setText(notNull(value));
updateWidgetState();
}
-
+
/*
* loads all the dialog fields with the variable settings
*/
@@ -355,14 +360,14 @@ public class NewVarDialog extends Dialog {
private String notNull(String str){
return str == null ? EMPTY_STRING : str;
}
-
+
/*
- * returns the name typed in the dialog var name edit triming spaces
+ * returns the name typed in the dialog var name edit triming spaces
*/
private String getSelectedVarName(){
return fMacroNameEdit.getText().trim();
}
-
+
/*
* sets the variable name to the dialog "variable name" edit control
*/
@@ -372,7 +377,7 @@ public class NewVarDialog extends Dialog {
fMacroNameEdit.setText(notNull(name).trim());
}
}
-
+
private boolean macroNamesEqual(String name1, String name2){
name1 = name1.trim();
name2 = name2.trim();
@@ -403,7 +408,7 @@ public class NewVarDialog extends Dialog {
return IBuildMacro.VALUE_TEXT;
}
}
-
+
/*
* sets the selected type
*/
@@ -436,7 +441,7 @@ public class NewVarDialog extends Dialog {
break;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
@@ -453,7 +458,7 @@ public class NewVarDialog extends Dialog {
super.okPressed();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#open()
*/
@@ -462,7 +467,7 @@ public class NewVarDialog extends Dialog {
fResultingMacro = null;
return super.open();
}
-
+
/*
* returns the macro value that should be stored in the resulting variable
*/
@@ -477,13 +482,13 @@ public class NewVarDialog extends Dialog {
/*
* this method should be called after the dialog is closed
* to obtain the created variable.
- * if the variable was not created, e.g. because a user has pressed
+ * if the variable was not created, e.g. because a user has pressed
* the cancel button this method returns null
*/
public ICdtVariable getDefinedMacro(){
return fResultingMacro;
}
-
+
/*
* called when the variable name is modified
*/
@@ -493,9 +498,9 @@ public class NewVarDialog extends Dialog {
loadVarSettings(name);
}
}
-
+
private void handleMacroValueModified(){}
-
+
/*
* called when the operation is modified
*/
@@ -503,12 +508,12 @@ public class NewVarDialog extends Dialog {
int type = getSelectedType();
if(fTypedType != -1 && fTypedType == type)
return;
-
+
fTypedType = type;
adjustLayout(type);
}
-
+
private void adjustLayout(int type){
GridData listGd = (GridData)fListEditorContainier.getLayoutData();
GridData labelGd = (GridData)fMacroValueLabel.getLayoutData();
@@ -525,7 +530,7 @@ public class NewVarDialog extends Dialog {
fMacroValueLabel.setVisible(false);
fMacroValueEdit.setVisible(false);
fBrowseButton.setVisible(false);
- } else
+ } else
{
listGd.exclude = true;
labelGd.exclude = false;
@@ -548,7 +553,7 @@ public class NewVarDialog extends Dialog {
fContainer.layout(true,true);
}
-
+
/*
* updates the state of the dialog controls
*/
@@ -563,7 +568,7 @@ public class NewVarDialog extends Dialog {
b.setEnabled(!EMPTY_STRING.equals(name));
}
}
-
+
@Override
protected Point getInitialSize() {
Point size = super.getInitialSize();
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyTab.java
index 1d1e556586..ab743994fd 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/RefreshPolicyTab.java
@@ -57,12 +57,12 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
* The RefreshPolicyTab allows users to modify a project's refresh settings for each build.
- *
+ *
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
* part of a work in progress. There is no guarantee that this API will work or
* that it will remain the same. Please do not use this API without consulting
* with the CDT team.
- *
+ *
* @author vkong
* @since 8.0
*/
@@ -73,38 +73,38 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
private final Image IMG_FILE = ManagedBuilderUIImages.get(ManagedBuilderUIImages.IMG_FILE_OBJ);
private final Image IMG_RESOURCE = ManagedBuilderUIImages.get(ManagedBuilderUIImages.IMG_FILE_FOLDER_OBJ);
private final Image IMG_EXCEPTION = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_REFACTORING_ERROR);
-
-
+
+
private final static int IDX_ADD_RESOURCE = 0;
private final static int IDX_ADD_EXCEPTION = 1;
private final static int IDX_EDIT_EXCEPTION = 2;
private final static int IDX_DELETE = 3;
-
+
private TreeViewer fTree;
private RefreshScopeManager fManager;
private IProject fProject;
-
+
private ArrayList<_Entry> fSrc;
private List<IResource> fResourcesToRefresh;
private HashMap<IResource, List<RefreshExclusion>> fResourceToExclusionsMap = new HashMap<IResource, List<RefreshExclusion>>();
-
-
+
+
public RefreshPolicyTab() {
- fManager = RefreshScopeManager.getInstance();
+ fManager = RefreshScopeManager.getInstance();
}
-
+
private void loadInfo() {
fResourcesToRefresh = new LinkedList<IResource>(fManager.getResourcesToRefresh(fProject));
if (fResourcesToRefresh != null) {
Iterator<IResource> iterator = fResourcesToRefresh.iterator();
while (iterator.hasNext()) {
- IResource resource = iterator.next();
+ IResource resource = iterator.next();
fResourceToExclusionsMap.put(resource, new LinkedList<RefreshExclusion>(fManager.getExclusions(resource)));
}
}
}
-
+
private List<RefreshExclusion> getExclusions(IResource resource) {
List<RefreshExclusion> exclusions = fResourceToExclusionsMap.get(resource);
if(exclusions == null) {
@@ -113,37 +113,37 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
}
return fResourceToExclusionsMap.get(resource);
}
-
+
/**
* Wrapper for IResource/RefreshExclusion
*/
class _Entry {
//if this is not a resource to refresh, resourceToRefresh will be null
- IResource resourceToRefresh = null;
-
+ IResource resourceToRefresh = null;
+
//if this is not a refresh exclusion, exclusion will be null
- RefreshExclusion exclusion = null;
-
+ RefreshExclusion exclusion = null;
+
//if this is a refresh exclusion, parent is the Exceptions node this is a child of
- _Exception_Node parent = null;
-
+ _Exception_Node parent = null;
+
// exceptions_node is the Exceptions node under this Entry, there should be a exceptions_node if this resource/refresh exclusion has nested exclusions
- _Exception_Node exceptions_node = null;
-
+ _Exception_Node exceptions_node = null;
+
// if this is a refresh exclusion, exclusion_instances is a list of exclusion instances associated with this exclusion
- List<_Exclusion_Instance> exclusion_instances = new ArrayList<_Exclusion_Instance>();
-
- _Entry(IResource _ent) {
+ List<_Exclusion_Instance> exclusion_instances = new ArrayList<_Exclusion_Instance>();
+
+ _Entry(IResource _ent) {
resourceToRefresh = _ent;
if (getExclusions(resourceToRefresh) != null && getExclusions(resourceToRefresh).size() > 0)
exceptions_node = new _Exception_Node(this);
}
-
- _Entry(RefreshExclusion _ent, _Exception_Node parent) {
+
+ _Entry(RefreshExclusion _ent, _Exception_Node parent) {
exclusion = _ent;
this.parent = parent;
if (exclusion.getNestedExclusions() != null && exclusion.getNestedExclusions().size() > 0) {
- exceptions_node = new _Exception_Node(this);
+ exceptions_node = new _Exception_Node(this);
}
if (exclusion.getExclusionInstances() != null && exclusion.getExclusionInstances().size() > 0) {
Iterator<ExclusionInstance> iterator = exclusion.getExclusionInstances().iterator();
@@ -153,15 +153,15 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
}
}
-
+
@Override
- public String toString() {
+ public String toString() {
if (isExclusion())
return exclusion.getName();
-
+
return resourceToRefresh.getFullPath().makeRelative().toString();
- }
-
+ }
+
public Object[] getChildren() {
if (isExclusion()) {
List<Object> children = new ArrayList<Object>(exclusion_instances);
@@ -169,24 +169,24 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
children.add(exceptions_node);
return children.toArray();
}
-
+
if (exceptions_node != null)
return new Object[] {exceptions_node};
-
+
return null;
}
-
+
public boolean isExclusion() {
return parent != null;
}
-
+
public void addException(RefreshExclusion exclusion) {
if (exceptions_node == null) {
exceptions_node = new _Exception_Node(this);
}
exceptions_node.addException(exclusion);
}
-
+
public void updateException(RefreshExclusion exclusion) {
List<ExclusionInstance> exclusionInstancesToAdd = exclusion.getExclusionInstances();
Iterator<ExclusionInstance> iterator = exclusionInstancesToAdd.iterator();
@@ -201,16 +201,16 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
public void remove() {
if (isExclusion()) {
RefreshExclusion exclusionToRemove = exclusion;
-
- _Entry parentEntry = parent.parent;
+
+ _Entry parentEntry = parent.parent;
if (parentEntry.isExclusion()) {
parentEntry.exclusion.removeNestedExclusion(exclusionToRemove);
} else {
List<RefreshExclusion> exceptions = getExclusions(parentEntry.resourceToRefresh);
exceptions.remove(exclusionToRemove);
}
-
- //update tree
+
+ //update tree
if (parent.exceptions.size() > 1) {
parent.exceptions.remove(this);
} else {
@@ -219,30 +219,30 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
} else { //this is a resource to refresh
fResourceToExclusionsMap.remove(resourceToRefresh);
fResourcesToRefresh.remove(resourceToRefresh);
- fSrc.remove(this);
- }
+ fSrc.remove(this);
+ }
}
}
-
+
class _Exception_Node {
_Entry parent; //can be IResource or RefreshExclusion - must not be null
-
+
//list of refresh exclusions under this Exceptions node
List <_Entry> exceptions = new ArrayList<_Entry>();
-
- _Exception_Node(_Entry ent) {
+
+ _Exception_Node(_Entry ent) {
parent = ent;
Iterator<RefreshExclusion> iterator = null;
-
+
if (parent.isExclusion()) {
if (parent.exclusion.getNestedExclusions() != null)
- iterator = parent.exclusion.getNestedExclusions().iterator();
+ iterator = parent.exclusion.getNestedExclusions().iterator();
} else {
if (getExclusions(parent.resourceToRefresh) != null)
iterator = getExclusions(parent.resourceToRefresh).iterator();
}
-
+
if (iterator != null) {
while (iterator.hasNext()) {
exceptions.add(new _Entry(iterator.next(), this));
@@ -250,11 +250,11 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
}
}
-
+
public void addException(RefreshExclusion exclusion) {
exceptions.add(new _Entry(exclusion, this));
if (parent.isExclusion()) {
- parent.exclusion.addNestedExclusion(exclusion);
+ parent.exclusion.addNestedExclusion(exclusion);
} else {
List<RefreshExclusion> exclusions = getExclusions(parent.resourceToRefresh);
if (exclusions == null) {
@@ -264,29 +264,29 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
exclusions.add(exclusion);
}
}
-
+
public Object[] getChildren() {
return exceptions.toArray();
}
-
+
@Override
public String toString() {
return Messages.RefreshPolicyTab_exceptionsLabel;
- }
+ }
}
-
+
/**
* Wrapper for ExclusionInstance
*/
class _Exclusion_Instance {
_Entry parent; //the parent refresh exclusion
ExclusionInstance instance = null;
-
- _Exclusion_Instance(ExclusionInstance instance, _Entry parent) {
+
+ _Exclusion_Instance(ExclusionInstance instance, _Entry parent) {
this.parent = parent;
this.instance = instance;
}
-
+
public Object[] getChildren() {
return null;
}
@@ -302,15 +302,15 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
public void remove() {
parent.exclusion.removeExclusionInstance(instance);
parent.exclusion_instances.remove(this);
-
+
if (parent.exclusion_instances.size() < 1 && parent.exclusion.supportsExclusionInstances()) {
parent.remove();
}
- }
+ }
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.cdt.ui.newui.AbstractCPropertyTab#createControls(org.eclipse.swt.widgets.Composite)
*/
@@ -325,15 +325,15 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
Messages.RefreshPolicyTab_editExceptionButtonLabel,
Messages.RefreshPolicyTab_deleteButtonLabel}, 120);
usercomp.setLayout(new GridLayout(1, false));
-
-
+
+
Label topLabel = new Label(usercomp, SWT.NONE);
topLabel.setText(Messages.RefreshPolicyTab_tabLabel);
Group g1 = setupGroup(usercomp, Messages.RefreshPolicyTab_resourcesGroupLabel, 2, GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
-
+
fSrc = new ArrayList<_Entry>();
generateTreeContent(fProject);
-
+
fTree = new TreeViewer(g1);
fTree.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
fTree.getTree().getAccessible().addAccessibleListener(
@@ -344,9 +344,10 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
}
}
);
-
+
fTree.setContentProvider(new ITreeContentProvider() {
- public Object[] getChildren(Object parentElement) {
+ @Override
+ public Object[] getChildren(Object parentElement) {
if (parentElement instanceof _Entry) {
return ((_Entry) parentElement).getChildren();
}
@@ -355,6 +356,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
}
return null;
}
+ @Override
public Object getParent(Object element) {
if (element instanceof _Entry)
return ((_Entry)element).parent;
@@ -364,13 +366,17 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
return ((_Exclusion_Instance)element).parent;
return null;
}
+ @Override
public boolean hasChildren(Object element) {
return (element instanceof _Entry || element instanceof _Exception_Node);
}
+ @Override
public Object[] getElements(Object inputElement) {
return fSrc.toArray(new _Entry[fSrc.size()]);
}
+ @Override
public void dispose() {}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}});
@@ -385,36 +391,37 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
return getImageForExclusionType(entry.exclusion.getExclusionType());
}
return getImageForResource(entry.resourceToRefresh);
- }
+ }
else if (element instanceof _Exclusion_Instance){
return getImageForExclusionType(((_Exclusion_Instance) element).instance.getExclusionType());
}
- else
+ else
return null;
}
});
-
+
fTree.addSelectionChangedListener(new ISelectionChangedListener() {
-
+
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
if (selection instanceof TreeSelection) {
Object sel = ((TreeSelection)selection).getFirstElement();
if ( sel != null && sel instanceof _Exception_Node) {
fTree.setSelection(null);
- }
+ }
}
- updateButtons();
+ updateButtons();
}
});
-
+
fTree.setInput(fSrc);
fTree.expandAll();
updateButtons();
-
+
}
-
+
private Image getImageForResource(IResource resource) {
switch (resource.getType()) {
case IResource.FILE:
@@ -426,7 +433,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
return IMG_RESOURCE;
}
}
-
+
private Image getImageForExclusionType(ExclusionType exclusionType) {
switch (exclusionType) {
case FILE:
@@ -436,7 +443,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
case RESOURCE:
default:
return IMG_RESOURCE;
- }
+ }
}
private void generateTreeContent(IProject project) {
@@ -470,9 +477,9 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
buttonSetEnabled(IDX_ADD_RESOURCE, true);
buttonSetEnabled(IDX_ADD_EXCEPTION, sel.length == 1 && sel[0].getData() instanceof _Entry);
buttonSetEnabled(IDX_EDIT_EXCEPTION, sel.length == 1 && sel[0].getData() instanceof _Entry && ((_Entry) sel[0].getData()).isExclusion());
- buttonSetEnabled(IDX_DELETE, sel.length == 1 && (sel[0].getData() instanceof _Entry || sel[0].getData() instanceof _Exclusion_Instance));
+ buttonSetEnabled(IDX_DELETE, sel.length == 1 && (sel[0].getData() instanceof _Entry || sel[0].getData() instanceof _Exclusion_Instance));
}
-
+
class FilteredContainerContentProvider extends ContainerContentProvider {
/* (non-Javadoc)
@@ -487,7 +494,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
}
return filteredChildren.toArray();
}
-
+
}
/* (non-Javadoc)
@@ -497,12 +504,12 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
protected void buttonPressed(int x) {
Shell shell = usercomp.getShell();
TreeSelection selection = (TreeSelection) fTree.getSelection();
-
+
switch (x) {
case IDX_ADD_RESOURCE:
//TODO: Phase one implementation - folders only - need to change this for Phase two
fResourcesToRefresh.size();
- CheckedTreeSelectionDialog addResourceDialog = new CheckedTreeSelectionDialog(shell, new WorkbenchLabelProvider(),
+ CheckedTreeSelectionDialog addResourceDialog = new CheckedTreeSelectionDialog(shell, new WorkbenchLabelProvider(),
new FilteredContainerContentProvider());
addResourceDialog.setInput(ResourcesPlugin.getWorkspace());
addResourceDialog.setTitle(Messages.RefreshPolicyTab_addResourceDialogTitle);
@@ -521,39 +528,39 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
fTree.expandAll();
}
break;
-
+
case IDX_ADD_EXCEPTION:
if (selection == null)
break;
_Entry sel = (_Entry) selection.getFirstElement();
- RefreshPolicyExceptionDialog addExceptionDialog;
+ RefreshPolicyExceptionDialog addExceptionDialog;
if (sel.isExclusion()) {
addExceptionDialog = new RefreshPolicyExceptionDialog(shell, sel.exclusion, true);
} else {
addExceptionDialog = new RefreshPolicyExceptionDialog(shell, sel.resourceToRefresh, getExclusions(sel.resourceToRefresh), true);
}
- if (addExceptionDialog.open() == Window.OK) {
+ if (addExceptionDialog.open() == Window.OK) {
RefreshExclusion newExclusion = addExceptionDialog.getResult();
- if (newExclusion != null)
+ if (newExclusion != null)
//update tree & the working copy of the model elements in this tab
sel.addException(newExclusion);
fTree.refresh();
fTree.expandAll();
- }
+ }
fTree.refresh();
fTree.expandAll();
break;
-
+
case IDX_EDIT_EXCEPTION: //can only edit a refresh exclusion
if (selection == null)
break;
_Entry selectedExclusion = (_Entry) selection.getFirstElement();
RefreshPolicyExceptionDialog editExceptionDialog;
-
+
editExceptionDialog = new RefreshPolicyExceptionDialog(shell, selectedExclusion.exclusion, false);
- if (editExceptionDialog.open() == Window.OK) {
+ if (editExceptionDialog.open() == Window.OK) {
RefreshExclusion updatedExclusion = editExceptionDialog.getResult();
-
+
//update tree
selectedExclusion.updateException(updatedExclusion);
fTree.refresh();
@@ -562,7 +569,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
fTree.refresh();
fTree.expandAll();
break;
-
+
case IDX_DELETE:
if (selection == null)
break;
@@ -574,7 +581,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
if (sel1.isExclusion()) {
question = Messages.RefreshPolicyTab_deleteConfirmationDialog_question_exception;
} else {
- question = Messages.RefreshPolicyTab_deleteConfirmationDialog_question_resource;
+ question = Messages.RefreshPolicyTab_deleteConfirmationDialog_question_resource;
}
if (MessageDialog.openQuestion(shell, Messages.RefreshPolicyTab_deleteConfirmationDialog_title, question)) {
remove = true;
@@ -587,7 +594,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
sel1.remove();
fTree.refresh();
fTree.expandAll();
- }
+ }
} else { //exclusion instance
_Exclusion_Instance sel1 = (_Exclusion_Instance) selection.getFirstElement();
boolean remove = false;
@@ -606,7 +613,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
}
}
break;
-
+
default:
break;
}
@@ -615,7 +622,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
/* (non-Javadoc)
* @see org.eclipse.cdt.ui.newui.AbstractCPropertyTab#performOK()
*/
- @Override
+ @Override
protected void performOK() {
fManager.setResourcesToRefresh(fProject, fResourcesToRefresh);
Iterator<IResource> iterator = fResourcesToRefresh.iterator();
@@ -625,7 +632,7 @@ public class RefreshPolicyTab extends AbstractCPropertyTab {
List<RefreshExclusion> exclusions = fResourceToExclusionsMap.get(resource);
fManager.setExclusions(resource, exclusions);
}
-
+
try {
fManager.persistSettings(getResDesc().getConfiguration().getProjectDescription());
} catch (CoreException e) {
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java
index 43bd6109bd..cdcfaa8fea 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Timesys - Initial API and implementation
+ * Timesys - Initial API and implementation
* IBM Rational Software
* Miwako Tokugawa (Intel Corporation) - bug 222817 (OptionCategoryApplicability)
*******************************************************************************/
@@ -42,6 +42,7 @@ public class ToolListContentProvider implements ITreeContentProvider{
/**
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {}
public ToolListContentProvider(int elementType) {
@@ -49,11 +50,11 @@ public class ToolListContentProvider implements ITreeContentProvider{
}
private ToolListElement[] createElements(IConfiguration config) {
- IOptionCategory toolChainCategories[];
+ IOptionCategory toolChainCategories[];
ITool filteredTools[];
List<ToolListElement> elementList = new ArrayList<ToolListElement>();
if (config != null) {
- // Get the the option categories of the toolChain
+ // Get the the option categories of the toolChain
IToolChain toolChain = config.getToolChain();
toolChainCategories = toolChain.getChildCategories();
// Create an element for each one
@@ -71,7 +72,7 @@ public class ToolListContentProvider implements ITreeContentProvider{
createChildElements(e,config);
}
}
- return elementList.toArray(new ToolListElement[elementList.size()]);
+ return elementList.toArray(new ToolListElement[elementList.size()]);
}
private ToolListElement[] createElements(IResourceInfo info) {
@@ -93,7 +94,7 @@ public class ToolListContentProvider implements ITreeContentProvider{
createChildElements(e);
}
}
- return elementList.toArray(new ToolListElement[elementList.size()]);
+ return elementList.toArray(new ToolListElement[elementList.size()]);
}
private void createChildElements(ToolListElement parentElement) {
createChildElements(parentElement,null);
@@ -119,10 +120,11 @@ public class ToolListContentProvider implements ITreeContentProvider{
}
}
}
-
+
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof IConfiguration ||
parentElement instanceof IResourceConfiguration ) {
@@ -130,10 +132,11 @@ public class ToolListContentProvider implements ITreeContentProvider{
}
return ((ToolListElement)parentElement).getChildElements();
}
-
+
/**
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return elements;
}
@@ -141,6 +144,7 @@ public class ToolListContentProvider implements ITreeContentProvider{
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
return ((ToolListElement)element).getParent();
}
@@ -148,6 +152,7 @@ public class ToolListContentProvider implements ITreeContentProvider{
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
@@ -155,6 +160,7 @@ public class ToolListContentProvider implements ITreeContentProvider{
/**
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput == null) return;
fInfo = (IResourceInfo)newInput;
@@ -162,7 +168,7 @@ public class ToolListContentProvider implements ITreeContentProvider{
elements = createElements(fInfo.getParent());
else
elements = createElements(fInfo);
-
+
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSelectionDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSelectionDialog.java
index ee6fe46d31..c598e95324 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSelectionDialog.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSelectionDialog.java
@@ -60,20 +60,20 @@ public class ToolSelectionDialog extends Dialog {
static private Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
static private Color red = Display.getDefault().getSystemColor(SWT.COLOR_RED);
static private Color gray = Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
-
+
private Table t1, t2;
private Button b_add, b_del, b_rep, b_all;
private CLabel errorLabel, l1;
private Text txt2;
private ArrayList<ITool> left, right;
- public ArrayList<ITool> added, removed;
+ public ArrayList<ITool> added, removed;
public ITool[] all, used;
public IFolderInfo fi;
public IToolListModification mod = null;
-
- public ToolSelectionDialog(Shell shell, IResourceInfo ri) {
- super (shell);
+
+ public ToolSelectionDialog(Shell shell, IResourceInfo ri) {
+ super (shell);
setShellStyle(getShellStyle() | SWT.RESIZE);
}
@@ -83,9 +83,9 @@ public class ToolSelectionDialog extends Dialog {
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
- shell.setText(Messages.ToolSelectionDialog_0);
+ shell.setText(Messages.ToolSelectionDialog_0);
}
-
+
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NULL);
@@ -99,7 +99,7 @@ public class ToolSelectionDialog extends Dialog {
removed = new ArrayList<ITool>();
left = new ArrayList<ITool>();
right = new ArrayList<ITool>();
-
+
Composite c1 = new Composite(composite, SWT.NONE);
c1.setLayoutData(new GridData(GridData.FILL_BOTH));
c1.setLayout(new GridLayout(1, false));
@@ -107,45 +107,49 @@ public class ToolSelectionDialog extends Dialog {
Composite c2 = new Composite(composite, SWT.BORDER);
c2.setLayoutData(new GridData(GridData.FILL_VERTICAL));
c2.setLayout(new GridLayout(1, false));
-
+
Composite c3 = new Composite(composite, SWT.NONE);
c3.setLayoutData(new GridData(GridData.FILL_BOTH));
c3.setLayout(new GridLayout(1, false));
-
+
t1 = new Table(c1, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
gd = new GridData(GridData.FILL_BOTH);
t1.setLayoutData(gd);
t1.setHeaderVisible(true);
t1.setLinesVisible(true);
t1.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
handleReplace();
}
+ @Override
public void widgetSelected(SelectionEvent e) {
handleSelection();
}});
-
+
TableColumn col = new TableColumn(t1, SWT.NONE);
- col.setText(Messages.ToolSelectionDialog_1);
+ col.setText(Messages.ToolSelectionDialog_1);
col.setWidth(COL_WIDTH);
-
+
l1 = new CLabel(c1, SWT.BORDER);
l1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
+
t2 = new Table(c3, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
t2.setLayoutData(new GridData(GridData.FILL_BOTH));
t2.setHeaderVisible(true);
t2.setLinesVisible(true);
t2.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
handleReplace();
}
+ @Override
public void widgetSelected(SelectionEvent e) {
handleSelection();
}});
-
+
col = new TableColumn(t2, SWT.NONE);
- col.setText(Messages.ToolSelectionDialog_2);
+ col.setText(Messages.ToolSelectionDialog_2);
col.setWidth(COL_WIDTH);
txt2 = new Text(c3, SWT.BORDER | SWT.WRAP | SWT.MULTI |
@@ -154,9 +158,9 @@ public class ToolSelectionDialog extends Dialog {
gd.verticalSpan = 2;
gd.minimumHeight = 100;
txt2.setLayoutData(gd);
-
+
b_add = new Button(c2, SWT.PUSH);
- b_add.setText(Messages.ToolSelectionDialog_12);
+ b_add.setText(Messages.ToolSelectionDialog_12);
b_add.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -172,16 +176,16 @@ public class ToolSelectionDialog extends Dialog {
b_add.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
b_rep = new Button(c2, SWT.PUSH);
- b_rep.setText(Messages.ToolSelectionDialog_14);
+ b_rep.setText(Messages.ToolSelectionDialog_14);
b_rep.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleReplace();
}});
b_rep.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
-
+
b_del = new Button(c2, SWT.PUSH);
- b_del.setText(Messages.ToolSelectionDialog_13);
+ b_del.setText(Messages.ToolSelectionDialog_13);
b_del.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b_del.addSelectionListener(new SelectionAdapter() {
@Override
@@ -192,18 +196,18 @@ public class ToolSelectionDialog extends Dialog {
ITool tool = (ITool)t2.getItem(x).getData();
right.remove(tool);
left.add(ManagedBuildManager.getRealTool(tool));
-
+
mod.changeProjectTools(tool, null);
-
+
updateData();
}});
b_del.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
-
- // Grabs all place
+
+ // Grabs all place
new Label(c2, SWT.NONE).setLayoutData(new GridData(GridData.FILL, SWT.FILL, true, true));
-
+
b_all = new Button(c2, SWT.CHECK | SWT.WRAP);
- b_all.setText(Messages.ToolSelectionDialog_15);
+ b_all.setText(Messages.ToolSelectionDialog_15);
b_all.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b_all.addSelectionListener(new SelectionAdapter() {
@Override
@@ -211,29 +215,29 @@ public class ToolSelectionDialog extends Dialog {
handleSelection();
}});
b_all.setLayoutData(new GridData(GridData.FILL, SWT.END, true, false));
-
+
errorLabel = new CLabel(composite, SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
errorLabel.setLayoutData(gd);
errorLabel.setForeground(red);
-
+
used = fi.getTools();
for (int i=0; i< used.length; i++) {
right.add(used[i]);
for (int j = 0; j<all.length; j++) {
- if (all[j] != null && all[j].matches(used[i]))
+ if (all[j] != null && all[j].matches(used[i]))
all[j] = null;
}
}
for (int j = 0; j<all.length; j++) {
- if (all[j] != null) left.add(all[j]);
- }
+ if (all[j] != null) left.add(all[j]);
+ }
updateData();
-
+
return composite;
}
-
+
/**
* Reaction for <Replace> button press or double-click.
*/
@@ -250,7 +254,7 @@ public class ToolSelectionDialog extends Dialog {
right.add(tool1);
right.remove(tool2);
left.add(ManagedBuildManager.getRealTool(tool2));
-
+
mod.changeProjectTools(tool2, tool1);
updateData();
@@ -267,16 +271,16 @@ public class ToolSelectionDialog extends Dialog {
ti.setImage((Image)null);
}
}
-
+
/**
* Adds "triangle" marks for items which can replace selected one.
- *
+ *
* @param src - table where selected element is located
* @param dst - table where marks should be set
* @param b - button (add or del) to be enabled
*/
private void markReplace(Table src, Table dst, Button b) {
- int x = src.getSelectionIndex();
+ int x = src.getSelectionIndex();
if (x == -1)
return;
ITool tool = (ITool)src.getItem(x).getData();
@@ -307,31 +311,31 @@ public class ToolSelectionDialog extends Dialog {
private void handleSelection() {
removeArrows(t1);
removeArrows(t2);
- b_add.setEnabled(b_all.getSelection() && t1.getItemCount() > 0);
- b_rep.setEnabled(b_all.getSelection() && t1.getItemCount() > 0 && t2.getItemCount() > 0);
+ b_add.setEnabled(b_all.getSelection() && t1.getItemCount() > 0);
+ b_rep.setEnabled(b_all.getSelection() && t1.getItemCount() > 0 && t2.getItemCount() > 0);
b_del.setEnabled(b_all.getSelection() && t2.getItemCount() > 0);
if (t1.isFocusControl()) {
markReplace(t1, t2, b_add);
int j = adjustPosition(t2);
markReplace(t2, t1, b_del);
- if (j != -1)
- b_rep.setEnabled(true);
+ if (j != -1)
+ b_rep.setEnabled(true);
} else {
markReplace(t2, t1, b_del);
int j = adjustPosition(t1);
markReplace(t1, t2, b_add);
if (j != -1)
- b_rep.setEnabled(true);
+ b_rep.setEnabled(true);
}
showErrorMessage(t1, false);
showErrorMessage(t2, true);
}
-
+
/**
* Changes position of inactive table
* to enable replacement, if possible.
- *
+ *
* returns new position or -1 if there's no tools to replace.
*/
private int adjustPosition(Table t) {
@@ -348,12 +352,12 @@ public class ToolSelectionDialog extends Dialog {
}
return -1;
}
-
+
/**
* Displays appropriate error message for selected tool.
- *
+ *
* @param t - affected table
- * @param isPrj - whether
+ * @param isPrj - whether
*/
private void showErrorMessage(Table t, boolean isPrj) {
int x = t.getSelectionIndex();
@@ -368,14 +372,14 @@ public class ToolSelectionDialog extends Dialog {
String message = EMPTY_STR;
Image image = null;
TableItem ti = t.getItem(x);
- ITool tool = (ITool)ti.getData();
+ ITool tool = (ITool)ti.getData();
IToolModification tm = mod.getToolModification(tool);
if (tm == null || tm.isCompatible()) {
if (IMG_ARROW.equals(ti.getImage()) && !isPrj) {
TableItem[] tis = t2.getSelection();
if (tis != null && tis.length > 0) {
- message = Messages.ToolSelectionDialog_16 +
- ((ITool)tis[0].getData()).getUniqueRealName();
+ message = Messages.ToolSelectionDialog_16 +
+ ((ITool)tis[0].getData()).getUniqueRealName();
}
}
} else {
@@ -396,8 +400,8 @@ public class ToolSelectionDialog extends Dialog {
}
/**
- * Adds given tool to the table, sets appropriate font.
- *
+ * Adds given tool to the table, sets appropriate font.
+ *
* @param tool - tool to add
* @param table - affected table
* @param bold - whether the tool should be marked by bold font.
@@ -406,13 +410,13 @@ public class ToolSelectionDialog extends Dialog {
IToolModification tm = mod.getToolModification(tool);
TableItem ti = new TableItem(table, 0);
ti.setText(tool.getUniqueRealName());
- if (bold)
+ if (bold)
ti.setFont(boldFont);
ti.setData(tool);
- if (tm != null /*&& table.equals(t2)*/ && !tm.isCompatible())
+ if (tm != null /*&& table.equals(t2)*/ && !tm.isCompatible())
ti.setForeground(table.equals(t2) ? red : gray);
}
-
+
/**
* Refresh data in t1 and t2 tables
*/
@@ -423,9 +427,9 @@ public class ToolSelectionDialog extends Dialog {
int t2_pos = t2.getSelectionIndex();
t1.removeAll();
t2.removeAll();
-
+
Collections.sort(left, BuildListComparator.getInstance());
-
+
for (ITool t : left) {
boolean exists = false;
for (int i=0; i<all.length; i++) {
@@ -449,7 +453,7 @@ public class ToolSelectionDialog extends Dialog {
add(t, t2, !exists);
}
IModificationStatus st = fi.getToolChainModificationStatus(
- removed.toArray(new ITool[removed.size()]),
+ removed.toArray(new ITool[removed.size()]),
added.toArray(new ITool[added.size()]));
if (st.isOK()) {
errorLabel.setText(EMPTY_STR);
@@ -459,13 +463,13 @@ public class ToolSelectionDialog extends Dialog {
int c = st.getCode();
String s = EMPTY_STR;
if ((c & IModificationStatus.TOOLS_CONFLICT) != 0) {
- s = s + Messages.ToolSelectionDialog_7;
+ s = s + Messages.ToolSelectionDialog_7;
ITool[][] tools = st.getToolsConflicts();
List<String> conflictTools = new ArrayList<String>();
for (int k=0; k<t2.getItemCount(); k++) {
TableItem ti = t2.getItem(k);
ITool t = (ITool)ti.getData();
- loop:
+ loop:
for (int i=0;i<tools.length;i++) {
for (int j=0;j<tools[i].length;j++) {
if (t.matches(tools[i][j])) {
@@ -484,7 +488,7 @@ public class ToolSelectionDialog extends Dialog {
}
}
if ((c & IModificationStatus.TOOLS_DONT_SUPPORT_MANAGED_BUILD) != 0) {
- s = s + Messages.ToolSelectionDialog_8;
+ s = s + Messages.ToolSelectionDialog_8;
ITool[] tools = st.getNonManagedBuildTools();
for (int k=0; k<t2.getItemCount(); k++) {
TableItem ti = t2.getItem(k);
@@ -498,13 +502,13 @@ public class ToolSelectionDialog extends Dialog {
}
}
if ((c & IModificationStatus.PROPS_NOT_DEFINED) != 0) {
- s = s + Messages.ToolSelectionDialog_9;
+ s = s + Messages.ToolSelectionDialog_9;
}
if ((c & IModificationStatus.PROPS_NOT_SUPPORTED) != 0) {
- s = s + Messages.ToolSelectionDialog_10;
+ s = s + Messages.ToolSelectionDialog_10;
}
if ((c & IModificationStatus.REQUIRED_PROPS_NOT_SUPPORTED) != 0) {
- s = s + Messages.ToolSelectionDialog_11;
+ s = s + Messages.ToolSelectionDialog_11;
}
errorLabel.setText(s);
// if(getButton(IDialogConstants.OK_ID) != null)
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsPrefStore.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsPrefStore.java
index d9e17f1d7d..f1f0ec3eae 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsPrefStore.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsPrefStore.java
@@ -43,10 +43,10 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
private final static String EMPTY_STRING = new String();
static ToolSettingsPrefStore store = null;
-
+
public final static String ALL_OPTIONS_ID = EMPTY_STRING;
public final static String COMMAND_LINE_SUFFIX = "org.eclipse.commandLinePatternId"; //$NON-NLS-1$
- private IResourceInfo rcInfo = null;
+ private IResourceInfo rcInfo = null;
private IOptionCategory optCategory;
private ToolListElement selectedElement;
private ListenerList listenerList;
@@ -57,7 +57,7 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
store = new ToolSettingsPrefStore();
return store;
}
-
+
public void setSelection(ICResourceDescription rd, ToolListElement element, IOptionCategory category){
selectedElement = element;
optCategory = category;
@@ -67,7 +67,7 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
public IConfiguration getSelectedConfig(){
return rcInfo.getParent();
}
-
+
public String getOptionId(IOption option){
IOption extOption = getExtensionOption(option);
if(extOption != null)
@@ -76,18 +76,20 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
}
private static IOption getExtensionOption(IOption option){
- for(;option != null && (!option.isExtensionElement()
+ for(;option != null && (!option.isExtensionElement()
|| ((Option)option).isAdjustedExtension()
|| ((Option)option).wasOptRef());
option = option.getSuperClass()){}
-
+
return option;
}
-
+
+ @Override
public void addPropertyChangeListener(IPropertyChangeListener listener) {
listenerList.add(listener);
}
+ @Override
public boolean contains(String name) {
if(optCategory instanceof Tool){
if(optCategory.getId().equals(name))
@@ -102,13 +104,14 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
return false;
}
+ @Override
public void firePropertyChangeEvent(String name, Object oldValue,
Object newValue) {
Object[] listeners = listenerList.getListeners();
- if (listeners.length > 0 && (oldValue == null || !oldValue.equals(newValue)))
+ if (listeners.length > 0 && (oldValue == null || !oldValue.equals(newValue)))
{
PropertyChangeEvent pe = new PropertyChangeEvent(this, name, oldValue, newValue);
- for (int i = 0; i < listeners.length; ++i)
+ for (int i = 0; i < listeners.length; ++i)
{
IPropertyChangeListener l = (IPropertyChangeListener)listeners[i];
l.propertyChange( pe );
@@ -116,6 +119,7 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
}
}
+ @Override
public boolean getBoolean(String name) {
Object val = getOptionValue(name);
if(val instanceof Boolean)
@@ -123,26 +127,37 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
return getDefaultBoolean(name);
}
+ @Override
public boolean getDefaultBoolean(String name) { return false; }
+ @Override
public double getDefaultDouble(String name) { return 0; }
+ @Override
public float getDefaultFloat(String name) { return 0; }
+ @Override
public int getDefaultInt(String name) { return 0; }
+ @Override
public long getDefaultLong(String name) { return 0; }
+ @Override
public String getDefaultString(String name) { return EMPTY_STRING; }
+ @Override
public double getDouble(String name) {
return getDefaultDouble(name);
}
+ @Override
public float getFloat(String name) {
return getDefaultFloat(name);
}
+ @Override
public int getInt(String name) {
return getDefaultInt(name);
}
+ @Override
public long getLong(String name) {
return getDefaultLong(name);
}
+ @Override
@SuppressWarnings("unchecked")
public String getString(String name) {
if(optCategory instanceof Tool){
@@ -156,7 +171,7 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
String[] flags = tool.getToolCommandFlags(
null,
null,
- macroSubstitutor,
+ macroSubstitutor,
obtainMacroProvider());
IManagedCommandLineGenerator cmdLGen = tool.getCommandLineGenerator();
IManagedCommandLineInfo cmdLInfo = cmdLGen.generateCommandLineInfo(tool,
@@ -171,24 +186,24 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
else if(val instanceof Collection)
return listToString((String[])((Collection)val).toArray(new String[0]));
}
-
+
return getDefaultString(name);
}
-
+
public BuildMacroProvider obtainMacroProvider(){
return (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
}
-
+
public static String listToString(String[] items) {
return listToString(items,DEFAULT_SEPERATOR);
}
-
+
protected Object getOptionValue(String name){
Object option[] = getOption(name);
if(option != null){
try {
- IOption opt = (IOption)option[1];
+ IOption opt = (IOption)option[1];
Object val = opt.getValue();
if(opt.getValueType() == IOption.ENUMERATED && val instanceof String)
val = opt.getEnumName((String)val);
@@ -198,25 +213,25 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
}
return null;
}
-
+
public Object[] getOption(String id){
- if (selectedElement == null)
+ if (selectedElement == null)
return null;
-
+
IHoldsOptions selectedHolder = selectedElement.getHoldOptions();
- if (selectedHolder == null)
+ if (selectedHolder == null)
selectedHolder = selectedElement.getTool();
Object options[][] = optCategory.getOptions(rcInfo, selectedHolder);
if (options == null)
return null;
-
+
for(int i = 0; i < options.length; i++){
IHoldsOptions ho = (IHoldsOptions)options[i][0];
- if(ho == null)
+ if(ho == null)
break;
-
+
IOption option = (IOption)options[i][1];
-
+
if( ( option.getId().equals(id))
|| ((!option.isExtensionElement() || ((Option)option).isAdjustedExtension() || ((Option)option).wasOptRef())
&& option.getSuperClass() != null
@@ -224,29 +239,45 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
return options[i];
}
return null;
-
+
}
+ @Override
public boolean isDefault(String name) { return false;}
+ @Override
public boolean needsSaving() { return dirtyFlag;}
+ @Override
public void putValue(String name, String value) {setValue(name,value);}
+ @Override
public void removePropertyChangeListener(IPropertyChangeListener listener) {
listenerList.remove(listener);
}
+ @Override
public void setDefault(String name, double value) {}
+ @Override
public void setDefault(String name, float value) {}
+ @Override
public void setDefault(String name, int value) {}
+ @Override
public void setDefault(String name, long value) {}
+ @Override
public void setDefault(String name, String defaultObject) {}
+ @Override
public void setDefault(String name, boolean value) {}
+ @Override
public void setToDefault(String name) {}
protected void setDirty( boolean isDirty ) {dirtyFlag = isDirty;}
+ @Override
public void setValue(String name, double value) {}
+ @Override
public void setValue(String name, float value) {}
+ @Override
public void setValue(String name, int value) {}
+ @Override
public void setValue(String name, long value) {}
+ @Override
public void setValue(String name, String value) {
if(optCategory instanceof Tool){
if(optCategory.getId().equals(name))
@@ -257,10 +288,11 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
setOptionValue(name,value);
}
+ @Override
public void setValue(String name, boolean value) {
setOptionValue(name,new Boolean(value));
}
-
+
protected void setOptionValue(String name, Object value){
Object opt[] = getOption(name);
if(opt != null){
@@ -284,7 +316,7 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
if(value instanceof String){
String val = (String)value;
String enumId = option.getEnumeratedId(val);
- newOption = rcInfo.setOption(holder, option,
+ newOption = rcInfo.setOption(holder, option,
(enumId != null && enumId.length() > 0) ? enumId : val);
}
break;
@@ -311,7 +343,7 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
default:
break;
}
-
+
if(newOption != option){
//TODO: ???
}
@@ -319,7 +351,7 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
}
}
}
-
+
public static String[] parseString(String stringList) {
if (stringList == null || stringList.length() == 0) {
return new String[0];
@@ -327,10 +359,10 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
return stringList.split(DEFAULT_SEPERATOR);
}
}
-
+
public static String listToString(String items[], String separator){
StringBuffer path = new StringBuffer(""); //$NON-NLS-1$
-
+
for (int i = 0; i < items.length; i++) {
path.append(items[i]);
if (i < (items.length - 1)) {
@@ -343,15 +375,15 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
private IResourceInfo get(ICResourceDescription cfgd) {
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgd.getConfiguration());
if (cfgd.getType() == ICSettingBase.SETTING_PROJECT ||
- cfgd.getType() == ICSettingBase.SETTING_CONFIGURATION)
+ cfgd.getType() == ICSettingBase.SETTING_CONFIGURATION)
return cfg.getRootFolderInfo();
-
+
IPath p = cfgd.getPath();
IResourceInfo ri = cfg.getResourceInfo(p, true);
if (ri != null && p.equals(ri.getPath())) {
return ri;
}
-
+
if (cfgd.getType() == ICSettingBase.SETTING_FILE) {
ri = cfg.createFileInfo(p);
} else if (cfgd.getType() == ICSettingBase.SETTING_FOLDER) {
@@ -359,5 +391,5 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
}
return ri;
}
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java
index e7db85b348..db5056087e 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java
@@ -65,7 +65,7 @@ import org.eclipse.swt.widgets.ScrollBar;
/**
* Tool Settings Tab in project properties Build Settings
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -158,6 +158,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
protected void createSelectionArea (Composite parent) {
optionList = new TreeViewer(parent, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER);
optionList.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
handleOptionSelection();
}});
@@ -200,7 +201,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
if (tipText==null) {
return;
}
- tipText.setText(Messages.ToolSettingsTab_0);
+ tipText.setText(Messages.ToolSettingsTab_0);
tipText.update();
}
@@ -342,7 +343,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
private void createTipArea (Composite parent) {
tipText = new StyledText(parent, SWT.V_SCROLL|SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP);
tipText.setLayoutData(new GridData(GridData.FILL_BOTH));
- tipText.setText(Messages.ToolSettingsTab_0);
+ tipText.setText(Messages.ToolSettingsTab_0);
styleRange = new StyleRange();
styleRange.start = 0;
@@ -515,7 +516,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
// Reset the category or tool selection and run selection event handler
selectedElement = null;
setDirty(true);
-
+
fInfo = getResCfg(getResDesc());
setValues();
handleOptionSelection();
@@ -543,7 +544,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
/**
* @param filter - a viewer filter
* @see StructuredViewer#addFilter(ViewerFilter)
- *
+ *
* @since 5.1
*/
protected void addFilter(ViewerFilter filter) {
@@ -660,6 +661,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
return pages;
}
+ @Override
public IPreferenceStore getPreferenceStore() {
return settingsStore;
}
@@ -741,7 +743,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
copyHoldsOptions(pair.getKey(), pair.getValue(), ri2);
}
setDirty(false);
-
+
updateData(getResDesc());
}
@@ -802,7 +804,9 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
// IPreferencePageContainer methods
@Override
public void updateButtons() {}
+ @Override
public void updateMessage() {}
+ @Override
public void updateTitle() {}
@Override
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CDTConfigWizardPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CDTConfigWizardPage.java
index 3223a96131..a0568bd7a8 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CDTConfigWizardPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CDTConfigWizardPage.java
@@ -58,9 +58,9 @@ public class CDTConfigWizardPage extends WizardPage {
public static final String PAGE_ID = "org.eclipse.cdt.managedbuilder.ui.wizard.CConfigWizardPage"; //$NON-NLS-1$
private static final Image IMG_CONFIG = ManagedBuilderUIImages.get(ManagedBuilderUIImages.IMG_BUILD_CONFIG);
- private static final String TITLE = Messages.CConfigWizardPage_0;
- private static final String MESSAGE = Messages.CConfigWizardPage_1;
- private static final String COMMENT = Messages.CConfigWizardPage_12;
+ private static final String TITLE = Messages.CConfigWizardPage_0;
+ private static final String MESSAGE = Messages.CConfigWizardPage_1;
+ private static final String COMMENT = Messages.CConfigWizardPage_12;
private static final String EMPTY_STR = ""; //$NON-NLS-1$
private Table table;
@@ -79,7 +79,7 @@ public class CDTConfigWizardPage extends WizardPage {
IWizardPage[] customPages = null;
public CDTConfigWizardPage(MBSWizardHandler h) {
- super(Messages.CDTConfigWizardPage_0);
+ super(Messages.CDTConfigWizardPage_0);
setPageComplete(false);
handler = h;
setWizard(h.getWizard());
@@ -100,6 +100,7 @@ public class CDTConfigWizardPage extends WizardPage {
return its;
}
+ @Override
public void createControl(Composite p) {
parent = new Composite(p, SWT.NONE);
parent.setFont(parent.getFont());
@@ -110,11 +111,11 @@ public class CDTConfigWizardPage extends WizardPage {
c1.setLayout(new GridLayout(2, false));
c1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- setupLabel(c1, Messages.CConfigWizardPage_4, GridData.BEGINNING);
+ setupLabel(c1, Messages.CConfigWizardPage_4, GridData.BEGINNING);
l_projtype = setupLabel(c1, EMPTY_STR, GridData.FILL_HORIZONTAL);
- setupLabel(c1, Messages.CConfigWizardPage_5, GridData.BEGINNING);
+ setupLabel(c1, Messages.CConfigWizardPage_5, GridData.BEGINNING);
l_chains = setupLabel(c1, EMPTY_STR, GridData.FILL_HORIZONTAL);
- setupLabel(c1, Messages.CConfigWizardPage_6, GridData.BEGINNING);
+ setupLabel(c1, Messages.CConfigWizardPage_6, GridData.BEGINNING);
setupLabel(c1, EMPTY_STR, GridData.BEGINNING);
Composite c2 = new Composite(parent, SWT.NONE);
@@ -127,10 +128,13 @@ public class CDTConfigWizardPage extends WizardPage {
tv = new CheckboxTableViewer(table);
tv.setContentProvider(new IStructuredContentProvider() {
+ @Override
public Object[] getElements(Object inputElement) {
return (Object[])inputElement;
}
+ @Override
public void dispose() {}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
});
tv.setLabelProvider(new LabelProvider() {
@@ -142,6 +146,7 @@ public class CDTConfigWizardPage extends WizardPage {
public Image getImage(Object element) { return IMG_CONFIG; }
});
tv.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
setPageComplete(isCustomPageComplete());
update();
@@ -151,7 +156,7 @@ public class CDTConfigWizardPage extends WizardPage {
c.setLayout(new GridLayout());
Button b1 = new Button(c, SWT.PUSH);
- b1.setText(Messages.CConfigWizardPage_7);
+ b1.setText(Messages.CConfigWizardPage_7);
b1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b1.addSelectionListener(new SelectionAdapter() {
@Override
@@ -162,7 +167,7 @@ public class CDTConfigWizardPage extends WizardPage {
}});
Button b2 = new Button(c, SWT.PUSH);
- b2.setText(Messages.CConfigWizardPage_8);
+ b2.setText(Messages.CConfigWizardPage_8);
b2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b2.addSelectionListener(new SelectionAdapter() {
@Override
@@ -176,7 +181,7 @@ public class CDTConfigWizardPage extends WizardPage {
new Label(c, 0).setLayoutData(new GridData(GridData.FILL_BOTH));
Button b3 = new Button(c, SWT.PUSH);
- b3.setText(Messages.CConfigWizardPage_13);
+ b3.setText(Messages.CConfigWizardPage_13);
b3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b3.addSelectionListener(new SelectionAdapter() {
@Override
@@ -214,10 +219,10 @@ public class CDTConfigWizardPage extends WizardPage {
for (int j=0; j<cfgs.length; j++) {
if (cfgs[j].isSystem() || (handler.supportedOnly() && !cfgs[j].isSupported())
// Bug 335338 don't include project type configurations if we're not creating a project-typed project
- // Project types are non-default if their nameAttribute != "" (see: ManagedBuildWizard: "old style project types")
- || (pt == null && cfgs[j].getConfiguration() != null &&
- cfgs[j].getConfiguration().getProjectType() != null &&
- cfgs[j].getConfiguration().getProjectType().getNameAttribute().length() > 0))
+ // Project types are non-default if their nameAttribute != "" (see: ManagedBuildWizard: "old style project types")
+ || (pt == null && cfgs[j].getConfiguration() != null &&
+ cfgs[j].getConfiguration().getProjectType() != null &&
+ cfgs[j].getConfiguration().getProjectType().getNameAttribute().length() > 0))
continue;
out.add(cfgs[j]);
}
@@ -252,12 +257,12 @@ public class CDTConfigWizardPage extends WizardPage {
return true;
if (table.getItemCount() == 0) {
- errorMessage = Messages.CConfigWizardPage_10;
+ errorMessage = Messages.CConfigWizardPage_10;
message = errorMessage;
return false;
}
if (tv.getCheckedElements().length == 0) {
- errorMessage = Messages.CConfigWizardPage_11;
+ errorMessage = Messages.CConfigWizardPage_11;
message = errorMessage;
return false;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java
index c299f6ff5a..5d3ff735f0 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java
@@ -11,7 +11,7 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.wizards;
-
+
import java.util.ArrayList;
import java.util.List;
@@ -49,15 +49,15 @@ import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
-
+
private static final String WZ_TITLE = "WizardMakeProjectConversion.title"; //$NON-NLS-1$
private static final String WZ_DESC = "WizardMakeProjectConversion.description"; //$NON-NLS-1$
-
+
/**
* @since 5.1
*/
protected CWizardHandler h_selected = null;
-
+
// widgets
private Button specifyProjectTypeButton;
private Tree tree;
@@ -145,6 +145,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
final IWizardItemsListListener filter = new IWizardItemsListListener() {
// Show only category
+ @Override
public List<EntryDescriptor> filterItems(
List<? extends EntryDescriptor> items) {
List<EntryDescriptor> results = new ArrayList<EntryDescriptor>();
@@ -158,10 +159,12 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
return results;
}
+ @Override
public boolean isCurrent() {
return true;
}
+ @Override
public void toolChainListChanged(int count) {
// Do nothing
}
@@ -231,7 +234,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
protected String getWzTitleResource(){
return MakeUIPlugin.getResourceString(WZ_TITLE);
}
-
+
/**
* Method getWzDescriptionResource returns the correct description
* Label for this class overriding the default in the superclass.
@@ -240,21 +243,21 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
protected String getWzDescriptionResource(){
return MakeUIPlugin.getResourceString(WZ_DESC);
}
-
+
/**
* Method isCandidate returns true for:
* - non-CDT projects
* - old style Make CDT projects
- * So new model projects and
+ * So new model projects and
* old style managed projects
* are refused.
*/
@Override
public boolean isCandidate(IProject project) {
- boolean a = !AbstractPage.isCDTPrj(project);
+ boolean a = !AbstractPage.isCDTPrj(project);
boolean b = ManagedBuilderCorePlugin.getDefault().isOldStyleMakeProject(project);
- return a || b;
- }
+ return a || b;
+ }
@Override
public void convertProject(IProject project, String bsId, IProgressMonitor monitor) throws CoreException{
@@ -262,7 +265,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
try {
if (ManagedBuilderCorePlugin.getDefault().isOldStyleMakeProject(project)) {
ManagedBuilderCorePlugin.getDefault().convertOldStdMakeToNewStyle(project, monitor);
- } else {
+ } else {
super.convertProject(project, bsId, new SubProgressMonitor(monitor, 1));
if (isSetProjectType()) {
h_selected.convertProject(project, monitor);
@@ -279,7 +282,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
try {
if (ManagedBuilderCorePlugin.getDefault().isOldStyleMakeProject(project)) {
ManagedBuilderCorePlugin.getDefault().convertOldStdMakeToNewStyle(project, monitor);
- } else {
+ } else {
super.convertProject(project, new SubProgressMonitor(monitor, 1), projectID);
if (isSetProjectType()) {
h_selected.convertProject(project, monitor);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPage.java
index 808af0b1c9..51af6a3923 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPage.java
@@ -18,7 +18,7 @@ import org.eclipse.jface.wizard.IWizardPage;
/**
* This abstract class provides a convenient, partial implementation of the IWizardPage interface.
* This class consults with the MBSCustomPageManager to determine its actions.
-
+
* If an ISV's custom pages do not subclass MBSCustomPage then their page implementation must be
* carefully coded to function properly while still respecting the rules laid out by the page manager.
*/
@@ -27,7 +27,7 @@ public abstract class MBSCustomPage implements IWizardPage
protected String pageID = null;
protected IWizard wizard = null;
-
+
/**
* Constructor which sets the (required) pageID.
* @param pageID identifies this page including for accessing the page data.
@@ -35,7 +35,7 @@ public abstract class MBSCustomPage implements IWizardPage
public MBSCustomPage(String pageID) {
this.pageID=pageID;
}
-
+
/**
* 0-argument constructor, which is generally what will be invoked by the standard, custom wizard
* page system. It is assumed that either statically, or in the constructor for your derived class,
@@ -44,18 +44,20 @@ public abstract class MBSCustomPage implements IWizardPage
*/
public MBSCustomPage() {
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardPage#isCustomPageComplete()
*/
+ @Override
public boolean canFlipToNextPage() {
return (getNextPage() != null && isCustomPageComplete());
-
+
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardPage#getWizard()
*/
+ @Override
public IWizard getWizard()
{
return wizard;
@@ -64,6 +66,7 @@ public abstract class MBSCustomPage implements IWizardPage
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardPage#setPreviousPage
*/
+ @Override
public void setPreviousPage(IWizardPage page)
{
// do nothing, we use the page manager
@@ -73,15 +76,17 @@ public abstract class MBSCustomPage implements IWizardPage
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardPage#setWizard()
*/
+ @Override
public void setWizard(IWizard newWizard)
{
wizard = newWizard;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardPage#getNextPage()
*/
+ @Override
public IWizardPage getNextPage()
{
// consult with the page manager to determine which pages are to be displayed
@@ -91,25 +96,27 @@ public abstract class MBSCustomPage implements IWizardPage
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardPage#getPreviousPage()
*/
+ @Override
public IWizardPage getPreviousPage()
{
// consult with the page manager to determine which pages are to be displayed
return MBSCustomPageManager.getPreviousPage(pageID);
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardPage#isPageComplete()
*/
+ @Override
public boolean isPageComplete()
{
/* Since the wizard must have all the pages added to it regardless of whether they are visible
* or not, this method consults the page manager to see if the page is visible. If it is not,
* then the page is always considered complete. If the page is visible then the child class is
- * consulted to see if it determines the page to be complete based on its own criteria.
+ * consulted to see if it determines the page to be complete based on its own criteria.
*/
-
+
// if we are not visible then return true so that the wizard can enable the Finish button
if (!MBSCustomPageManager.isPageVisible(pageID))
{
@@ -130,7 +137,7 @@ public abstract class MBSCustomPage implements IWizardPage
/**
* @return true if the page is complete, false otherwise. This method is called to determine
* the status of the wizard's Finish button.
- *
+ *
* @see org.eclipse.jface.wizard.IWizardPage#isPageComplete()
*/
protected abstract boolean isCustomPageComplete();
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageData.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageData.java
index bc1b93f4e7..b7de02591e 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageData.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageData.java
@@ -4,7 +4,7 @@
* 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
- *
+ *
* Contributors:
* Texas Instruments - initial API and implementation
* IBM Corporation
@@ -87,8 +87,9 @@ public final class MBSCustomPageData
}
/**
- *
+ *
*/
+ @Override
public int compareTo(Object arg0) {
if (arg0 == null || !(arg0 instanceof ToolchainData))
return 0;
@@ -113,7 +114,7 @@ public final class MBSCustomPageData
/**
* Contstructs a custom page data record
- *
+ *
* @param id - Unique ID of the page
* @param wizardPage - the IWizardPage that is displayed in the wizard
* @param operation - the Runnable() that is executed during the wizard's DoRunEpilogue() method, or null if no operation is specified
@@ -128,7 +129,7 @@ public final class MBSCustomPageData
/**
* Contstructs a custom page data record
- *
+ *
* @param id - Unique ID of the page
* @param wizardPage - the IWizardPage that is displayed in the wizard
* @param operation - the Runnable() that is executed during the wizard's DoRunEpilogue() method, or null if no operation is specified
@@ -165,7 +166,7 @@ public final class MBSCustomPageData
/**
* @return true if this page is a stock page provided by the Managed Build System, false otherwise.
- * @since 3.0
+ * @since 3.0
*/
public boolean isStockPage()
{
@@ -179,15 +180,15 @@ public final class MBSCustomPageData
* org.eclipse.cdt.core.cnature and org.eclipse.cdt.core.ccnature
* @return true if the page should be visible when the project has the given nature, false otherwise.
* @since 3.0
- *
+ *
* Nature can be either string (old mode) or Set (new mode) or null.
* New mode allows to take into account several natures per project.
- * Accepting null allows to process projects w/o nature
+ * Accepting null allows to process projects w/o nature
* @since 4.0
*/
public boolean shouldBeVisibleForNature(Object nature)
{
- if (natureSet == null) return true;
+ if (natureSet == null) return true;
if (nature == null) return false;
if (nature instanceof String) // old style
@@ -196,7 +197,7 @@ public final class MBSCustomPageData
Iterator it = ((Set)nature).iterator();
while (it.hasNext()) {
String s = it.next().toString();
- if (hasNature(s)) return true;
+ if (hasNature(s)) return true;
}
}
return false; // no one nature fits or bad data
@@ -215,7 +216,7 @@ public final class MBSCustomPageData
{
if (natureSet == null || natureSet.size() == 0)
return null;
-
+
Object[] objArray = natureSet.toArray();
String[] strArray = new String[objArray.length];
@@ -230,7 +231,7 @@ public final class MBSCustomPageData
/**
* @param id - The unique ID of the toolchain
- * @param version - The version of the toolchain, or <code>null</code> if versions are not to be checked.
+ * @param version - The version of the toolchain, or <code>null</code> if versions are not to be checked.
* @return true if the page should be present for the given toolchain and version, false otherwise.
* @since 3.0
*/
@@ -239,7 +240,7 @@ public final class MBSCustomPageData
// if no toolchains specified then always return true
if (toolchainSet.size() == 0)
return true;
-
+
Iterator iterator = toolchainSet.iterator();
while (iterator.hasNext())
{
@@ -311,7 +312,7 @@ public final class MBSCustomPageData
/**
* Adds a dependency to this page upon a given nature. The page will be visible
* iff the given nature is selected by the user.
- *
+ *
* @param nature The unique ID of the nature.
* @since 3.0
*/
@@ -330,7 +331,7 @@ public final class MBSCustomPageData
* Adds a dependency to this page upon a given toolchain. The page will be visible
* iff one or more of the selected project configurations utilizes the specified toolchain.
* If versions are specified, then the version of the toolchain must exactly match one of the specified versions.
- *
+ *
* @param toolchainID - The unique ID of the toolchain.
* @param versionsSupported - A comma separated list of supported versions, or null if no version checking is to be done.
* @since 3.0
@@ -339,7 +340,7 @@ public final class MBSCustomPageData
{
if(toolchainID == null)
return;
-
+
if (toolchainSet == null)
toolchainSet = new TreeSet();
@@ -354,34 +355,34 @@ public final class MBSCustomPageData
* @param projectType The unique ID of the project type to check.
* @return true if this page should be visible if the given project type is selected, false otherwise.
* @since 3.0
- *
+ *
* Type can be either string (old mode) or Set (new mode) or null.
* New mode allows to take into account several types per project,
- * or types absence in some cases
+ * or types absence in some cases
* @since 4.0
*/
public boolean shouldBeVisibleForProjectType(Object projectType)
{
if (projectTypeSet == null) return true;
- if (projectType == null) return false;
-
+ if (projectType == null) return false;
+
if (projectType instanceof String)
return projectTypeSet.contains(projectType);
else if (projectType instanceof Set) {
Iterator it = ((Set)projectType).iterator();
while (it.hasNext()) {
String s = it.next().toString();
- if (projectTypeSet.contains(s))
- return true;
+ if (projectTypeSet.contains(s))
+ return true;
}
- }
- return false; // no one type fits
+ }
+ return false; // no one type fits
}
/**
* Adds a dependency to this page upon a given project type. The page will be visible
* iff the given project type is selected by the user.
- *
+ *
* @param projectType - The unique ID of the project type.
* @since 3.0
*/
@@ -389,7 +390,7 @@ public final class MBSCustomPageData
{
if(projectType == null)
return;
-
+
if (projectTypeSet == null)
projectTypeSet = new TreeSet();
@@ -406,12 +407,13 @@ public final class MBSCustomPageData
{
return operation;
}
-
+
private static IRunnableWithProgress convertRunnable(final Runnable runnable) {
if (runnable == null) {
return null;
}
return new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
runnable.run();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java
index 3e5767ffab..6fb3743574 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java
@@ -51,7 +51,8 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation;
public class NewMakeProjFromExisting extends Wizard implements IImportWizard, INewWizard {
NewMakeProjFromExistingPage page;
-
+
+ @Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
setWindowTitle(Messages.NewMakeProjFromExisting_0);
}
@@ -68,33 +69,33 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
final String locationStr = page.getLocation();
final boolean isCPP = page.isCPP();
final IToolChain toolChain = page.getToolChain();
-
+
IRunnableWithProgress op = new WorkspaceModifyOperation() {
@Override
protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException,
InterruptedException {
monitor.beginTask(Messages.NewMakeProjFromExisting_1, 10);
-
+
// Create Project
try {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IProject project = workspace.getRoot().getProject(projectName);
-
+
// TODO handle the case where a .project file was already there
-
+
IProjectDescription description = workspace.newProjectDescription(projectName);
IPath defaultLocation = workspace.getRoot().getLocation().append(projectName);
Path location = new Path(locationStr);
if (!location.isEmpty() && !location.equals(defaultLocation)) {
description.setLocation(location);
}
-
+
CCorePlugin.getDefault().createCDTProject(description, project, monitor);
-
+
// Optionally C++ natures
if (isCPP)
CCProjectNature.addCCNature(project, new SubProgressMonitor(monitor, 1));
-
+
// Set up build information
ICProjectDescriptionManager pdMgr = CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription projDesc = pdMgr.createProjectDescription(project, false);
@@ -102,7 +103,7 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
ManagedProject mProj = new ManagedProject(projDesc);
info.setManagedProject(mProj);
monitor.worked(1);
-
+
CfgHolder cfgHolder = new CfgHolder(toolChain, null);
String s = toolChain == null ? "0" : ((ToolChain)toolChain).getId(); //$NON-NLS-1$
Configuration config = new Configuration(mProj, (ToolChain)toolChain, ManagedBuildManager.calculateChildId(s, null), cfgHolder.getName());
@@ -111,7 +112,7 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
CConfigurationData data = config.getConfigurationData();
projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
monitor.worked(1);
-
+
pdMgr.setProjectDescription(project, projDesc);
} catch (Throwable e) {
ManagedBuilderUIPlugin.log(e);
@@ -119,7 +120,7 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
monitor.done();
}
};
-
+
try {
getContainer().run(true, true, op);
} catch (InvocationTargetException e) {
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java
index 31e61531ff..c9b5918221 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java
@@ -39,7 +39,7 @@ import org.eclipse.swt.widgets.Text;
/**
* Page to select existing code location and toolchain.
- *
+ *
* @since 7.0
*/
public class NewMakeProjFromExistingPage extends WizardPage {
@@ -51,21 +51,22 @@ public class NewMakeProjFromExistingPage extends WizardPage {
IWorkspaceRoot root;
List tcList;
Map<String, IToolChain> tcMap = new HashMap<String, IToolChain>();
-
+
protected NewMakeProjFromExistingPage() {
super(Messages.NewMakeProjFromExistingPage_0);
setTitle(Messages.NewMakeProjFromExistingPage_1);
setDescription(Messages.NewMakeProjFromExistingPage_2);
-
+
root = ResourcesPlugin.getWorkspace().getRoot();
}
+ @Override
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
comp.setLayout(layout);
comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
+
addProjectNameSelector(comp);
addSourceSelector(comp);
addLanguageSelector(comp);
@@ -81,16 +82,17 @@ public class NewMakeProjFromExistingPage extends WizardPage {
group.setLayout(layout);
group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
group.setText(Messages.NewMakeProjFromExistingPage_3);
-
+
projectName = new Text(group, SWT.BORDER);
projectName.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
projectName.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validateProjectName();
}
});
}
-
+
public void validateProjectName() {
String name = projectName.getText();
IProject project = root.getProject(name);
@@ -99,7 +101,7 @@ public class NewMakeProjFromExistingPage extends WizardPage {
else
setErrorMessage(null);
}
-
+
public void addSourceSelector(Composite parent) {
Group group = new Group(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -107,20 +109,22 @@ public class NewMakeProjFromExistingPage extends WizardPage {
group.setLayout(layout);
group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
group.setText(Messages.NewMakeProjFromExistingPage_5);
-
+
location = new Text(group, SWT.BORDER);
location.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
location.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validateSource();
}
});
validateSource();
-
+
Button browse = new Button(group, SWT.NONE);
browse.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
browse.setText(Messages.NewMakeProjFromExistingPage_6);
browse.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog dialog = new DirectoryDialog(location.getShell());
dialog.setMessage(Messages.NewMakeProjFromExistingPage_7);
@@ -128,12 +132,13 @@ public class NewMakeProjFromExistingPage extends WizardPage {
if (dir != null)
location.setText(dir);
}
-
+
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}
});
}
-
+
void validateSource() {
File file= new File(location.getText());
if (file.isDirectory()) {
@@ -142,7 +147,7 @@ public class NewMakeProjFromExistingPage extends WizardPage {
} else
setErrorMessage(Messages.NewMakeProjFromExistingPage_8);
}
-
+
public void addLanguageSelector(Composite parent) {
Group group = new Group(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -150,47 +155,47 @@ public class NewMakeProjFromExistingPage extends WizardPage {
group.setLayout(layout);
group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
group.setText(Messages.NewMakeProjFromExistingPage_9);
-
+
// TODO, should be a way to dynamically list these
langc = new Button(group, SWT.CHECK);
langc.setText("C"); //$NON-NLS-1$
langc.setSelection(true);
-
+
langcpp = new Button(group, SWT.CHECK);
langcpp.setText("C++"); //$NON-NLS-1$
langcpp.setSelection(true);
}
-
+
public void addToolchainSelector(Composite parent) {
Group group = new Group(parent, SWT.NONE);
GridLayout layout = new GridLayout();
group.setLayout(layout);
group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
group.setText(Messages.NewMakeProjFromExistingPage_10);
-
+
tcList = new List(group, SWT.SINGLE);
group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
tcList.add(Messages.NewMakeProjFromExistingPage_11);
-
+
IToolChain[] toolChains = ManagedBuildManager.getRealToolChains();
for (IToolChain toolChain : toolChains) {
if (toolChain.isAbstract() || toolChain.isSystemObject())
continue;
tcMap.put(toolChain.getUniqueRealName(), toolChain);
}
-
+
ArrayList<String> names = new ArrayList<String>(tcMap.keySet());
Collections.sort(names);
for (String name : names)
tcList.add(name);
-
+
tcList.setSelection(0); // select <none>
}
-
+
public String getProjectName() {
return projectName.getText();
}
-
+
public String getLocation() {
return location.getText();
}
@@ -198,11 +203,11 @@ public class NewMakeProjFromExistingPage extends WizardPage {
public boolean isC() {
return langc.getSelection();
}
-
+
public boolean isCPP() {
return langcpp.getSelection();
}
-
+
public IToolChain getToolChain() {
String[] selection = tcList.getSelection();
return selection.length != 0 ? tcMap.get(selection[0]) : null;

Back to the top