Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[386796] Can't cleanly build JSDT on its own due to dependency on SSE

  • Loading branch information...
commit 5116e5b257803bd0f9f91aed32ffb9dfc85c989e 1 parent 13e16ed
@nitind nitind authored
View
5 bundles/org.eclipse.wst.jsdt.debug.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
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 @@ Require-Bundle: org.eclipse.ui,
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",
View
13 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>
View
89 .../org/eclipse/wst/jsdt/debug/internal/ui/breakpoints/JavaScriptHtmlBreakpointProvider.java
@@ -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) {
- }
-}
View
20 ...ug.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 @@ String getTypeName(IJavaScriptElement element) {
* @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();
+ }
+ }
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.