mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 461378
Adding margins to configure settings pages. Change-Id: Ic9e8df3d73f66a47a53726c8fc115f3397436c37 Signed-off-by: mazab <mohamed_azab@mentor.com>
This commit is contained in:
parent
cf6b8c725f
commit
ed26026034
2 changed files with 33 additions and 14 deletions
|
@ -21,12 +21,14 @@ import org.eclipse.jface.preference.StringFieldEditor;
|
||||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
|
||||||
public class AutotoolsCategoryPropertyOptionPage extends
|
public class AutotoolsCategoryPropertyOptionPage extends
|
||||||
AbstractConfigurePropertyOptionsPage {
|
AbstractConfigurePropertyOptionsPage {
|
||||||
|
|
||||||
|
private static final int MARGIN = 3;
|
||||||
private String catName = "";
|
private String catName = "";
|
||||||
private IAConfiguration cfg;
|
private IAConfiguration cfg;
|
||||||
// Label class for a preference page.
|
// Label class for a preference page.
|
||||||
|
@ -81,6 +83,17 @@ public class AutotoolsCategoryPropertyOptionPage extends
|
||||||
protected void createFieldEditors() {
|
protected void createFieldEditors() {
|
||||||
super.createFieldEditors();
|
super.createFieldEditors();
|
||||||
Composite parent = getFieldEditorParent();
|
Composite parent = getFieldEditorParent();
|
||||||
|
|
||||||
|
// Add margin
|
||||||
|
parent.setLayout(new GridLayout(1, false));
|
||||||
|
Composite area = new Composite(parent, SWT.NONE);
|
||||||
|
GridLayout gl = new GridLayout(1, false);
|
||||||
|
gl.marginTop = MARGIN;
|
||||||
|
gl.marginLeft = MARGIN;
|
||||||
|
gl.marginRight = MARGIN;
|
||||||
|
area.setLayout(gl);
|
||||||
|
area.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
|
||||||
|
|
||||||
// FontMetrics fm = AbstractCPropertyTab.getFontMetrics(parent);
|
// FontMetrics fm = AbstractCPropertyTab.getFontMetrics(parent);
|
||||||
AutotoolsConfiguration.Option[] options = AutotoolsConfiguration.getChildOptions(catName);
|
AutotoolsConfiguration.Option[] options = AutotoolsConfiguration.getChildOptions(catName);
|
||||||
for (int i = 0; i < options.length; ++i) {
|
for (int i = 0; i < options.length; ++i) {
|
||||||
|
@ -89,23 +102,20 @@ public class AutotoolsCategoryPropertyOptionPage extends
|
||||||
case IConfigureOption.STRING:
|
case IConfigureOption.STRING:
|
||||||
case IConfigureOption.INTERNAL:
|
case IConfigureOption.INTERNAL:
|
||||||
case IConfigureOption.MULTIARG:
|
case IConfigureOption.MULTIARG:
|
||||||
parent = getFieldEditorParent();
|
StringFieldEditor f = new StringFieldEditor(option.getName(), option.getDescription(), area);
|
||||||
StringFieldEditor f = new StringFieldEditor(option.getName(), option.getDescription(), 20, parent);
|
f.getLabelControl(area).setToolTipText(option.getToolTip());
|
||||||
f.getLabelControl(parent).setToolTipText(option.getToolTip());
|
|
||||||
addField(f);
|
addField(f);
|
||||||
fieldEditors.add(f);
|
fieldEditors.add(f);
|
||||||
break;
|
break;
|
||||||
case IConfigureOption.BIN:
|
case IConfigureOption.BIN:
|
||||||
case IConfigureOption.FLAGVALUE:
|
case IConfigureOption.FLAGVALUE:
|
||||||
parent = getFieldEditorParent();
|
BooleanFieldEditor b = new BooleanFieldEditor(option.getName(), option.getDescription(), area);
|
||||||
BooleanFieldEditor b = new BooleanFieldEditor(option.getName(), option.getDescription(), parent);
|
b.getDescriptionControl(area).setToolTipText(option.getToolTip());
|
||||||
b.getDescriptionControl(parent).setToolTipText(option.getToolTip());
|
|
||||||
addField(b);
|
addField(b);
|
||||||
fieldEditors.add(b);
|
fieldEditors.add(b);
|
||||||
break;
|
break;
|
||||||
case IConfigureOption.FLAG:
|
case IConfigureOption.FLAG:
|
||||||
parent = getFieldEditorParent();
|
FieldEditor l = createLabelEditor(area, option.getDescription());
|
||||||
FieldEditor l = createLabelEditor(parent, option.getDescription());
|
|
||||||
addField(l);
|
addField(l);
|
||||||
fieldEditors.add(l);
|
fieldEditors.add(l);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -20,12 +20,14 @@ import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.graphics.FontMetrics;
|
import org.eclipse.swt.graphics.FontMetrics;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
|
||||||
public class AutotoolsToolPropertyOptionPage extends
|
public class AutotoolsToolPropertyOptionPage extends
|
||||||
AbstractConfigurePropertyOptionsPage {
|
AbstractConfigurePropertyOptionsPage {
|
||||||
|
|
||||||
|
private static final int MARGIN = 3;
|
||||||
private ToolListElement element;
|
private ToolListElement element;
|
||||||
private String toolName = "";
|
private String toolName = "";
|
||||||
private IAConfiguration cfg;
|
private IAConfiguration cfg;
|
||||||
|
@ -84,20 +86,27 @@ public class AutotoolsToolPropertyOptionPage extends
|
||||||
super.createFieldEditors();
|
super.createFieldEditors();
|
||||||
// Add a string editor to edit the tool command
|
// Add a string editor to edit the tool command
|
||||||
Composite parent = getFieldEditorParent();
|
Composite parent = getFieldEditorParent();
|
||||||
FontMetrics fm = AbstractCPropertyTab.getFontMetrics(parent);
|
parent.setLayout(new GridLayout(1, false));
|
||||||
|
Composite area = new Composite(parent, SWT.NONE);
|
||||||
|
GridLayout gl = new GridLayout(1, false);
|
||||||
|
gl.marginTop = MARGIN;
|
||||||
|
gl.marginLeft = MARGIN;
|
||||||
|
gl.marginRight = MARGIN;
|
||||||
|
area.setLayout(gl);
|
||||||
|
area.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
|
||||||
|
FontMetrics fm = AbstractCPropertyTab.getFontMetrics(area);
|
||||||
commandStringField = new StringFieldEditor(toolName,
|
commandStringField = new StringFieldEditor(toolName,
|
||||||
ConfigureMessages.getString(COMMAND),
|
ConfigureMessages.getString(COMMAND),
|
||||||
parent);
|
area);
|
||||||
commandStringField.setEmptyStringAllowed(false);
|
commandStringField.setEmptyStringAllowed(false);
|
||||||
GridData gd = ((GridData)commandStringField.getTextControl(parent).getLayoutData());
|
GridData gd = ((GridData)commandStringField.getTextControl(area).getLayoutData());
|
||||||
gd.grabExcessHorizontalSpace = true;
|
gd.grabExcessHorizontalSpace = true;
|
||||||
gd.minimumWidth = Dialog.convertWidthInCharsToPixels(fm, 3);
|
gd.minimumWidth = Dialog.convertWidthInCharsToPixels(fm, 3);
|
||||||
addField(commandStringField);
|
addField(commandStringField);
|
||||||
// Add a field editor that displays overall build options
|
// Add a field editor that displays overall build options
|
||||||
Composite par = getFieldEditorParent();
|
|
||||||
allOptionFieldEditor = new MultiLineTextFieldEditor(AutotoolsConfigurePrefStore.ALL_OPTIONS_ID,
|
allOptionFieldEditor = new MultiLineTextFieldEditor(AutotoolsConfigurePrefStore.ALL_OPTIONS_ID,
|
||||||
ConfigureMessages.getString(ALL_OPTIONS), par);
|
ConfigureMessages.getString(ALL_OPTIONS), area);
|
||||||
allOptionFieldEditor.getTextControl(par).setEditable(false);
|
allOptionFieldEditor.getTextControl(area).setEditable(false);
|
||||||
// gd = ((GridData)allOptionFieldEditor.getTextControl().getLayoutData());
|
// gd = ((GridData)allOptionFieldEditor.getTextControl().getLayoutData());
|
||||||
gd.grabExcessHorizontalSpace = true;
|
gd.grabExcessHorizontalSpace = true;
|
||||||
gd.minimumWidth = Dialog.convertWidthInCharsToPixels(fm, 20);
|
gd.minimumWidth = Dialog.convertWidthInCharsToPixels(fm, 20);
|
||||||
|
|
Loading…
Add table
Reference in a new issue