Bug 13345 - exception in log - after opening/closing projects
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTypePropertyPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTypePropertyPage.java index e7f453a..52933cd 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTypePropertyPage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTypePropertyPage.java
@@ -38,6 +38,11 @@ * @see PreferencePage#createContents(Composite) */ protected Control createContents(Composite parent) { + + if (!getResource().isAccessible()) { + return createForInaccessibleResource(parent); + } + Composite topComp = new Composite(parent, SWT.NONE); GridLayout topLayout = new GridLayout(); topComp.setLayout(topLayout); @@ -99,6 +104,9 @@ * @see IPreferencePage#performOk() */ public boolean performOk() { + if (!getResource().isAccessible()) { + return true; + } int selectedIndex = getConfigTypeCombo().getSelectionIndex(); ILaunchConfigurationType configType = null; if (selectedIndex > -1) { @@ -159,4 +167,11 @@ private ILaunchManager getLaunchManager() { return DebugPlugin.getDefault().getLaunchManager(); } + + private Control createForInaccessibleResource(Composite parent) { + Label label= new Label(parent, SWT.LEFT); + label.setText("Launcher configuration type information is not available for an inaccessible resource."); + label.setFont(parent.getFont()); + return label; + } }