mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 11:25:35 +02:00
[179937] Ensure that the encoding group grabs horizontal space in the file property page.
This commit is contained in:
parent
9cacea7c6d
commit
62ec8d72f9
1 changed files with 18 additions and 11 deletions
|
@ -46,6 +46,7 @@ import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.events.SelectionListener;
|
import org.eclipse.swt.events.SelectionListener;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Combo;
|
import org.eclipse.swt.widgets.Combo;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
@ -179,10 +180,13 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
// indicates that it supports encodings
|
// indicates that it supports encodings
|
||||||
if (file.getParentRemoteFileSubSystem().supportsEncoding()) {
|
if (file.getParentRemoteFileSubSystem().supportsEncoding()) {
|
||||||
|
|
||||||
|
SystemWidgetHelpers.createLabel(composite_prompts, "", 2); //$NON-NLS-1$
|
||||||
|
|
||||||
// encoding field
|
// encoding field
|
||||||
Group encodingGroup = SystemWidgetHelpers.createGroupComposite(composite_prompts, 2, SystemFileResources.RESID_PP_FILE_ENCODING_GROUP_LABEL);
|
Group encodingGroup = SystemWidgetHelpers.createGroupComposite(composite_prompts, 2, SystemFileResources.RESID_PP_FILE_ENCODING_GROUP_LABEL);
|
||||||
GridData data = new GridData();
|
GridData data = new GridData();
|
||||||
data.horizontalAlignment = SWT.BEGINNING;
|
data.horizontalSpan = 2;
|
||||||
|
data.horizontalAlignment = SWT.FILL;
|
||||||
data.grabExcessHorizontalSpace = true;
|
data.grabExcessHorizontalSpace = true;
|
||||||
data.verticalAlignment = SWT.BEGINNING;
|
data.verticalAlignment = SWT.BEGINNING;
|
||||||
data.grabExcessVerticalSpace = false;
|
data.grabExcessVerticalSpace = false;
|
||||||
|
@ -210,12 +214,20 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
defaultEncodingButton.setLayoutData(data);
|
defaultEncodingButton.setLayoutData(data);
|
||||||
defaultEncodingButton.addSelectionListener(buttonSelectionListener);
|
defaultEncodingButton.addSelectionListener(buttonSelectionListener);
|
||||||
|
|
||||||
|
Composite otherComposite = new Composite(encodingGroup, SWT.NONE);
|
||||||
|
GridLayout otherLayout = new GridLayout();
|
||||||
|
otherLayout.numColumns = 2;
|
||||||
|
otherLayout.marginWidth = 0;
|
||||||
|
otherLayout.marginHeight = 0;
|
||||||
|
otherComposite.setLayout(otherLayout);
|
||||||
|
otherComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
|
||||||
|
|
||||||
// other encoding field
|
// other encoding field
|
||||||
otherEncodingButton = SystemWidgetHelpers.createRadioButton(encodingGroup, null, SystemFileResources.RESID_PP_FILE_ENCODING_OTHER_LABEL, SystemFileResources.RESID_PP_FILE_ENCODING_OTHER_TOOLTIP);
|
otherEncodingButton = SystemWidgetHelpers.createRadioButton(otherComposite, null, SystemFileResources.RESID_PP_FILE_ENCODING_OTHER_LABEL, SystemFileResources.RESID_PP_FILE_ENCODING_OTHER_TOOLTIP);
|
||||||
otherEncodingButton.addSelectionListener(buttonSelectionListener);
|
otherEncodingButton.addSelectionListener(buttonSelectionListener);
|
||||||
|
|
||||||
// other encoding combo
|
// other encoding combo
|
||||||
otherEncodingCombo = SystemWidgetHelpers.createCombo(encodingGroup, null, SystemFileResources.RESID_PP_FILE_ENCODING_ENTER_TOOLTIP);
|
otherEncodingCombo = SystemWidgetHelpers.createCombo(otherComposite, null, SystemFileResources.RESID_PP_FILE_ENCODING_ENTER_TOOLTIP);
|
||||||
data = new GridData();
|
data = new GridData();
|
||||||
data.horizontalAlignment = SWT.BEGINNING;
|
data.horizontalAlignment = SWT.BEGINNING;
|
||||||
data.grabExcessHorizontalSpace = true;
|
data.grabExcessHorizontalSpace = true;
|
||||||
|
@ -233,14 +245,9 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Label emptyLabel = new Label(composite_prompts, SWT.NONE);
|
SystemWidgetHelpers.createLabel(encodingGroup, ""); //$NON-NLS-1$
|
||||||
emptyLabel.setText("");
|
|
||||||
data = new GridData();
|
SystemWidgetHelpers.createLabel(composite_prompts, "", 2); //$NON-NLS-1$
|
||||||
data.horizontalAlignment = SWT.BEGINNING;
|
|
||||||
data.grabExcessHorizontalSpace = false;
|
|
||||||
data.verticalAlignment = SWT.BEGINNING;
|
|
||||||
data.grabExcessVerticalSpace = true;
|
|
||||||
emptyLabel.setLayoutData(data);
|
|
||||||
|
|
||||||
encodingFieldAdded = true;
|
encodingFieldAdded = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue