Skip to content

Commit 79068d2

Browse files
committed
Modified the UI to show controls in a single line
Change-Id: I6a08929ccbfea821f5b9a30097503c10d3bcf916
1 parent d06e971 commit 79068d2

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ public class WorkbenchMessages extends NLS {
745745
// ==============================================================================
746746
public static String PinEditorAction_toolTip;
747747
public static String WorkbenchPreference_reuseEditors;
748-
public static String WorkbenchPreference_reuseEditorsThreshold;
748+
public static String WorkbenchPreference_reuseEditors_closing;
749749
public static String WorkbenchPreference_reuseEditorsThresholdError;
750750
public static String WorkbenchPreference_recentFiles;
751751
public static String WorkbenchPreference_recentFilesError;

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/EditorsPreferencePage.java

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,22 @@
1818

1919
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
2020

21+
import org.eclipse.jface.layout.GridDataFactory;
22+
import org.eclipse.jface.layout.GridLayoutFactory;
2123
import org.eclipse.jface.preference.FieldEditor;
2224
import org.eclipse.jface.preference.IPreferenceStore;
2325
import org.eclipse.jface.preference.IntegerFieldEditor;
2426
import org.eclipse.jface.preference.PreferencePage;
2527
import org.eclipse.jface.preference.StringFieldEditor;
2628
import org.eclipse.jface.util.IPropertyChangeListener;
29+
import org.eclipse.jface.widgets.LabelFactory;
2730
import org.eclipse.osgi.util.NLS;
2831
import org.eclipse.swt.SWT;
2932
import org.eclipse.swt.layout.GridData;
3033
import org.eclipse.swt.layout.GridLayout;
3134
import org.eclipse.swt.widgets.Button;
3235
import org.eclipse.swt.widgets.Composite;
3336
import org.eclipse.swt.widgets.Control;
34-
import org.eclipse.swt.widgets.Group;
3537
import org.eclipse.ui.IWorkbench;
3638
import org.eclipse.ui.IWorkbenchPreferenceConstants;
3739
import org.eclipse.ui.IWorkbenchPreferencePage;
@@ -47,9 +49,8 @@
4749
* The Editors preference page of the workbench.
4850
*/
4951
public class EditorsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
50-
private static final int REUSE_INDENT = 20;
5152

52-
protected Group editorReuseGroup;
53+
protected Composite editorReuseGroup;
5354

5455
private Button reuseEditors;
5556

@@ -213,14 +214,9 @@ protected void updateValidState() {
213214
* preferences.
214215
*/
215216
protected void createEditorReuseGroup(Composite composite) {
216-
editorReuseGroup = new Group(composite, SWT.LEFT);
217-
GridLayout layout = new GridLayout();
218-
// Line up with other entries in preference page
219-
layout.marginWidth = 0;
220-
layout.marginHeight = 0;
221-
editorReuseGroup.setLayout(layout);
217+
editorReuseGroup = new Composite(composite, SWT.LEFT);
218+
editorReuseGroup.setLayout(GridLayoutFactory.fillDefaults().numColumns(3).spacing(0, 0).create());
222219
editorReuseGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
223-
editorReuseGroup.setText(WorkbenchMessages.WorkbenchPreference_closeMode);
224220

225221
reuseEditors = new Button(editorReuseGroup, SWT.CHECK);
226222
reuseEditors.setText(WorkbenchMessages.WorkbenchPreference_reuseEditors);
@@ -234,20 +230,20 @@ protected void createEditorReuseGroup(Composite composite) {
234230
}));
235231

236232
editorReuseIndentGroup = new Composite(editorReuseGroup, SWT.LEFT);
237-
GridLayout indentLayout = new GridLayout();
238-
indentLayout.marginLeft = REUSE_INDENT;
239-
indentLayout.marginWidth = 0;
240-
editorReuseIndentGroup.setLayout(indentLayout);
241-
editorReuseIndentGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
233+
editorReuseIndentGroup.setLayout(GridLayoutFactory.fillDefaults().create());
234+
editorReuseIndentGroup
235+
.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
242236

243237
editorReuseThresholdGroup = new Composite(editorReuseIndentGroup, SWT.LEFT);
244-
layout = new GridLayout();
238+
GridLayout layout = new GridLayout();
245239
layout.marginWidth = 0;
246240
editorReuseThresholdGroup.setLayout(layout);
247-
editorReuseThresholdGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
241+
editorReuseThresholdGroup
242+
.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
248243

249-
reuseEditorsThreshold = new IntegerFieldEditor(IPreferenceConstants.REUSE_EDITORS,
250-
WorkbenchMessages.WorkbenchPreference_reuseEditorsThreshold, editorReuseThresholdGroup);
244+
reuseEditorsThreshold = new IntegerFieldEditor(IPreferenceConstants.REUSE_EDITORS, "", //$NON-NLS-1$
245+
editorReuseThresholdGroup);
246+
reuseEditorsThreshold.getLabelControl(editorReuseThresholdGroup).dispose();
251247

252248
reuseEditorsThreshold.setPreferenceStore(WorkbenchPlugin.getDefault().getPreferenceStore());
253249
reuseEditorsThreshold.setPage(this);
@@ -260,6 +256,8 @@ protected void createEditorReuseGroup(Composite composite) {
260256
reuseEditorsThreshold.getTextControl(editorReuseThresholdGroup).setEnabled(reuseEditors.getSelection());
261257
reuseEditorsThreshold.setPropertyChangeListener(validityChangeListener);
262258

259+
LabelFactory.newLabel(SWT.NONE).text(WorkbenchMessages.WorkbenchPreference_reuseEditors_closing)
260+
.create(editorReuseGroup);
263261
}
264262

265263
/**

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/messages.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,10 @@ OpenPerspectiveDialogAction_tooltip=Open Perspective
493493

494494
#---- General Preferences----
495495
PreferencePage_noDescription = (No description available)
496-
PreferencePageParameterValues_pageLabelSeparator = \ >\
496+
PreferencePageParameterValues_pageLabelSeparator = \ >\
497497
ThemingEnabled = E&nable theming
498498
ThemeChangeWarningText = Restart for the theme changes to take full effect
499-
ThemeChangeWarningTitle = Theme Changed
499+
ThemeChangeWarningTitle = Theme Changed
500500
# --- Workbench -----
501501
WorkbenchPreference_openMode=Open mode
502502
WorkbenchPreference_closeMode=Close mode
@@ -730,8 +730,8 @@ PageLayout_missingRefPart=Referenced part does not exist yet: {0}.
730730
# Keys used in the reuse editor which is released as experimental.
731731
# ==============================================================================
732732
PinEditorAction_toolTip=Pin Editor
733-
WorkbenchPreference_reuseEditors=&Close editors automatically
734-
WorkbenchPreference_reuseEditorsThreshold=Number of opened editors before closi&ng:
733+
WorkbenchPreference_reuseEditors=&Close oldest if there are more than
734+
WorkbenchPreference_reuseEditors_closing=editors open
735735
WorkbenchPreference_reuseEditorsThresholdError=The number of opened editors should be more than 0.
736736
WorkbenchPreference_recentFiles=Size of &recently opened files list:
737737
WorkbenchPreference_recentFilesError=The size of the recently opened files list should be between 0 and {0}.

0 commit comments

Comments
 (0)