[386796] Can't cleanly build JSDT on its own due to dependency on SSE
diff --git a/bundles/org.eclipse.wst.jsdt.debug.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.debug.ui/META-INF/MANIFEST.MF
index b7071ba..fd069ec 100644
--- a/bundles/org.eclipse.wst.jsdt.debug.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.jsdt.debug.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName.name
Bundle-SymbolicName: org.eclipse.wst.jsdt.debug.ui;singleton:=true
-Bundle-Version: 1.0.200.qualifier
+Bundle-Version: 1.0.201.qualifier
Bundle-Activator: org.eclipse.wst.jsdt.debug.internal.ui.JavaScriptDebugUIPlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.ui,
@@ -16,8 +16,7 @@
org.eclipse.ui.workbench.texteditor,
org.eclipse.wst.jsdt.ui,
org.eclipse.ui.editors,
- org.eclipse.core.expressions,
- org.eclipse.wst.sse.ui;bundle-version="1.3.100"
+ org.eclipse.core.expressions
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.jsdt.debug.internal.ui.filters"
Export-Package: org.eclipse.wst.jsdt.debug.internal.ui;x-friends:="org.eclipse.wst.jsdt.debug.rhino.ui",
diff --git a/bundles/org.eclipse.wst.jsdt.debug.ui/plugin.xml b/bundles/org.eclipse.wst.jsdt.debug.ui/plugin.xml
index 4995034..83a1219 100644
--- a/bundles/org.eclipse.wst.jsdt.debug.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.jsdt.debug.ui/plugin.xml
@@ -600,16 +600,7 @@
markerType="org.eclipse.wst.jsdt.debug.core.breakpoint.marker">
</updater>
</extension>
- <extension
- point="org.eclipse.wst.sse.ui.breakpoint">
- <breakpointContribution
- id="org.eclipse.wst.jsdt.html.breakpointContribution">
- <provider
- class="org.eclipse.wst.jsdt.debug.internal.ui.breakpoints.JavaScriptHtmlBreakpointProvider"
- contentTypes="org.eclipse.wst.html.core.htmlsource"
- id="org.eclipse.wst.jsdt.html.breakpoint.provider">
- </provider>
- </breakpointContribution>
+ <extension point="org.eclipse.wst.jsdt.web.ui.breakpointAdapter">
+ <adapter class="org.eclipse.wst.jsdt.debug.internal.ui.breakpoints.ToggleBreakpointAdapter"/>
</extension>
-
</plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.debug.ui/src/org/eclipse/wst/jsdt/debug/internal/ui/breakpoints/JavaScriptHtmlBreakpointProvider.java b/bundles/org.eclipse.wst.jsdt.debug.ui/src/org/eclipse/wst/jsdt/debug/internal/ui/breakpoints/JavaScriptHtmlBreakpointProvider.java
deleted file mode 100644
index c9f8587..0000000
--- a/bundles/org.eclipse.wst.jsdt.debug.ui/src/org/eclipse/wst/jsdt/debug/internal/ui/breakpoints/JavaScriptHtmlBreakpointProvider.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.debug.internal.ui.breakpoints;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.wst.jsdt.debug.internal.ui.adapters.JavaScriptAdapterFactory;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-
-/**
- * Provide the JavaScript breakpoint for the HTML editor
- *
- * @since 3.4
- */
-public class JavaScriptHtmlBreakpointProvider implements IBreakpointProvider {
-
- static final String SCRIPT_REGION = "org.eclipse.wst.html.SCRIPT"; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public JavaScriptHtmlBreakpointProvider() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider#addBreakpoint(org.eclipse.jface.text.IDocument, org.eclipse.ui.IEditorInput, int, int)
- */
- public IStatus addBreakpoint(final IDocument document, IEditorInput input, final int lineNumber, final int offset) throws CoreException {
- final IResource resource = getResource(input);
- if(resource != null && offset > -1) {
- try {
- final ITypedRegion region = document.getPartition(document.getLineOffset(lineNumber));
- if (region != null && SCRIPT_REGION.equals(region.getType())) {
- Job j = new Job("Toggle JavaScript Line Breakpoint") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- try {
- JavaScriptAdapterFactory.getToggleBreakpointAdapter().addBreakpoint(resource, document, lineNumber);
- return Status.OK_STATUS;
- }
- catch(CoreException ce) {
- return Status.CANCEL_STATUS;
- }
- }
- };
- j.setPriority(Job.INTERACTIVE);
- j.schedule();
- }
- }
- catch(BadLocationException ble) {}
- }
- return Status.CANCEL_STATUS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider#getResource(org.eclipse.ui.IEditorInput)
- */
- public IResource getResource(IEditorInput input) {
- IResource resource = (IResource) input.getAdapter(IFile.class);
- if (resource == null) {
- resource = ResourcesPlugin.getWorkspace().getRoot();
- }
- return resource;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider#setSourceEditingTextTools(org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools)
- */
- public void setSourceEditingTextTools(ISourceEditingTextTools tool) {
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.debug.ui/src/org/eclipse/wst/jsdt/debug/internal/ui/breakpoints/ToggleBreakpointAdapter.java b/bundles/org.eclipse.wst.jsdt.debug.ui/src/org/eclipse/wst/jsdt/debug/internal/ui/breakpoints/ToggleBreakpointAdapter.java
index e47f2c1..9228b5c 100644
--- a/bundles/org.eclipse.wst.jsdt.debug.ui/src/org/eclipse/wst/jsdt/debug/internal/ui/breakpoints/ToggleBreakpointAdapter.java
+++ b/bundles/org.eclipse.wst.jsdt.debug.ui/src/org/eclipse/wst/jsdt/debug/internal/ui/breakpoints/ToggleBreakpointAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
+ * Copyright (c) 2010, 2012 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
@@ -202,7 +202,23 @@
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
public void toggleLineBreakpoints(final IWorkbenchPart part, final ISelection selection) throws CoreException {
- //do nothing
+ if (!(part instanceof IEditorPart) || !(selection instanceof ITextSelection))
+ return;
+
+ ITextEditor textEditor = (ITextEditor) part.getAdapter(ITextEditor.class);
+ if (textEditor != null) {
+ IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+ if (document != null) {
+ int lineNumber;
+ try {
+ lineNumber = document.getLineOfOffset(((ITextSelection) selection).getOffset());
+ addBreakpoint(getResource((IEditorPart) part), document, lineNumber + 1);
+ }
+ catch (BadLocationException e) {
+ e.printStackTrace();
+ }
+ }
+ }
}
/**