Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2015-01-05 05:31:00 +0000
committerSarika Sinha2015-01-05 05:31:00 +0000
commitd3f82f52c5976cec08019bc7682ff3c1afd4bf44 (patch)
tree538338805a513b45ca802939115e5c0fa01d04a9
parent80f5b9b02195ae3ff022074f5b4290a28398c751 (diff)
downloadeclipse.jdt.debug-d3f82f52c5976cec08019bc7682ff3c1afd4bf44.tar.gz
eclipse.jdt.debug-d3f82f52c5976cec08019bc7682ff3c1afd4bf44.tar.xz
eclipse.jdt.debug-d3f82f52c5976cec08019bc7682ff3c1afd4bf44.zip
Bug 121057 - [jres] 'Execution Environments' preference page not updatedI20150106-0800
after JRE addition Change-Id: I2a9ddda6ca82e1318b79faa7afa7c35db52f7161
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java51
1 files changed, 37 insertions, 14 deletions
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java
index 0741e9f23..dd20120e0 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 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
@@ -102,6 +102,41 @@ public class ExecutionEnvironmentsPreferencePage extends PreferencePage implemen
public void init(IWorkbench workbench) {
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage(boolean)
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ if (visible) {
+ if (fProfilesViewer.getSelection() != null && !fProfilesViewer.getSelection().isEmpty()) {
+ handleEESelectionAndJREViewer(fProfilesViewer.getStructuredSelection());
+ }
+ }
+ super.setVisible(visible);
+
+ }
+
+ /*
+ * Set the JREs for selected Execution Environment
+ */
+ private void handleEESelectionAndJREViewer(IStructuredSelection selection) {
+ IExecutionEnvironment env = (IExecutionEnvironment) (selection).getFirstElement();
+ fJREsViewer.setInput(env);
+ String description = env.getDescription();
+ if (description == null) {
+ description = ""; //$NON-NLS-1$
+ }
+ fDescription.setText(description);
+ IVMInstall jre = (IVMInstall) fDefaults.get(env);
+ if (jre != null) {
+ fJREsViewer.setCheckedElements(new Object[] { jre });
+ } else {
+ fJREsViewer.setCheckedElements(new Object[0]);
+ }
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@@ -188,19 +223,7 @@ public class ExecutionEnvironmentsPreferencePage extends PreferencePage implemen
fProfilesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
- IExecutionEnvironment env = (IExecutionEnvironment) ((IStructuredSelection)event.getSelection()).getFirstElement();
- fJREsViewer.setInput(env);
- String description = env.getDescription();
- if (description == null) {
- description = ""; //$NON-NLS-1$
- }
- fDescription.setText(description);
- IVMInstall jre = (IVMInstall) fDefaults.get(env);
- if (jre != null) {
- fJREsViewer.setCheckedElements(new Object[]{jre});
- } else {
- fJREsViewer.setCheckedElements(new Object[0]);
- }
+ handleEESelectionAndJREViewer((IStructuredSelection) event.getSelection());
}
});

Back to the top