[jbosstools-commits] JBoss Tools SVN: r7099 - trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Mon Mar 24 20:51:35 EDT 2008
Author: dgolovin
Date: 2008-03-24 20:51:35 -0400 (Mon, 24 Mar 2008)
New Revision: 7099
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/ActionBreakPointsHandler.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointHandler.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointToGlobalHandler.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/EnableBreakPointHandler.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/RemoveBreakPointsHandler.java
Log:
fix for compilation errors
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/ActionBreakPointsHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/ActionBreakPointsHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/ActionBreakPointsHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -24,6 +24,7 @@
import org.jboss.tools.common.meta.action.impl.AbstractHandler;
import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.StrutsConstants;
import org.jboss.tools.struts.debug.internal.ActionBreakpoint;
@@ -87,7 +88,7 @@
return false;
}
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
Properties enablement = DefaultCreateHandler.extractProperties(data[0]);
applyBreakpointEnablement(object, enablement);
}
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -20,6 +20,7 @@
import org.eclipse.debug.core.model.IBreakpoint;
import org.jboss.tools.common.meta.action.impl.AbstractHandler;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.StrutsConstants;
import org.jboss.tools.struts.debug.internal.ActionBreakpoint;
@@ -62,7 +63,7 @@
return true;
}
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
if (!isEnabled(object)) return;
XModelObject reference = object;
@@ -86,30 +87,33 @@
String actionPath = actionObject.getAttributeValue(ATT_PATH);
IBreakpoint breakpoint = null;
-
- if (isTilesDefinitionForward) {
- String forwardName = reference.getAttributeValue(ATT_NAME);
- breakpoint = StrutsDebugModel.getInstance().createActionTilesDefinitionForwardBreakpoint(file, modelPath, actionClassName, actionPath, forwardName);
- } else if (isAttrForward) {
- String forwardName = reference.getAttributeValue(ATT_FORWARD);
- breakpoint = StrutsDebugModel.getInstance().createActionAttrForwardBreakpoint(file, modelPath, actionPath, forwardName);
- } else if(isAttrInclude) {
- String includeName = reference.getAttributeValue(ATT_INCLUDE);
- breakpoint = StrutsDebugModel.getInstance().createActionIncludeBreakpoint(file, modelPath, actionPath, includeName);
- } else if(isForward) {
- String forwardName = reference.getAttributeValue(ATT_NAME);
- breakpoint = StrutsDebugModel.getInstance().createActionForwardBreakpoint(file, modelPath, actionClassName, actionPath, forwardName);
- } else if (isException)
- breakpoint = StrutsDebugModel.getInstance().createActionExceptionBreakpoint(
- file,
- modelPath,
- actionClassName,
- actionPath,
- reference.getAttributeValue(ATT_TYPE)
- );
-
- if (breakpoint != null)
- DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint);
+ try {
+ if (isTilesDefinitionForward) {
+ String forwardName = reference.getAttributeValue(ATT_NAME);
+ breakpoint = StrutsDebugModel.getInstance().createActionTilesDefinitionForwardBreakpoint(file, modelPath, actionClassName, actionPath, forwardName);
+ } else if (isAttrForward) {
+ String forwardName = reference.getAttributeValue(ATT_FORWARD);
+ breakpoint = StrutsDebugModel.getInstance().createActionAttrForwardBreakpoint(file, modelPath, actionPath, forwardName);
+ } else if(isAttrInclude) {
+ String includeName = reference.getAttributeValue(ATT_INCLUDE);
+ breakpoint = StrutsDebugModel.getInstance().createActionIncludeBreakpoint(file, modelPath, actionPath, includeName);
+ } else if(isForward) {
+ String forwardName = reference.getAttributeValue(ATT_NAME);
+ breakpoint = StrutsDebugModel.getInstance().createActionForwardBreakpoint(file, modelPath, actionClassName, actionPath, forwardName);
+ } else if (isException)
+ breakpoint = StrutsDebugModel.getInstance().createActionExceptionBreakpoint(
+ file,
+ modelPath,
+ actionClassName,
+ actionPath,
+ reference.getAttributeValue(ATT_TYPE)
+ );
+
+ if (breakpoint != null)
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint);
+ } catch (CoreException ex) {
+ throw new XModelException(ex);
+ }
}
boolean hasBreakpointMarker(XModelObject object) {
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointToGlobalHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointToGlobalHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointToGlobalHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -13,10 +13,12 @@
import java.util.Properties;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint;
import org.jboss.tools.common.meta.action.XActionInvoker;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.StrutsConstants;
import org.jboss.tools.struts.debug.internal.StrutsDebugModel;
@@ -25,7 +27,7 @@
public class AddBreakPointToGlobalHandler extends AddBreakPointHandler {
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
if (!isEnabled(object)) return;
String type = object.getAttributeValue(StrutsConstants.ATT_TYPE);
boolean isGlobalForward = StrutsConstants.TYPE_FORWARD.equals(type);
@@ -46,37 +48,41 @@
reference.getAttributeValue(StrutsConstants.ATT_PATH);
IBreakpoint breakpoint = null;
- if (isTilesDefinition) {
- breakpoint = StrutsDebugModel.getInstance().createTilesDefinitionGlobalForwardBreakpoint(
- file,
- modelPath,
- reference.getAttributeValue(StrutsConstants.ATT_NAME)
- );
- } else if (isGlobalForward) {
- breakpoint = StrutsDebugModel.getInstance().createGlobalForwardBreakpoint(
- file,
- modelPath,
- reference.getAttributeValue(StrutsConstants.ATT_NAME)
- );
- } else if (isGlobalException) {
- breakpoint = StrutsDebugModel.getInstance().createGlobalExceptionBreakpoint(
- file,
- modelPath,
- reference.getAttributeValue(StrutsConstants.ATT_TYPE)
- );
- } else if (isAction) {
- XActionInvoker.invoke("StrutsProcessItem_BreakpointActions", "Properties.BreakpointProperties", object, p);
- return;
- } else if (isPage) {
- String pagePath = StrutsProcessStructureHelper.instance.getContextRelativePath(object);
- breakpoint = StrutsDebugModel.getInstance().createPageEnterBreakpoint(
- file, modelPath, pagePath
- );
+ try {
+ if (isTilesDefinition) {
+ breakpoint = StrutsDebugModel.getInstance().createTilesDefinitionGlobalForwardBreakpoint(
+ file,
+ modelPath,
+ reference.getAttributeValue(StrutsConstants.ATT_NAME)
+ );
+ } else if (isGlobalForward) {
+ breakpoint = StrutsDebugModel.getInstance().createGlobalForwardBreakpoint(
+ file,
+ modelPath,
+ reference.getAttributeValue(StrutsConstants.ATT_NAME)
+ );
+ } else if (isGlobalException) {
+ breakpoint = StrutsDebugModel.getInstance().createGlobalExceptionBreakpoint(
+ file,
+ modelPath,
+ reference.getAttributeValue(StrutsConstants.ATT_TYPE)
+ );
+ } else if (isAction) {
+ XActionInvoker.invoke("StrutsProcessItem_BreakpointActions", "Properties.BreakpointProperties", object, p);
+ return;
+ } else if (isPage) {
+ String pagePath = StrutsProcessStructureHelper.instance.getContextRelativePath(object);
+ breakpoint = StrutsDebugModel.getInstance().createPageEnterBreakpoint(
+ file, modelPath, pagePath
+ );
+ }
+
+ if (breakpoint != null) {
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint);
+ }
+ } catch(CoreException e) {
+ throw new XModelException(e);
}
-
- if (breakpoint != null) {
- DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint);
- }
}
}
\ No newline at end of file
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/EnableBreakPointHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/EnableBreakPointHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/EnableBreakPointHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -15,9 +15,11 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointManager;
import org.eclipse.debug.core.model.IBreakpoint;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.model.helpers.StrutsBreakpointManager;
import org.jboss.tools.struts.model.helpers.StrutsProcessStructureHelper;
@@ -28,21 +30,25 @@
return hasBreakpointMarker(object) && (getNewValue() ^ isBreakpointEnabled(object));
}
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
if (!isEnabled(object)) return;
/// if (object instanceof ReferenceObjectImpl && ((ReferenceObjectImpl)object).getReference() != null)
/// object = ((ReferenceObjectImpl)object).getReference();
-
- IFile file = (IFile)object.getAdapter(IFile.class);
- IMarker markers[] = file.findMarkers(StrutsBreakpointManager.MODEL_BREAKPOINT, true, IResource.DEPTH_INFINITE);
- IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
- String modelPath = object.getPath();
- for (int i = 0; i < markers.length; i++)
- if (modelPath.equals(markers[i].getAttribute(StrutsBreakpointManager.ATTR_MODEL_PATH)))
- {
- IBreakpoint breakpoint = breakpointManager.getBreakpoint(markers[i]);
- if (breakpoint != null) breakpoint.setEnabled(getNewValue());
+ try {
+ IFile file = (IFile)object.getAdapter(IFile.class);
+ IMarker markers[] = file.findMarkers(StrutsBreakpointManager.MODEL_BREAKPOINT, true, IResource.DEPTH_INFINITE);
+ IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
+ String modelPath = object.getPath();
+ for (int i = 0; i < markers.length; i++) {
+ if (modelPath.equals(markers[i].getAttribute(StrutsBreakpointManager.ATTR_MODEL_PATH)))
+ {
+ IBreakpoint breakpoint = breakpointManager.getBreakpoint(markers[i]);
+ if (breakpoint != null) breakpoint.setEnabled(getNewValue());
+ }
}
+ } catch(CoreException e) {
+ throw new XModelException(e);
+ }
}
boolean getNewValue() {
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/RemoveBreakPointsHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/RemoveBreakPointsHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/RemoveBreakPointsHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -20,6 +20,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.debug.internal.ActionBreakpoint;
import org.jboss.tools.struts.debug.internal.StrutsDebugPlugin;
@@ -31,7 +32,7 @@
return hasBreakpointMarker(object);
}
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
if (!isEnabled(object)) return;
/// if(object instanceof ReferenceObjectImpl && ((ReferenceObjectImpl)object).getReference() != null) {
/// object = ((ReferenceObjectImpl)object).getReference();
More information about the jbosstools-commits
mailing list