Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Petrovay2010-09-29 10:09:20 -0400
committerGabriel Petrovay2010-09-29 10:09:20 -0400
commit6551cc87a48a7c748c162acab2c570ed0b51641b (patch)
tree30775d7798e238f6b503909b8696b27edd77e380
parent29f373fe56d253bbfd60c2aa5e653053e1333eff (diff)
downloadorg.eclipse.webtools.incubator-6551cc87a48a7c748c162acab2c570ed0b51641b.tar.gz
org.eclipse.webtools.incubator-6551cc87a48a7c748c162acab2c570ed0b51641b.tar.xz
org.eclipse.webtools.incubator-6551cc87a48a7c748c162acab2c570ed0b51641b.zip
Added the disabling of brekpoints not hit by the engine in the Sausalito Debugger.
Refactored some Sausalito project constants: .config configuration directory, xq extension and sausalito.xml config file.
-rw-r--r--sourceediting/plugins/org.eclipse.wst.xquery.debug.debugger.zorba/dbgp/org/eclipse/wst/xquery/debug/debugger/zorba/translator/messages/SetPayload.java29
-rw-r--r--sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/utils/SETProjectConfigUtil.java (renamed from sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/SETProjectConfigUtil.java)0
-rw-r--r--sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/utils/SETProjectUtil.java57
3 files changed, 86 insertions, 0 deletions
diff --git a/sourceediting/plugins/org.eclipse.wst.xquery.debug.debugger.zorba/dbgp/org/eclipse/wst/xquery/debug/debugger/zorba/translator/messages/SetPayload.java b/sourceediting/plugins/org.eclipse.wst.xquery.debug.debugger.zorba/dbgp/org/eclipse/wst/xquery/debug/debugger/zorba/translator/messages/SetPayload.java
new file mode 100644
index 00000000..3642ad70
--- /dev/null
+++ b/sourceediting/plugins/org.eclipse.wst.xquery.debug.debugger.zorba/dbgp/org/eclipse/wst/xquery/debug/debugger/zorba/translator/messages/SetPayload.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 28msec Inc. 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:
+ * Gabriel Petrovay (28msec) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xquery.debug.debugger.zorba.translator.messages;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.wst.xquery.debug.debugger.zorba.translator.model.BreakpointPosition;
+
+import com.google.gson.annotations.SerializedName;
+
+public class SetPayload {
+
+ @SerializedName("breakpoints")
+ private List<BreakpointPosition> fBreakpoints = new ArrayList<BreakpointPosition>();
+
+ public List<BreakpointPosition> getBreakpointPositions() {
+ return fBreakpoints;
+ }
+
+}
diff --git a/sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/SETProjectConfigUtil.java b/sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/utils/SETProjectConfigUtil.java
index 8a0525ba..8a0525ba 100644
--- a/sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/SETProjectConfigUtil.java
+++ b/sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/utils/SETProjectConfigUtil.java
diff --git a/sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/utils/SETProjectUtil.java b/sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/utils/SETProjectUtil.java
new file mode 100644
index 00000000..ca115ac6
--- /dev/null
+++ b/sourceediting/plugins/org.eclipse.wst.xquery.set.core/src/org/eclipse/wst/xquery/set/core/utils/SETProjectUtil.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 28msec Inc. 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:
+ * Gabriel Petrovay (28msec) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xquery.set.core.utils;
+
+import java.net.URI;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.xquery.set.core.ISETCoreConstants;
+import org.eclipse.wst.xquery.set.core.SETProjectConfig;
+
+public class SETProjectUtil {
+
+ public static IFile getModuleFileForNamespace(IProject project, URI namespace) {
+ return getModuleFileForNamespace(project, namespace.toString());
+ }
+
+ public static IFile getModuleFileForNamespace(IProject project, String namespace) {
+ SETProjectConfig config = SETProjectConfigUtil.readProjectConfig(project.getProject());
+ if (config == null) {
+ System.err.println("Could not determine the project logical URI.");
+ return null;
+ }
+
+ URI uri = config.getLogicalUri();
+ String uriStr = uri.toString();
+ if (!namespace.startsWith(uriStr)) {
+ return null;
+ }
+ IPath path = new Path(namespace.substring(uriStr.length()));
+ if (path.segmentCount() == 1) {
+ path = new Path(ISETCoreConstants.PROJECT_DIRECTORY_HANDLER).append(path).addFileExtension(
+ ISETCoreConstants.XQUERY_FILE_EXTENSION);
+
+ }
+
+ IFolder folder = project.getFolder(new Path(path.segment(0)));
+ IResource resource = folder.findMember(path.removeFirstSegments(1));
+ if (resource instanceof IFile) {
+ return (IFile)resource;
+ }
+
+ return null;
+ }
+}

Back to the top