mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
[171814] - added checkbox for make name same as target name, patch
This commit is contained in:
parent
160d1da864
commit
c83ea0d247
2 changed files with 41 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue