Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 249279 Details for
Bug 121057
[jres] 'Execution Environments' preference page not updated after JRE addition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
UI patch to support Apply in Build Path Preference page Approach 2
JRE Pref Platform Sarika.patch (text/plain), 5.04 KB, created by
Sarika Sinha
on 2014-12-09 06:33:08 EST
(
hide
)
Description:
UI patch to support Apply in Build Path Preference page Approach 2
Filename:
MIME Type:
Creator:
Sarika Sinha
Created:
2014-12-09 06:33:08 EST
Size:
5.04 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface >diff --git src/org/eclipse/jface/preference/PreferencePage.java src/org/eclipse/jface/preference/PreferencePage.java >index 102f8e6..4a8f102 100644 >--- src/org/eclipse/jface/preference/PreferencePage.java >+++ src/org/eclipse/jface/preference/PreferencePage.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2013 IBM Corporation and others. >+ * Copyright (c) 2000, 2014 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -73,12 +73,20 @@ > private Control body; > > /** >- * Whether this page has the standard Apply and Defaults buttons; >- * <code>true</code> by default. >- * >- * @see #noDefaultAndApplyButton >- */ >- private boolean createDefaultAndApplyButton = true; >+ * Whether this page has the standard Apply button; <code>true</code> by >+ * default. >+ * >+ * @see #noDefaultAndApplyButton >+ */ >+ private boolean createApplyButton = true; >+ >+ /** >+ * Whether this page has the standard Default button; <code>true</code> by >+ * default. >+ * >+ * @see #noDefaultButton >+ */ >+ private boolean createDefaultButton = true; > > /** > * Standard Defaults button, or <code>null</code> if none. >@@ -249,12 +257,12 @@ > buttonBar.setLayoutData(gd); > > contributeButtons(buttonBar); >- >- if (createDefaultAndApplyButton) { >+ int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); >+ if (createApplyButton && createDefaultButton) { > layout.numColumns = layout.numColumns + 2; > String[] labels = JFaceResources.getStrings(new String[] { > "defaults", "apply" }); //$NON-NLS-2$//$NON-NLS-1$ >- int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); >+ > defaultsButton = new Button(buttonBar, SWT.PUSH); > defaultsButton.setText(labels[0]); > Dialog.applyDialogFont(defaultsButton); >@@ -269,24 +277,12 @@ > performDefaults(); > } > }); >- >- applyButton = new Button(buttonBar, SWT.PUSH); >- applyButton.setText(labels[1]); >- Dialog.applyDialogFont(applyButton); >- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); >- minButtonSize = applyButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, >- true); >- data.widthHint = Math.max(widthHint, minButtonSize.x); >- applyButton.setLayoutData(data); >- applyButton.addSelectionListener(new SelectionAdapter() { >- @Override >- public void widgetSelected(SelectionEvent e) { >- performApply(); >- } >- }); >- applyButton.setEnabled(isValid()); >- applyDialogFont(buttonBar); >- } else { >+ createApplyButton(buttonBar, labels[1], widthHint); >+ } else if (createApplyButton) { >+ layout.numColumns = layout.numColumns + 1; >+ String label = JFaceResources.getString("apply"); //$NON-NLS-1$ >+ createApplyButton(buttonBar, label, widthHint); >+ } else { > /* Check if there are any other buttons on the button bar. > * If not, throw away the button bar composite. Otherwise > * there is an unusually large button bar. >@@ -297,7 +293,23 @@ > } > } > >- >+ private void createApplyButton(Composite buttonBar, String label, int widthHint) { >+ applyButton = new Button(buttonBar, SWT.PUSH); >+ applyButton.setText(label); >+ Dialog.applyDialogFont(applyButton); >+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); >+ Point minButtonSize = applyButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); >+ data.widthHint = Math.max(widthHint, minButtonSize.x); >+ applyButton.setLayoutData(data); >+ applyButton.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ performApply(); >+ } >+ }); >+ applyButton.setEnabled(isValid()); >+ applyDialogFont(buttonBar); >+ } > > /** > * Apply the dialog font to the composite and it's children >@@ -408,15 +420,30 @@ > * </p> > */ > protected void noDefaultAndApplyButton() { >- createDefaultAndApplyButton = false; >+ createApplyButton = false; >+ createDefaultButton = false; > } > > /** >- * The <code>PreferencePage</code> implementation of this >- * <code>IPreferencePage</code> method returns <code>true</code> >- * if the page is valid. >- * @see IPreferencePage#okToLeave() >- */ >+ * Suppress creation of the standard Default button for this page. >+ * <p> >+ * Subclasses wishing a preference page with this button should call this >+ * framework method before the page's control has been created. >+ * </p> >+ * >+ * @since 3.11 >+ */ >+ protected void noDefaultButton() { >+ createDefaultButton = false; >+ } >+ >+ /** >+ * The <code>PreferencePage</code> implementation of this >+ * <code>IPreferencePage</code> method returns <code>true</code> if the page >+ * is valid. >+ * >+ * @see IPreferencePage#okToLeave() >+ */ > @Override > public boolean okToLeave() { > return isValid();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
daniel_megert
:
review-
Actions:
View
|
Diff
Attachments on
bug 121057
:
248562
|
248563
|
248564
|
248892
|
248893
|
248894
|
249124
|
249125
|
249126
|
249127
|
249277
|
249279
|
249458
|
249512