Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvrubezhny2014-02-18 22:45:13 +0000
committervrubezhny2014-02-18 23:29:29 +0000
commitf6c72c506772ec7c685b7b1bb7582c1143ef1e99 (patch)
treeca64628f340803afbb4296192787d3e0910bf269
parented9b28cefaf8e8864570e67cace5dfbf98e5907b (diff)
downloadwebtools.jsdt-f6c72c506772ec7c685b7b1bb7582c1143ef1e99.tar.gz
webtools.jsdt-f6c72c506772ec7c685b7b1bb7582c1143ef1e99.tar.xz
webtools.jsdt-f6c72c506772ec7c685b7b1bb7582c1143ef1e99.zip
[428476] NullPointerException in Project's Project Preferences pagev201402182334
The only 'Include Path' preference page is set to be shown for 'JavaScript Resources' object. The context actions were updated for 'JavaScript Resources' object. Signed-off-by: vrubezhny <vrubezhny@exadel.com>
-rw-r--r--bundles/org.eclipse.wst.jsdt.ui/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.wst.jsdt.ui/plugin.xml45
-rw-r--r--bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/BuildPathsPropertyPage.java11
-rw-r--r--bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ProjectLibraryRoot.java10
4 files changed, 43 insertions, 24 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.ui/META-INF/MANIFEST.MF
index aa095d6a2..48564b9d8 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.jsdt.ui/META-INF/MANIFEST.MF
@@ -127,6 +127,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ltk.ui.refactoring;bundle-version="[3.4.100,4.0.0)",
org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
org.eclipse.ui.navigator;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.ui.navigator.resources;bundle-version="[3.4.0,4.0.0)",
org.eclipse.wst.jsdt.manipulation;bundle-version="[1.0.200,2.0.0)"
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/bundles/org.eclipse.wst.jsdt.ui/plugin.xml b/bundles/org.eclipse.wst.jsdt.ui/plugin.xml
index 4e2414e09..23642732f 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.jsdt.ui/plugin.xml
@@ -549,20 +549,12 @@
class="org.eclipse.wst.jsdt.internal.ui.preferences.BuildPathsPropertyPage"
id="org.eclipse.wst.jsdt.ui.propertyPages.BuildPathsPropertyPage">
<enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.wst.jsdt.core.jsNature"/>
- </adapt>
- </enabledWhen>
- <keywordReference id="org.eclipse.wst.jsdt.ui.buildpath"/>
- </page>
-
- <page
- name="%buildPathPageName"
- category="org.eclipse.wst.jsdt.internal.ui.preferences.JavaScriptMainPage"
- class="org.eclipse.wst.jsdt.internal.ui.preferences.BuildPathsPropertyPage"
- id="org.eclipse.wst.jsdt.ui.propertyPages.BuildPathsPropertyPageMenu">
- <enabledWhen>
- <adapt type="org.eclipse.wst.jsdt.ui.ProjectLibraryRoot"/>
+ <or>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.wst.jsdt.core.jsNature"/>
+ </adapt>
+ <adapt type="org.eclipse.wst.jsdt.ui.ProjectLibraryRoot"/>
+ </or>
</enabledWhen>
<keywordReference id="org.eclipse.wst.jsdt.ui.buildpath"/>
</page>
@@ -5343,6 +5335,7 @@
<instanceof value="org.eclipse.wst.jsdt.core.IJavaScriptElement" />
<instanceof value="org.eclipse.wst.jsdt.core.IJarEntryResource" />
<instanceof value="org.eclipse.wst.jsdt.internal.ui.packageview.PackageFragmentRootContainer" />
+ <instanceof value="org.eclipse.wst.jsdt.ui.ProjectLibraryRoot" />
</or>
</enablement>
</actionProvider>
@@ -5361,10 +5354,34 @@
<instanceof value="org.eclipse.wst.jsdt.core.IJavaScriptElement" />
<instanceof value="org.eclipse.wst.jsdt.core.IJarEntryResource" />
<instanceof value="org.eclipse.wst.jsdt.internal.ui.packageview.PackageFragmentRootContainer" />
+ <instanceof value="org.eclipse.wst.jsdt.ui.ProjectLibraryRoot" />
<instanceof value="org.eclipse.wst.jsdt.internal.core.JarEntryFile" />
</or>
</enablement>
</actionProvider>
+ <actionProvider
+ class="org.eclipse.ui.navigator.resources.GoIntoActionProvider"
+ id="org.eclipse.jsdt.ui.navigator.resources.GoIntoActions"
+ overrides="org.eclipse.ui.navigator.resources.GoIntoActions">
+ <enablement>
+ <or>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ property="org.eclipse.core.resources.open">
+ </test>
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.ui.IWorkingSet" />
+ <instanceof value="org.eclipse.wst.jsdt.core.IJavaScriptElement" />
+ <instanceof value="org.eclipse.wst.jsdt.core.IJarEntryResource" />
+ <instanceof value="org.eclipse.wst.jsdt.internal.ui.packageview.PackageFragmentRootContainer" />
+ <instanceof value="org.eclipse.wst.jsdt.ui.ProjectLibraryRoot" />
+ <instanceof value="org.eclipse.wst.jsdt.internal.core.JarEntryFile" />
+ </or>
+ </enablement>
+ </actionProvider>
+
<commonSorter
class="org.eclipse.wst.jsdt.ui.JavaElementSorter"
id="org.eclipse.wst.jsdt.ui.javaElementSorter"/>
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/BuildPathsPropertyPage.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/BuildPathsPropertyPage.java
index 8d92e0cd2..4eb857f71 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/BuildPathsPropertyPage.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/BuildPathsPropertyPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 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
@@ -33,6 +33,7 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PropertyPage;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.eclipse.wst.jsdt.core.IIncludePathEntry;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
@@ -180,8 +181,12 @@ public class BuildPathsPropertyPage extends PropertyPage implements IStatusChang
private IProject getProject() {
IAdaptable adaptable= getElement();
if (adaptable != null) {
- IProject elem= (IProject) adaptable.getAdapter(IProject.class);
- if(elem!=null) return elem;
+ IJavaScriptProject elem= (IJavaScriptProject) adaptable.getAdapter(IJavaScriptProject.class);
+ if(elem!=null) {
+ return elem.getProject();
+ } else {
+ return (IProject) adaptable.getAdapter(IProject.class);
+ }
}
return null;
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ProjectLibraryRoot.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ProjectLibraryRoot.java
index 84bf16d38..ac5933f18 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ProjectLibraryRoot.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ProjectLibraryRoot.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 IBM Corporation and others.
+ * Copyright (c) 2007, 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
@@ -8,14 +8,10 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-/**
- *
- */
package org.eclipse.wst.jsdt.ui;
import java.util.ArrayList;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -163,8 +159,8 @@ public class ProjectLibraryRoot implements IAdaptable{
public Object getAdapter(Class adapter) {
if(adapter == IWorkbenchAdapter.class) {
return new WorkBenchAdapter();
- } else if(adapter == IProject.class){
- return getProject().getProject();
+ } else if (adapter == IJavaScriptProject.class) {
+ return getProject();
}
return Platform.getAdapterManager().getAdapter(this, adapter);

Back to the top