Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAlena Laskavaia2009-01-15 20:19:35 +0000
committerAlena Laskavaia2009-01-15 20:19:35 +0000
commitc83ea0d247e138ddd67e558065728d29d1e1d934 (patch)
tree5cd666b3f7c42f072ca7e9652384350b69aa6440 /build
parent160d1da8649807e03dc92227e0bf512e9ea86633 (diff)
downloadorg.eclipse.cdt-c83ea0d247e138ddd67e558065728d29d1e1d934.tar.gz
org.eclipse.cdt-c83ea0d247e138ddd67e558065728d29d1e1d934.tar.xz
org.eclipse.cdt-c83ea0d247e138ddd67e558065728d29d1e1d934.zip
[171814] - added checkbox for make name same as target name, patch
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties11
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java36
2 files changed, 41 insertions, 6 deletions
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
index d4a0a0b25b7..9d178cb0eee 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
@@ -61,9 +61,10 @@ WizardCheckboxTablePart.WizardCheckboxTablePart.counter={0} of {1} Selected
SettingsBlock.label=Make Builder
SettingsBlock.message=Make builder settings.
-SettingsBlock.makeSetting.group_label=Build Setting
-SettingsBlock.makeSetting.stopOnError=Stop on first build error.
-SettingsBlock.makeSetting.runAllBuilders=Run all project builders.
+SettingsBlock.makeSetting.group_label=Build Settings
+SettingsBlock.makeSetting.stopOnError=Stop on first build error
+SettingsBlock.makeSetting.runAllBuilders=Run all project builders
+SettingsBlock.makeSetting.sameAsTarget=Same as the Target Name
SettingsBlock.makeCmd.group_label=Build command
SettingsBlock.makeCmd.use_default=Use default
SettingsBlock.makeCmd.label=Build command:
@@ -133,8 +134,8 @@ BuildTargetDialog.title.makeTargetsFor=Make Targets for:
MakeTargetDialog.exception.noTargetBuilderOnProject=Not target builders on the project
MakeTargetDialog.title.createMakeTarget=Create a new Make target
MakeTargetDialog.title.modifyMakeTarget=Modify a Make target
-MakeTargetDialog.message.mustSpecifyName=Must specify a target name.
-MakeTargetDialog.message.targetWithNameExists=Target with that name already exits.
+MakeTargetDialog.message.mustSpecifyName=Must specify a non-empty Target Name
+MakeTargetDialog.message.targetWithNameExists=Target with that name already exits
MakeTargetDialog.message.mustSpecifyBuildCommand=Must specify a build command
MakeTargetDialog.button.update=Update
MakeTargetDialog.button.create=Create
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java
index 77ccd7d0df9..782cb6f1caa 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java
@@ -26,6 +26,8 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
@@ -79,6 +81,7 @@ public class MakeTargetDialog extends Dialog {
private String targetBuildID;
protected IMakeTarget fTarget;
private boolean initializing = true;
+ private Button sameAsNameCheck;
/**
* A Listener class to verify correctness of input and display an error message
@@ -282,6 +285,22 @@ public class MakeTargetDialog extends Dialog {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = convertWidthInCharsToPixels(50);
group.setLayoutData(gd);
+
+ sameAsNameCheck = new Button(group, SWT.CHECK);
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ sameAsNameCheck.setLayoutData(gd);
+ sameAsNameCheck.setText(MakeUIPlugin.getResourceString("SettingsBlock.makeSetting.sameAsTarget")); //$NON-NLS-1$
+
+ /* Add a listener to the target name text to update the targetText */
+ targetNameText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ if (sameAsNameCheck.getSelection()) {
+ targetText.setText(targetNameText.getText());
+ }
+ }
+ });
+
Label label = ControlFactory.createLabel(group, MakeUIPlugin.getResourceString(BUILD_ARGUMENT_LABEL));
((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING;
((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false;
@@ -290,11 +309,26 @@ public class MakeTargetDialog extends Dialog {
((GridData) (targetText.getLayoutData())).grabExcessHorizontalSpace = true;
targetText.setText(targetString);
targetText.addListener(SWT.Modify, new Listener() {
-
public void handleEvent(Event e) {
updateButtons();
}
});
+
+ sameAsNameCheck.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ sameAsNameSelected();
+ }
+ });
+ /* set sameAsNameCheck if targetName and targetString are equal */
+ sameAsNameCheck.setSelection(targetString.equals(targetName) || (targetString.length()==0 && targetName==null));
+ sameAsNameSelected();
+ }
+
+ protected void sameAsNameSelected() {
+ targetText.setEnabled(!sameAsNameCheck.getSelection());
+ if (sameAsNameCheck.getSelection()) {
+ targetText.setText(targetNameText.getText());
+ }
}
protected void createButtonsForButtonBar(Composite parent) {

Back to the top