Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added Camel debugger (see FUSETOOLS-439)

  • Loading branch information...
commit dbf1f10614000fb1af4812c2c42da5de05694914 1 parent f9093d9
@lhein lhein authored
Showing with 7,408 additions and 1,575 deletions.
  1. +3 −1 plugins/org.fusesource.ide.camel.editor/META-INF/MANIFEST.MF
  2. BIN  plugins/org.fusesource.ide.camel.editor/icons/gray-dot.png
  3. BIN  plugins/org.fusesource.ide.camel.editor/icons/green-dot.png
  4. BIN  plugins/org.fusesource.ide.camel.editor/icons/red-dot.png
  5. BIN  plugins/org.fusesource.ide.camel.editor/icons/yellow-dot.png
  6. +18 −1 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/Activator.java
  7. +19 −2 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/commands/DiagramOperations.java
  8. +103 −0 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/commands/HighlightNodeCommand.java
  9. +1 −3 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/editor/CamelDiagramBehaviour.java
  10. +1 −0  ...s/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/editor/CamelPersistencyBehaviour.java
  11. +157 −11 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/editor/RiderDesignEditor.java
  12. +17 −4 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/editor/RiderEditor.java
  13. +120 −0 ...e.ide.camel.editor/src/org/fusesource/ide/camel/editor/features/custom/DeleteEndpointBreakpointFeature.java
  14. +153 −0 ...urce.ide.camel.editor/src/org/fusesource/ide/camel/editor/features/custom/SetEndpointBreakpointFeature.java
  15. +5 −1 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/provider/CamelFeatureProvider.java
  16. +24 −0 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/provider/DiagramTypeProvider.java
  17. +12 −2 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/provider/ImageProvider.java
  18. +48 −5 ...ins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/provider/ToolBehaviourProvider.java
  19. +9 −9 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/utils/StyleUtil.java
  20. +2 −1  plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/views/DiagramView.java
  21. +56 −4 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/AbstractNode.java
  22. +9 −9 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/Endpoint.java
  23. +0 −17 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/ExpressionNode.java
  24. +31 −19 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/RouteContainer.java
  25. +2 −1  plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/RouteSupport.java
  26. +13 −2 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/io/XmlContainerMarshaller.java
  27. +1 −1  plugins/org.fusesource.ide.cheatsheets/.classpath
  28. 0  plugins/org.fusesource.ide.cheatsheets/src/{main/java → }/Dummy.txt
  29. +10 −8 plugins/org.fusesource.ide.commons/plugin.xml
  30. +16 −18 plugins/org.fusesource.ide.commons/src/org/fusesource/ide/commons/util/CamelUtils.java
  31. +1 −1  ...org.fusesource.ide.fabric.camel/src/org/fusesource/ide/fabric/camel/editor/CamelContextNodeEditorInput.java
  32. +7 −8 ...g.fusesource.ide.fabric/src/org/fusesource/ide/fabric/navigator/maven/BuildLaunchConfigurationTabGroup.java
  33. +3 −3 plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/navigator/maven/FabricDeployAction.java
  34. +1 −1  plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/navigator/maven/FabricInstallAction.java
  35. +13 −9 plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/navigator/maven/InstallMavenLaunchMainTab.java
  36. +3 −1 plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/views/MessagesView.java
  37. +1 −1  plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/views/logs/LogsView.java
  38. +5 −3 plugins/org.fusesource.ide.launcher.ui/META-INF/MANIFEST.MF
  39. +6 −1 plugins/org.fusesource.ide.launcher.ui/OSGI-INF/l10n/bundle.properties
  40. BIN  plugins/org.fusesource.ide.launcher.ui/icons/endpoint_node.png
  41. BIN  plugins/org.fusesource.ide.launcher.ui/icons/message.png
  42. BIN  plugins/org.fusesource.ide.launcher.ui/icons/pause_camel_context.png
  43. BIN  plugins/org.fusesource.ide.launcher.ui/icons/variable.png
  44. +100 −5 plugins/org.fusesource.ide.launcher.ui/plugin.xml
  45. +7 −17 plugins/org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/Activator.java
  46. +195 −0 .../org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/debug/editors/BooleanVariableEditor.java
  47. +72 −0 ...ns/org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/debug/editors/VariableValueEditor.java
  48. +42 −0 ....fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/debug/handlers/ResetDebugCounterHandler.java
  49. +141 −0 ...s/org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/debug/model/CamelModelPresentation.java
  50. +9 −4 ...ns/org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/{ → launch}/ExecutePomAction.java
  51. +8 −3 ...fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/{ → launch}/ExecutePomActionNoTests.java
  52. +1 −1  ...urce.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/{ → launch}/ExecutePomActionPostProcessor.java
  53. +110 −112 ...fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/{ → launch}/ExecutePomActionSupport.java
  54. +1 −1  ...urce.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/{ → launch}/InvalidConfigurationException.java
  55. +49 −42 plugins/org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/tabs/CamelContextFileTab.java
  56. +11 −9 ...source.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/tabs/CamelContextLaunchConfigurationTabGroup.java
  57. +195 −0 plugins/org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/tabs/DebugJmxTab.java
  58. +0 −193 plugins/org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/tabs/MavenJRETab.java
  59. +0 −929 plugins/org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/tabs/MavenLaunchMainTab.java
  60. +20 −3 plugins/org.fusesource.ide.launcher/META-INF/MANIFEST.MF
  61. +42 −13 plugins/org.fusesource.ide.launcher/plugin.xml
  62. +5 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/Activator.java
  63. +68 −0 .../org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/launching/CamelSourceLookupDirector.java
  64. +41 −0 ...g.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/launching/CamelSourceLookupParticipant.java
  65. +56 −0 ...usesource.ide.launcher/src/org/fusesource/ide/launcher/debug/launching/CamelSourcePathComputerDelegate.java
  66. +76 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/CamelDebugElement.java
  67. +808 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/CamelDebugFacade.java
  68. +749 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/CamelDebugTarget.java
  69. +173 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/CamelEndpointBreakpoint.java
  70. +357 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/CamelStackFrame.java
  71. +328 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/CamelThread.java
  72. +364 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/ICamelDebuggerMBeanFacade.java
  73. +118 −0 ...fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/exchange/BacklogTracerEventMessage.java
  74. +94 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/exchange/Header.java
  75. +74 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/exchange/Message.java
  76. +101 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/values/BaseCamelValue.java
  77. +133 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/values/CamelDebuggerValue.java
  78. +110 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/values/CamelExchangeValue.java
  79. +58 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/values/CamelHeaderValue.java
  80. +89 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/values/CamelHeadersValue.java
  81. +98 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/values/CamelMessageValue.java
  82. +211 −0 ...ins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/values/CamelProcessorValue.java
  83. +165 −0 ...ns/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/BaseCamelVariable.java
  84. +54 −0 ...ce.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/BaseWritableCamelIntegerVariable.java
  85. +69 −0 ...usesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/BaseWritableCamelVariable.java
  86. +54 −0 ...e.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/BaseWriteableCamelBooleanVariable.java
  87. +42 −0 ...ource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelBodyIncludeFilesVariable.java
  88. +42 −0 ...rce.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelBodyIncludeStreamsVariable.java
  89. +42 −0 ...usesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelBodyMaxCharsVariable.java
  90. +86 −0 ...ns/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelBodyVariable.java
  91. +38 −0 ...rg.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelDebuggerVariable.java
  92. +37 −0 ...rg.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelExchangeVariable.java
  93. +88 −0 .../org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelHeaderVariable.java
  94. +60 −0 ...rg.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelLogLevelVariable.java
  95. +37 −0 ...org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelMessageVariable.java
  96. +37 −0 ...g.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/CamelProcessorVariable.java
  97. +51 −0 ...s/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/model/variables/IVariableConstants.java
  98. +60 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/util/CamelDebugRegistry.java
  99. +96 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/util/CamelDebugRegistryEntry.java
  100. +170 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/util/CamelDebugUtils.java
  101. +47 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/debug/util/ICamelDebugConstants.java
  102. +8 −9 ...ource.ide.launcher/src/org/fusesource/ide/launcher/{ → run/launching}/CamelRunMavenLaunchDelegate.java
  103. +1 −1  ...de.launcher/src/org/fusesource/ide/launcher/{ → run/launching}/CamelRunNoTestsMavenLaunchDelegate.java
  104. +42 −4 ...usesource.ide.launcher/src/org/fusesource/ide/launcher/{ → run/launching}/FuseMavenLaunchDelegate.java
  105. +1 −1  ...urce.ide.launcher/src/org/fusesource/ide/launcher/{ → run/util}/CamelContextLaunchConfigConstants.java
  106. +3 −6 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/{ → run/util}/MavenLaunchUtils.java
  107. +65 −0 plugins/org.fusesource.ide.launcher/src/org/fusesource/ide/launcher/util/SecureStorageUtil.java
  108. +4 −7 plugins/org.fusesource.ide.project/src/org/fusesource/ide/project/providers/CamelFilesLabelProvider.java
  109. +0 −32 plugins/org.fusesource.ide.project/src/org/fusesource/ide/project/providers/CamelVirtualFile.java
  110. +7 −17 plugins/org.fusesource.ide.project/src/org/fusesource/ide/project/providers/CamelVirtualFolder.java
  111. +18 −19 pom.xml
View
4 plugins/org.fusesource.ide.camel.editor/META-INF/MANIFEST.MF
@@ -7,6 +7,7 @@ Bundle-Activator: org.fusesource.ide.camel.editor.Activator
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.fusesource.ide.camel.model,
org.fusesource.ide.commons,
+ org.fusesource.ide.launcher,
org.fusesource.ide.graph,
org.fusesource.ide.preferences,
org.fusesource.ide.project,
@@ -45,7 +46,8 @@ Require-Bundle: org.fusesource.ide.camel.model,
org.junit,
com.google.guava;bundle-version="[15.0.0,16.0.0)",
org.jboss.tools.jmx.core;bundle-version="1.6.0",
- org.jboss.tools.jmx.ui;bundle-version="1.6.0"
+ org.jboss.tools.jmx.ui;bundle-version="1.6.0",
+ org.eclipse.debug.core;bundle-version="3.9.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.fusesource.ide.camel.editor
Bundle-ActivationPolicy: lazy
View
BIN  plugins/org.fusesource.ide.camel.editor/icons/gray-dot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  plugins/org.fusesource.ide.camel.editor/icons/green-dot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  plugins/org.fusesource.ide.camel.editor/icons/red-dot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  plugins/org.fusesource.ide.camel.editor/icons/yellow-dot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
19 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/Activator.java
@@ -12,6 +12,9 @@
package org.fusesource.ide.camel.editor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
@@ -25,6 +28,7 @@
import org.fusesource.ide.commons.logging.RiderLogFacade;
import org.fusesource.ide.commons.ui.ImagesActivatorSupport;
import org.fusesource.ide.commons.ui.UIHelper;
+import org.fusesource.ide.launcher.debug.util.ICamelDebugConstants;
import org.osgi.framework.BundleContext;
@@ -56,7 +60,8 @@ public static Activator getDefault() {
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
- plugin = this;
+ plugin = this;
+// removeOldBreakpoints();
//redirectContextSensitiveHelp();
perspectiveListener = new PreferredPerspectivePartListener();
perspectiveListener.earlyStartup();
@@ -136,5 +141,17 @@ public static RiderDesignEditor getDiagramEditor() {
}
}
return null;
+ }
+
+ /**
+ * trashes all breakpoints with camel debug type
+ */
+ private void removeOldBreakpoints() {
+ IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(ICamelDebugConstants.ID_CAMEL_DEBUG_MODEL);
+ try {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoints(breakpoints, true);
+ } catch (CoreException ex) {
+ getLogger().error(ex);
+ }
}
}
View
21 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/commands/DiagramOperations.java
@@ -20,6 +20,7 @@
import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.platform.IDiagramBehavior;
import org.eclipse.graphiti.ui.services.GraphitiUi;
+import org.eclipse.swt.widgets.Display;
import org.fusesource.ide.camel.editor.editor.RiderDesignEditor;
import org.fusesource.ide.camel.model.AbstractNode;
import org.fusesource.ide.camel.model.RouteSupport;
@@ -87,9 +88,12 @@ public static void execute(TransactionalEditingDomain editingDomain, RecordingCo
}
}
- protected static synchronized TransactionalEditingDomain createEditingDomain(RiderDesignEditor designEditor) {
+ protected static synchronized TransactionalEditingDomain createEditingDomain(RiderDesignEditor designEditor) {
TransactionalEditingDomain editingDomain = designEditor.getEditingDomain();
- Diagram diagram = designEditor.getDiagram();
+ Diagram diagram = designEditor.getDiagram();
+ if (diagram == null) {
+ return null;
+ }
if (editingDomain == null) {
IDiagramBehavior diagramBehavior = designEditor.getDiagramTypeProvider().getDiagramBehavior();
if (diagramBehavior != null) {
@@ -125,5 +129,18 @@ public static ChangeGridColorCommand updateGridColor(RiderDesignEditor designEdi
execute(editingDomain, operation, false);
return operation;
+ }
+
+ public static void highlightNode(final RiderDesignEditor designEditor, final AbstractNode node, final boolean highlight) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ TransactionalEditingDomain editingDomain = createEditingDomain(designEditor);
+ if (editingDomain != null) {
+ HighlightNodeCommand operation = new HighlightNodeCommand(designEditor, editingDomain, node, highlight);
+ execute(editingDomain, operation, false);
+ }
+ }
+ });
}
}
View
103 ...s/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/commands/HighlightNodeCommand.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.fusesource.ide.camel.editor.commands;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.fusesource.ide.camel.editor.Activator;
+import org.fusesource.ide.camel.editor.editor.RiderDesignEditor;
+import org.fusesource.ide.camel.editor.editor.RiderEditor;
+import org.fusesource.ide.camel.editor.utils.StyleUtil;
+import org.fusesource.ide.camel.model.AbstractNode;
+import org.fusesource.ide.camel.model.RouteSupport;
+
+/**
+ * @author lhein
+ */
+public class HighlightNodeCommand extends RecordingCommand {
+
+ private final RiderDesignEditor designEditor;
+ private AbstractNode node;
+ private boolean highlight;
+
+ public HighlightNodeCommand(RiderDesignEditor designEditor, TransactionalEditingDomain editingDomain, AbstractNode node, boolean highlight) {
+ super(editingDomain);
+ this.designEditor = designEditor;
+ this.node = node;
+ this.highlight = highlight;
+ }
+
+ @Override
+ protected void doExecute() {
+ if (node == null) {
+ // skip
+ return;
+ }
+
+ // check if we are in the design view mode - if not, then switch to it
+ if (this.designEditor.getMultiPageEditor().getActivePage() == RiderEditor.SOURCE_PAGE_INDEX) {
+ this.designEditor.getMultiPageEditor().switchToDesignEditor();
+ }
+
+ // check if we need to switch to another route for highlighting
+ if (this.designEditor.getHighlightedNodeInDebugger() != null &&
+ this.node != null &&
+ highlight) {
+
+ if (node.getParent() != null &&
+ this.designEditor.getHighlightedNodeInDebugger().getParent() != null &&
+ node.getParent().getId() != this.designEditor.getHighlightedNodeInDebugger().getParent().getId()) {
+
+ // seems the next breakpoint is in a different route and we need to switch to that route now
+ if (node.getParent() instanceof RouteSupport) {
+ // switch the route
+ this.designEditor.setSelectedRoute((RouteSupport)node.getParent());
+ }
+ }
+ }
+
+ PictogramElement pe = designEditor.getFeatureProvider().getPictogramElementForBusinessObject(node);
+ if (pe == null) {
+ Activator.getLogger().debug("Warning could not find PictogramElement for highlight node: " + node);
+ return;
+ }
+
+ IGaService gaService = Graphiti.getGaService();
+
+ try {
+ if (pe instanceof ContainerShape) {
+ ContainerShape cs = (ContainerShape) pe;
+ for (Shape shape : cs.getChildren()) {
+ if (shape.getGraphicsAlgorithm() instanceof Text) {
+ Text text = (Text) shape.getGraphicsAlgorithm();
+
+ // now update node highlight
+ if (highlight) {
+ // set highlight
+ text.setForeground(gaService.manageColor(designEditor.getDiagram(), StyleUtil.getColorConstant("255,0,0")));
+ } else {
+ // delete highlight
+ text.setForeground(gaService.manageColor(designEditor.getDiagram(), StyleUtil.E_CLASS_TEXT_FOREGROUND));
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+}
View
4 ...ns/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/editor/CamelDiagramBehaviour.java
@@ -14,13 +14,11 @@
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
import org.eclipse.graphiti.ui.editor.DefaultPaletteBehavior;
import org.eclipse.graphiti.ui.editor.DefaultPersistencyBehavior;
import org.eclipse.graphiti.ui.editor.DefaultUpdateBehavior;
import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.editor.IDiagramContainerUI;
-import org.eclipse.graphiti.ui.internal.config.ConfigurationProvider;
import org.eclipse.graphiti.ui.platform.IConfigurationProvider;
import org.fusesource.ide.camel.editor.CamelModelChangeListener;
@@ -82,7 +80,7 @@ protected DefaultPaletteBehavior getPaletteBehavior() {
*/
@Override
public TransactionalEditingDomain getEditingDomain() {
- return this.camelUpdateBehaviour.getEditingDomain();
+ return (this.camelUpdateBehaviour != null ? this.camelUpdateBehaviour.getEditingDomain() : null);
}
/* (non-Javadoc)
View
1  ...rg.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/editor/CamelPersistencyBehaviour.java
@@ -74,6 +74,7 @@ protected boolean loadModel(IEditorInput input) {
if (editor.getModel() == null) {
try {
editor.setModel(CamelContextIOUtils.loadModelFromFile(camelContextFile));
+ editor.setCamelContextFile(camelContextFile);
ValidationHandler status = CamelContextIOUtils.validateModel(editor.getModel());
if (status.hasErrors()) {
Activator.getLogger().error("Unable to validate the model. Invalid input!");
View
168 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/editor/RiderDesignEditor.java
@@ -21,11 +21,16 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.ContextMenuProvider;
import org.eclipse.gef.EditDomain;
@@ -69,9 +74,12 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IURIEditorInput;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.fusesource.camel.tooling.util.ValidationHandler;
@@ -91,13 +99,18 @@
import org.fusesource.ide.commons.ui.Selections;
import org.fusesource.ide.commons.util.IOUtils;
import org.fusesource.ide.commons.util.Objects;
+import org.fusesource.ide.launcher.debug.model.CamelStackFrame;
+import org.fusesource.ide.launcher.debug.model.CamelThread;
+import org.fusesource.ide.launcher.debug.util.CamelDebugRegistry;
+import org.fusesource.ide.launcher.debug.util.CamelDebugRegistryEntry;
+import org.fusesource.ide.launcher.debug.util.ICamelDebugConstants;
import org.fusesource.ide.preferences.PreferenceManager;
import org.fusesource.ide.preferences.PreferencesConstants;
/**
* @author lhein
*/
-public class RiderDesignEditor extends DiagramEditor implements INodeViewer {
+public class RiderDesignEditor extends DiagramEditor implements INodeViewer, IDebugEventSetListener, ISelectionListener {
private final RiderDesignEditorData data;
@@ -126,7 +139,9 @@
private DesignerCache activeConfig;
private Map<RouteSupport, DesignerCache> cache = new HashMap<RouteSupport, DesignerCache>();
-
+
+ private AbstractNode highlightedNodeInDebugger;
+
public class DesignerCache {
public Diagram diagram;
public DiagramEditorInput input;
@@ -195,7 +210,12 @@ public static RiderDesignEditor toRiderDesignEditor(IDiagramTypeProvider diagram
public RiderDesignEditor(RiderEditor parent) {
this.data = parent.getDesignEditorData();
this.activeConfig = new DesignerCache();
- this.editor = parent;
+ this.editor = parent;
+ DebugPlugin.getDefault().addDebugEventListener(this);
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
+ ISelectionService sel = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ if (sel != null) sel.addSelectionListener(ICamelDebugConstants.DEBUG_VIEW_ID, this);
+ }
}
@Override
@@ -225,6 +245,10 @@ public DiagramBehavior getDiagramBehavior() {
public IConfigurationProvider getConfigurationProvider() {
return this.camelDiagramBehaviour.getConfigurationProvider();
}
+
+ public RiderEditor getMultiPageEditor() {
+ return this.editor;
+ }
@Override
protected void setInput(IEditorInput input) {
@@ -238,8 +262,34 @@ protected void setInput(IEditorInput input) {
}
initializeDiagram(activeConfig.diagram);
-
- getEditingDomain().getCommandStack().flush();
+
+ /**
+ * the following is needed because we miss the first debug events and the first breakpoint wouldn't be highlighted otherwise
+ */
+ try {
+ for (CamelDebugRegistryEntry entry : CamelDebugRegistry.getInstance().getEntries().values()) {
+ if (entry.getEditorInput().getFile().getFullPath().toFile().getPath().equals(asFileEditorInput(input).getFile().getFullPath().toFile().getPath())) {
+ String endpointId = null;
+
+ // first highligth the suspended node
+ Set<String> ids = entry.getDebugTarget().getDebugger().getSuspendedBreakpointNodeIds();
+ if (ids != null && ids.size()>0) {
+ endpointId = ids.iterator().next();
+ }
+ highlightBreakpointNodeWithID(endpointId);
+
+ // and then mark all breakpoints
+
+ }
+ }
+ } catch (Exception ex) {
+ Activator.getLogger().error(ex);
+ }
+ /**
+ * End of the highlighting code
+ */
+
+ getEditingDomain().getCommandStack().flush();
}
protected void initializeDiagramForSelectedRoute() {
@@ -511,6 +561,19 @@ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if (selectedEditPart != null) {
lastSelectedEditPart = selectedEditPart;
}
+ } else if (firstElement instanceof CamelStackFrame) {
+ CamelStackFrame stackFrame = (CamelStackFrame)firstElement;
+ highlightBreakpointNodeWithID(stackFrame.getEndpointId());
+ } else if (firstElement instanceof CamelThread) {
+ CamelThread t = (CamelThread)firstElement;
+ try {
+ CamelStackFrame stackFrame = (CamelStackFrame)t.getTopStackFrame();
+ if (stackFrame != null) {
+ highlightBreakpointNodeWithID(stackFrame.getEndpointId());
+ }
+ } catch (DebugException e) {
+ Activator.getLogger().error(e);
+ }
}
}
}
@@ -779,8 +842,8 @@ public void setModel(RouteContainer model) throws PartInitException {
if (model != this.data.model){
this.data.model = model;
this.data.selectedRoute = null;
-
- setInitialRoute();
+
+ setInitialRoute();
}
}
@@ -934,7 +997,14 @@ public KeyHandler getKeyHandler() {
* @see org.eclipse.gef.ui.parts.GraphicalEditor#dispose()
*/
@Override
- public void dispose() {
+ public void dispose() {
+ DebugPlugin.getDefault().removeDebugEventListener(this);
+
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
+ ISelectionService sel = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ if (sel != null) sel.removeSelectionListener(ICamelDebugConstants.DEBUG_VIEW_ID, this);
+ }
+
this.editorInput = null;
this.activeConfig = null;
@@ -958,7 +1028,7 @@ protected void loadModelFromInput(IEditorInput editorInput) {
} else if (editorInput instanceof ICamelEditorInput) {
ICamelEditorInput camelInput = (ICamelEditorInput) editorInput;
editor.onInputLoading(camelInput);
- this.setModel(camelInput.loadModel());
+ this.setModel(camelInput.loadModel());
} else if (editorInput instanceof IURIEditorInput) {
editor.onInputLoading(editorInput);
IURIEditorInput uriInput = (IURIEditorInput) editorInput;
@@ -1147,9 +1217,9 @@ protected void showValidationError(Exception e) {
Throwable cause = e.getCause();
if (cause != null) {
text = cause.getMessage();
- cause.printStackTrace();
+ Activator.getLogger().error(e);
} else {
- e.printStackTrace();
+ Activator.getLogger().error(e);
}
}
showXmlValidationError(text);
@@ -1218,5 +1288,81 @@ public RiderEditor getEditor() {
public DesignerCache getActiveConfig() {
return this.activeConfig;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
+ */
+ @Override
+ public void handleDebugEvents(DebugEvent[] events) {
+ for (DebugEvent ev : events) {
+ if (ev.getSource() instanceof CamelThread == false && ev.getSource() instanceof CamelStackFrame == false) continue;
+ if (ev.getSource() instanceof CamelThread && ev.getKind() == DebugEvent.TERMINATE) {
+ // we are only interested in hit camel breakpoints
+ resetHighlightBreakpointNode();
+ } else {
+ if (ev.getSource() instanceof CamelThread) {
+ CamelThread thread = (CamelThread)ev.getSource();
+ if (ev.getKind() == DebugEvent.SUSPEND && ev.getDetail() == DebugEvent.BREAKPOINT) {
+ // a breakpoint was hit and thread is on suspend -> stack should be selected in tree now
+ try {
+ CamelStackFrame stackFrame = (CamelStackFrame)thread.getTopStackFrame();
+ if (stackFrame != null) highlightBreakpointNodeWithID(stackFrame.getEndpointId());
+ } catch (DebugException ex) {
+ Activator.getLogger().error(ex);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @return the highlightedNodeInDebugger
+ */
+ public AbstractNode getHighlightedNodeInDebugger() {
+ return this.highlightedNodeInDebugger;
+ }
+
+ /**
+ * highlights the node currently in breakpoint
+ *
+ * @param endpointNodeId the node id
+ */
+ private void highlightBreakpointNodeWithID(String endpointNodeId) {
+ // get the correct node for the id
+ final AbstractNode node = getModel().getNode(endpointNodeId);
+
+ if (node == null) return;
+ if (this.highlightedNodeInDebugger != null && node.getId() != null && node.getId().equals(highlightedNodeInDebugger.getId())) return;
+
+ // reset old highlight
+ resetHighlightBreakpointNode();
+
+ // add highlight to new node
+ setDebugHighLight(node, true);
+
+ // remember the new highlighted node
+ this.highlightedNodeInDebugger = node;
+ }
+
+ /**
+ * resets the highlight from the highlighted node
+ */
+ private void resetHighlightBreakpointNode() {
+ setDebugHighLight(this.highlightedNodeInDebugger, false);
+ }
+
+ /**
+ * switches the debug highlight for a given node on or off
+ *
+ * @param bo the node
+ * @param highlight the highlight status
+ */
+ private void setDebugHighLight(AbstractNode bo, boolean highlight) {
+ if (bo == null) return;
+
+ // delegate to an operation command for async transacted diagram update
+ DiagramOperations.highlightNode(this, bo, highlight);
}
}
View
21 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/editor/RiderEditor.java
@@ -15,6 +15,7 @@
import java.io.InputStream;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -63,7 +64,6 @@
import org.fusesource.ide.commons.ui.UIHelper;
import org.fusesource.ide.preferences.PreferenceManager;
import org.fusesource.ide.preferences.PreferencesConstants;
-import org.fusesource.ide.project.providers.CamelVirtualFile;
/**
@@ -653,8 +653,8 @@ public String getPreferredPerspectiveId() {
}
public void onFileLoading(IFile file) {
- if (file instanceof CamelVirtualFile) {
- setPartName(((CamelVirtualFile)file).getLocation().lastSegment());
+ if (file instanceof IResource) {
+ setPartName(((IResource)file).getLocation().lastSegment());
} else {
setPartName(file.getName());
}
@@ -664,7 +664,20 @@ public void onFileLoading(IFile file) {
public void onInputLoading(IEditorInput input) {
setPartName(input.getName());
}
-
+
+ public void switchToDesignEditor() {
+ // lets switch async just in case we've not created the page yet
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ updatedDesignPage();
+ setActiveEditor(getDesignEditor());
+ setActivePage(DESIGN_PAGE_INDEX);
+ getDesignEditor().setFocus();
+ }
+ });
+ }
+
public void switchToSourceEditor() {
// lets switch async just in case we've not created the page yet
Display.getDefault().asyncExec(new Runnable() {
View
120 ...de.camel.editor/src/org/fusesource/ide/camel/editor/features/custom/DeleteEndpointBreakpointFeature.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.fusesource.ide.camel.editor.features.custom;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.platform.IDiagramContainer;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.fusesource.ide.camel.editor.editor.RiderDesignEditor;
+import org.fusesource.ide.camel.editor.provider.ImageProvider;
+import org.fusesource.ide.camel.model.AbstractNode;
+import org.fusesource.ide.launcher.debug.util.CamelDebugUtils;
+
+/**
+ * deletes breakpoints for endpoint nodes
+ *
+ * @author lhein
+ */
+public class DeleteEndpointBreakpointFeature extends SetEndpointBreakpointFeature {
+
+ /**
+ * Create a new DeleteEndpointBreakpointFeature.
+ *
+ * @param fp the feature provider
+ * @param context the context
+ */
+ public DeleteEndpointBreakpointFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public void execute(ICustomContext context) {
+ PictogramElement _pe = context.getPictogramElements()[0] instanceof Connection ? ((Connection) context.getPictogramElements()[0])
+ .getStart().getParent() : context.getPictogramElements()[0];
+ final Object bo = getBusinessObjectForPictogramElement(_pe);
+
+ if (bo instanceof AbstractNode) {
+ AbstractNode _ep = (AbstractNode)bo;
+ try {
+ IFile contextFile = getContextFile();
+ String fileName = contextFile.getName();
+ IBreakpoint bp = CamelDebugUtils.getBreakpointForSelection(_ep.getId(), fileName);
+ if (bp != null) {
+ bp.delete();
+ }
+ } catch (CoreException e) {
+ final IDiagramContainer container = getDiagramBehavior().getDiagramContainer();
+ final Shell shell;
+ if (container instanceof RiderDesignEditor) {
+ shell = ((RiderDesignEditor) container).getEditorSite().getShell();
+ } else {
+ shell = Display.getCurrent().getActiveShell();
+ }
+ MessageDialog.openError(shell, "Error on deleting breakpoint", e.getStatus().getMessage());
+ return;
+ }
+ }
+ getDiagramBehavior().refreshRenderingDecorators(_pe);
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.impl.AbstractFeature#getName()
+ */
+ @Override
+ public String getName() {
+ return "Delete Breakpoint";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return "Deletes a breakpoint on the selected endpoint node";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#getImageId()
+ */
+ @Override
+ public String getImageId() {
+ return ImageProvider.IMG_GRAYDOT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
+ */
+ @Override
+ public boolean isAvailable(IContext context) {
+ ICustomContext cc = (ICustomContext)context;
+ PictogramElement _pe = cc.getPictogramElements()[0] instanceof Connection ? ((Connection) cc.getPictogramElements()[0])
+ .getStart().getParent() : cc.getPictogramElements()[0];
+ final Object bo = getBusinessObjectForPictogramElement(_pe);
+
+ if (bo instanceof AbstractNode) {
+ AbstractNode _ep = (AbstractNode)bo;
+ IFile contextFile = getContextFile();
+ String fileName = contextFile.getName();
+ return CamelDebugUtils.getBreakpointForSelection(_ep.getId(), fileName) != null;
+ }
+ return false;
+ }
+}
View
153 ...e.ide.camel.editor/src/org/fusesource/ide/camel/editor/features/custom/SetEndpointBreakpointFeature.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.fusesource.ide.camel.editor.features.custom;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.platform.IDiagramContainer;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.fusesource.ide.camel.editor.Activator;
+import org.fusesource.ide.camel.editor.editor.RiderDesignEditor;
+import org.fusesource.ide.camel.editor.provider.ImageProvider;
+import org.fusesource.ide.camel.model.AbstractNode;
+import org.fusesource.ide.launcher.debug.util.CamelDebugUtils;
+
+/**
+ * @author lhein
+ */
+public class SetEndpointBreakpointFeature extends AbstractCustomFeature {
+
+ /**
+ * creates the feature
+ *
+ * @param fp
+ */
+ public SetEndpointBreakpointFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
+ */
+ @Override
+ public void execute(ICustomContext context) {
+ PictogramElement _pe = context.getPictogramElements()[0] instanceof Connection ? ((Connection) context.getPictogramElements()[0])
+ .getStart().getParent() : context.getPictogramElements()[0];
+ final Object bo = getBusinessObjectForPictogramElement(_pe);
+ final IResource resource = getResource();
+
+ if (bo instanceof AbstractNode) {
+ AbstractNode _ep = (AbstractNode) bo;
+ try {
+ IFile contextFile = getContextFile();
+ String fileName = contextFile.getName();
+ String projectName = contextFile.getProject().getName();
+ CamelDebugUtils.createAndRegisterEndpointBreakpoint(resource, _ep, projectName, fileName);
+ } catch (CoreException e) {
+ final IDiagramContainer container = getDiagramBehavior().getDiagramContainer();
+ final Shell shell;
+ if (container instanceof RiderDesignEditor) {
+ shell = ((RiderDesignEditor) container).getEditorSite().getShell();
+ } else {
+ shell = Display.getCurrent().getActiveShell();
+ }
+ MessageDialog.openError(shell, "Error on adding breakpoint", e.getStatus().getMessage());
+ return;
+ }
+ }
+ getDiagramBehavior().refreshRenderingDecorators(_pe);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.impl.AbstractFeature#getName()
+ */
+ @Override
+ public String getName() {
+ return "Set Breakpoint";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return "Sets a breakpoint on the selected endpoint node";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#getImageId()
+ */
+ @Override
+ public String getImageId() {
+ return ImageProvider.IMG_REDDOT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
+ */
+ @Override
+ public boolean isAvailable(IContext context) {
+ ICustomContext cc = (ICustomContext) context;
+ PictogramElement _pe = cc.getPictogramElements()[0] instanceof Connection ? ((Connection) cc.getPictogramElements()[0])
+ .getStart().getParent() : cc.getPictogramElements()[0];
+ final Object bo = getBusinessObjectForPictogramElement(_pe);
+
+ if (bo instanceof AbstractNode) {
+ AbstractNode _ep = (AbstractNode) bo;
+ IFile contextFile = getContextFile();
+ String fileName = contextFile.getName();
+ return _ep.supportsBreakpoint() && CamelDebugUtils.getBreakpointForSelection(_ep.getId(), fileName) == null;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#canExecute(org.eclipse.graphiti.features.context.ICustomContext)
+ */
+ @Override
+ public boolean canExecute(ICustomContext context) {
+ return isAvailable(context);
+ }
+
+ protected IResource getResource() {
+ final IDiagramContainer container = getDiagramBehavior().getDiagramContainer();
+ if (container instanceof RiderDesignEditor) {
+ return ((RiderDesignEditor) container).getCamelContextFile();
+ }
+ return null;
+ }
+
+ protected PictogramElement getPEFromContext(ICustomContext context) {
+ return context.getPictogramElements()[0] instanceof Connection ? ((Connection) context.getPictogramElements()[0])
+ .getStart().getParent() : context.getPictogramElements()[0];
+ }
+
+ protected IFile getContextFile() {
+ return Activator.getDiagramEditor().asFileEditorInput(Activator.getDiagramEditor().getEditorInput()).getFile();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.impl.AbstractFeature#hasDoneChanges()
+ */
+ @Override
+ public boolean hasDoneChanges() {
+ return false;
+ }
+}
View
6 ...s/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/provider/CamelFeatureProvider.java
@@ -58,7 +58,9 @@
import org.fusesource.ide.camel.editor.features.create.CreateBeanFigureFeature;
import org.fusesource.ide.camel.editor.features.create.CreateEndpointFigureFeature;
import org.fusesource.ide.camel.editor.features.create.CreateFlowFeature;
+import org.fusesource.ide.camel.editor.features.custom.DeleteEndpointBreakpointFeature;
import org.fusesource.ide.camel.editor.features.custom.LayoutDiagramFeature;
+import org.fusesource.ide.camel.editor.features.custom.SetEndpointBreakpointFeature;
import org.fusesource.ide.camel.editor.features.delete.DeleteNodeFeature;
import org.fusesource.ide.camel.editor.features.delete.RemoveNodeFeature;
import org.fusesource.ide.camel.editor.features.other.CopyNodeFeature;
@@ -238,7 +240,9 @@ public ILayoutFeature getLayoutFeature(ILayoutContext context) {
{ /**new RenameNodeFeature(this),
new DrillDownNodeFeature(this),
new AssociateDiagramNodeFeature(this),**/
- new LayoutDiagramFeature(this)
+ new LayoutDiagramFeature(this),
+ new SetEndpointBreakpointFeature(this),
+ new DeleteEndpointBreakpointFeature(this),
// , new CollapseDummyFeature(this)
// , new SetGridVisibilityFeature(this)
/*
View
24 ...ns/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/provider/DiagramTypeProvider.java
@@ -60,5 +60,29 @@ public INotificationService getNotificationService() {
@Override
public boolean isAutoUpdateAtStartup() {
return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.dt.AbstractDiagramTypeProvider#isAutoUpdateAtRuntimeWhenEditorIsSaved()
+ */
+ @Override
+ public boolean isAutoUpdateAtRuntimeWhenEditorIsSaved() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.dt.AbstractDiagramTypeProvider#isAutoUpdateAtReset()
+ */
+ @Override
+ public boolean isAutoUpdateAtReset() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.dt.AbstractDiagramTypeProvider#isAutoUpdateAtRuntime()
+ */
+ @Override
+ public boolean isAutoUpdateAtRuntime() {
+ return true;
}
}
View
14 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/provider/ImageProvider.java
@@ -30,7 +30,10 @@
protected static final String POSTFIX_SMALL = "_small"; //$NON-NLS-1$
protected static final String POSTFIX_LARGE = "_large"; //$NON-NLS-1$
- public static final String IMG_FLOW = PREFIX + "flow"; //$NON-NLS-1$
+ public static final String IMG_FLOW = PREFIX + "flow"; //$NON-NLS-1$
+ public static final String IMG_REDDOT = PREFIX + "reddot"; //$NON-NLS-1$
+ public static final String IMG_GREENDOT = PREFIX + "greendot"; //$NON-NLS-1$
+ public static final String IMG_GRAYDOT = PREFIX + "graydot"; //$NON-NLS-1$
// outline
/**
@@ -47,7 +50,14 @@
* @see org.eclipse.graphiti.ui.platform.AbstractImageProvider#addAvailableImages()
*/
@Override
- protected void addAvailableImages() {
+ protected void addAvailableImages() {
+ addImage(IMG_REDDOT, ROOT_FOLDER_FOR_IMG + "red-dot.png"); //$NON-NLS-1$
+ addToImageRegistry(IMG_REDDOT, ROOT_FOLDER_FOR_IMG + "red-dot.png"); //$NON-NLS-1$
+ addImage(IMG_GRAYDOT, ROOT_FOLDER_FOR_IMG + "gray-dot.png"); //$NON-NLS-1$
+ addToImageRegistry(IMG_GRAYDOT, ROOT_FOLDER_FOR_IMG + "gray-dot.png"); //$NON-NLS-1$
+ addImage(IMG_GREENDOT, ROOT_FOLDER_FOR_IMG + "green-dot.png"); //$NON-NLS-1$
+ addToImageRegistry(IMG_GREENDOT, ROOT_FOLDER_FOR_IMG + "green-dot.png"); //$NON-NLS-1$
+
addImage(IMG_FLOW, ROOT_FOLDER_FOR_IMG + "flow16.png"); //$NON-NLS-1$
addToImageRegistry(IMG_FLOW, ROOT_FOLDER_FOR_IMG + "flow16.png"); //$NON-NLS-1$
addImage(IMG_OUTLINE_THUMBNAIL, ROOT_FOLDER_FOR_IMG + "thumbnail.gif"); //$NON-NLS-1$
View
53 .../org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/provider/ToolBehaviourProvider.java
@@ -16,6 +16,9 @@
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.emf.common.util.EList;
import org.eclipse.graphiti.dt.IDiagramTypeProvider;
import org.eclipse.graphiti.features.ICreateConnectionFeature;
@@ -44,6 +47,7 @@
import org.fusesource.ide.camel.editor.Activator;
import org.fusesource.ide.camel.editor.EditorMessages;
import org.fusesource.ide.camel.editor.Messages;
+import org.fusesource.ide.camel.editor.editor.RiderDesignEditor;
import org.fusesource.ide.camel.editor.features.custom.AddRouteFeature;
import org.fusesource.ide.camel.editor.provider.generated.AddNodeMenuFactory;
import org.fusesource.ide.camel.editor.validation.ValidationFactory;
@@ -51,6 +55,8 @@
import org.fusesource.ide.camel.model.AbstractNode;
import org.fusesource.ide.camel.model.Flow;
import org.fusesource.ide.commons.util.Objects;
+import org.fusesource.ide.launcher.debug.model.CamelEndpointBreakpoint;
+import org.fusesource.ide.launcher.debug.util.CamelDebugUtils;
/**
@@ -286,11 +292,18 @@ public void execute() {
*/
@Override
public IDecorator[] getDecorators(PictogramElement pe) {
- List<IDecorator> decorators = new LinkedList<IDecorator>();
+ List<IDecorator> decorators = new LinkedList<IDecorator>();
+
+ // first we add super decorators
+ IDecorator[] superDecorators = super.getDecorators(pe);
+ for (IDecorator d : superDecorators) decorators.add(d);
+
+ // and then our own
IFeatureProvider featureProvider = getFeatureProvider();
Object bo = featureProvider.getBusinessObjectForPictogramElement(pe);
if (bo instanceof AbstractNode) {
- AbstractNode node = (AbstractNode) bo;
+ AbstractNode node = (AbstractNode) bo;
+
ValidationResult res = ValidationFactory.getInstance().validate(node);
if (res.getInformationCount() > 0) {
for (String message : res.getInformations()) {
@@ -312,10 +325,40 @@ public void execute() {
imageRenderingDecorator.setMessage(message);
decorators.add(imageRenderingDecorator);
}
- }
+ }
+
+ // decorate breakpoints on endpoints
+ if (getDiagramTypeProvider().getDiagramBehavior().getDiagramContainer() != null && getDiagramTypeProvider().getDiagramBehavior().getDiagramContainer() instanceof RiderDesignEditor) {
+ RiderDesignEditor editor = (RiderDesignEditor)getDiagramTypeProvider().getDiagramBehavior().getDiagramContainer();
+ IFile activeFile = editor.asFileEditorInput(editor.getEditorInput()).getFile();
+ IBreakpoint bp = CamelDebugUtils.getBreakpointForSelection(node.getId(), activeFile.getName());
+ if (bp != null && bp instanceof CamelEndpointBreakpoint) {
+ CamelEndpointBreakpoint cep = (CamelEndpointBreakpoint)bp;
+
+ // we only want to decorate breakpoints which belong to this project
+ if (cep.getProjectName().equals(activeFile.getProject().getName())) {
+ try {
+ if (cep.isEnabled()) {
+ // show enabled breakpoint decorator
+ IDecorator imageRenderingDecorator = new ImageDecorator(ImageProvider.IMG_REDDOT);
+ imageRenderingDecorator.setMessage("");
+ decorators.add(imageRenderingDecorator);
+ } else {
+ // show disabled breakpoint decorator
+ IDecorator imageRenderingDecorator = new ImageDecorator(ImageProvider.IMG_GRAYDOT);
+ imageRenderingDecorator.setMessage("");
+ decorators.add(imageRenderingDecorator);
+ }
+ } catch (CoreException e) {
+ Activator.getLogger().error(e);
+ }
+ }
+ }
+ }
+
return decorators.toArray(new IDecorator[decorators.size()]);
- }
-
+ }
+
return super.getDecorators(pe);
}
View
18 plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/utils/StyleUtil.java
@@ -31,19 +31,19 @@
* @author lhein
*/
public class StyleUtil {
- private static final IColorConstant E_CLASS_TEXT_FOREGROUND = getColorConstant(PreferenceManager.getInstance().loadPreferenceAsString(PreferencesConstants.EDITOR_TEXT_COLOR));
- private static final IColorConstant E_CLASS_FOREGROUND = getColorConstant(PreferenceManager.getInstance().loadPreferenceAsString(PreferencesConstants.EDITOR_FIGURE_FG_COLOR));
- private static final IColorConstant E_CLASS_BACKGROUND = getColorConstant(PreferenceManager.getInstance().loadPreferenceAsString(PreferencesConstants.EDITOR_FIGURE_BG_COLOR));
- private static final IColorConstant E_CLASS_SHADOW_FOREGROUND = getColorConstant("128,128,128");
- private static final IColorConstant E_CLASS_SHADOW_BACKGROUND = getColorConstant("128,128,128");
- private static final AdaptedGradientColoredAreas E_CLASS_GRADIENT = PredefinedColoredAreas.getBlueWhiteGlossAdaptions();
+ public static final IColorConstant E_CLASS_TEXT_FOREGROUND = getColorConstant(PreferenceManager.getInstance().loadPreferenceAsString(PreferencesConstants.EDITOR_TEXT_COLOR));
+ public static final IColorConstant E_CLASS_FOREGROUND = getColorConstant(PreferenceManager.getInstance().loadPreferenceAsString(PreferencesConstants.EDITOR_FIGURE_FG_COLOR));
+ public static final IColorConstant E_CLASS_BACKGROUND = getColorConstant(PreferenceManager.getInstance().loadPreferenceAsString(PreferencesConstants.EDITOR_FIGURE_BG_COLOR));
+ public static final IColorConstant E_CLASS_SHADOW_FOREGROUND = getColorConstant("128,128,128");
+ public static final IColorConstant E_CLASS_SHADOW_BACKGROUND = getColorConstant("128,128,128");
+ public static final AdaptedGradientColoredAreas E_CLASS_GRADIENT = PredefinedColoredAreas.getBlueWhiteGlossAdaptions();
- private static final String DEFAULT_FONT = Display.getDefault().getSystemFont().getFontData()[0].getName();
- private static final int DEFAULT_FONT_SIZE = 10;
+ public static final String DEFAULT_FONT = Display.getDefault().getSystemFont().getFontData()[0].getName();
+ public static final int DEFAULT_FONT_SIZE = 10;
// use this flag to enable gradients (true) or use the predefined solid background color set in E_CLASS_BACKGROUND (false)
// TODO - setting this to true breaks round tripping and switching between routes using the outline view!!!
- private static final boolean USE_GRADIENT_BACKGROUND = false;
+ public static final boolean USE_GRADIENT_BACKGROUND = false;
public static Style getStyleForEClass(Diagram diagram) {
final String styleId = "E-CLASS"; //$NON-NLS-1$
View
3  plugins/org.fusesource.ide.camel.editor/src/org/fusesource/ide/camel/editor/views/DiagramView.java
@@ -171,7 +171,8 @@ private boolean isRelevantSelectionSource(IWorkbenchPart part, ISelection select
if (part.getClass().getName().equals("org.jboss.tools.jmx.ui.internal.views.navigator.JMXNavigator") ||
part.getClass().getName().equals("org.fusesource.ide.fabric.navigator.FabricNavigator") ||
part.getClass().getName().equals("org.fusesource.ide.fabric.views.MessagesView") ||
- part.getClass().getName().equals("org.eclipse.ui.views.properties.PropertySheet")
+ part.getClass().getName().equals("org.eclipse.ui.views.properties.PropertySheet") ||
+ part.getClass().getName().equals("org.eclipse.wst.server.ui.ServersView")
) {
process = true;
}
View
60 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/AbstractNode.java
@@ -30,6 +30,7 @@
import org.apache.camel.model.DescriptionDefinition;
import org.apache.camel.model.ExpressionNode;
import org.apache.camel.model.LoadBalanceDefinition;
+import org.apache.camel.model.OptionalIdentifiedDefinition;
import org.apache.camel.model.OtherwiseDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.RouteDefinition;
@@ -85,7 +86,6 @@
import org.fusesource.ide.camel.model.generated.Unmarshal;
import org.fusesource.ide.camel.model.generated.When;
import org.fusesource.ide.camel.model.util.Expressions;
-import org.fusesource.ide.commons.properties.BooleanPropertyDescriptor;
import org.fusesource.ide.commons.util.Objects;
import org.fusesource.ide.commons.util.Predicate;
import org.fusesource.ide.commons.util.Strings;
@@ -194,7 +194,23 @@ public boolean equals(Object obj) {
return false;
return false;
}
-
+
+ public String getCamelContextId() {
+ RouteContainer rc = null;
+ if (getParent() == null) {
+ rc = (RouteContainer)this;
+ } else {
+ rc = getParent();
+ if (rc.getParent() != null) {
+ rc = rc.getParent();
+ }
+ }
+ if (rc != null) {
+ return rc.getContextId();
+ }
+ return null;
+ }
+
/**
* Clears any EMF / diagram related resources
*/
@@ -506,7 +522,7 @@ protected String getNewID() {
protected synchronized static NodeIdFactory getNodeIdFactory() {
if (nodeIdFactory == null) {
- nodeIdFactory = new DefaultCamelContext().getNodeIdFactory();
+ nodeIdFactory = new DefaultCamelContext().getNodeIdFactory();
}
return nodeIdFactory;
}
@@ -1209,7 +1225,8 @@ public void savePropertiesToCamelDefinition(ProcessorDefinition processor) {
processor.setDescription(descriptionDefinition);
}
if (id != null && id.trim().length() > 0) {
- processor.setId(id);
+ processor.setId(id);
+ resetCustomId(processor);
}
}
@@ -1324,6 +1341,29 @@ public boolean canSupportOutput() {
}
return true;
+ }
+
+ /**
+ * checks if the node is the from node and therefore
+ * the first node in my route
+ *
+ * @return
+ */
+ public boolean isFirstNodeInRoute() {
+ return getInputs().isEmpty();
+ }
+
+ /**
+ * checks if the node is an expression node
+ *
+ * @return
+ */
+ public boolean supportsBreakpoint() {
+ return !isFirstNodeInRoute() && // not working on the From node
+ this instanceof When == false && // not working for When nodes
+ this instanceof Otherwise == false && // not working for Otherwise nodes
+ Strings.isBlank(getCamelContextId()) == false && // not working if no Camel Context Id is set
+ Strings.isBlank(getId()) == false; // not working if no ID is set
}
/**
@@ -1690,4 +1730,16 @@ private boolean compareObjects(Object a, Object b) {
return true;
}
+
+ /**
+ * this is a workaround for a bug in Camel 2.12 and will be
+ * most likely removed when the bug has been fixed
+ * (see https://issues.apache.org/jira/browse/CAMEL-7544)
+ *
+ * @param def definition
+ */
+ @Deprecated
+ protected void resetCustomId(OptionalIdentifiedDefinition def) {
+ def.setCustomId(null);
+ }
}
View
18 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/Endpoint.java
@@ -11,15 +11,15 @@
package org.fusesource.ide.camel.model;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.camel.model.FromDefinition;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ToDefinition;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.fusesource.ide.camel.model.generated.Messages;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.camel.model.FromDefinition;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.ToDefinition;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.fusesource.ide.camel.model.generated.Messages;
View
17 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/ExpressionNode.java
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.fusesource.ide.camel.model;
-
-public abstract class ExpressionNode extends AbstractNode {
- // TODO adds expression property...
-
-}
View
50 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/RouteContainer.java
@@ -11,23 +11,23 @@
package org.fusesource.ide.camel.model;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.RouteDefinition;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.fusesource.camel.tooling.util.ValidationHandler;
-import org.fusesource.camel.tooling.util.XmlModel;
-import org.fusesource.ide.camel.model.generated.Route;
-import org.fusesource.ide.commons.util.Objects;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.fusesource.camel.tooling.util.ValidationHandler;
+import org.fusesource.camel.tooling.util.XmlModel;
+import org.fusesource.ide.camel.model.generated.Route;
+import org.fusesource.ide.commons.util.Objects;
@@ -53,7 +53,7 @@
private boolean autoLayout;
private XmlModel model;
-
+
private boolean failedToParseXml;
public RouteContainer() {
@@ -225,7 +225,8 @@ public RouteContainer recreateModel() {
List<RouteDefinition> definitions = createRouteDefinitions();
// lets clone everything in our model apart from EMF stuff and children
- RouteContainer answer = new RouteContainer();
+ RouteContainer answer = new RouteContainer();
+ answer.setId(getId());
answer.beans = beans;
answer.camelContextEndpointUris = camelContextEndpointUris;
answer.autoLayout = autoLayout;
@@ -384,6 +385,17 @@ public boolean isFailedToParseXml() {
public void setFailedToParseXml(boolean failedToParseXml) {
this.failedToParseXml = failedToParseXml;
+ }
+
+ public String getContextId() {
+ return getId();
+ }
+
+ /**
+ * @param contextId the contextId to set
+ */
+ public void setContextId(String contextId) {
+ setId(contextId);
}
}
View
3  plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/RouteSupport.java
@@ -116,7 +116,8 @@ public RouteDefinition createRouteDefinition() {
FromDefinition from = new FromDefinition();
CamelModelHelper.setUri(from, endpoint);
CamelModelHelper.setId(from, endpoint);
- CamelModelHelper.setDescription(from, endpoint);
+ CamelModelHelper.setDescription(from, endpoint);
+ resetCustomId(from);
answer.getInputs().add(from);
View
15 plugins/org.fusesource.ide.camel.model/src/org/fusesource/ide/camel/model/io/XmlContainerMarshaller.java
@@ -25,6 +25,9 @@
import org.fusesource.ide.camel.model.Activator;
import org.fusesource.ide.camel.model.RouteContainer;
import org.fusesource.ide.commons.util.IOUtils;
+
+import de.pdark.decentxml.Attribute;
+import de.pdark.decentxml.Element;
public class XmlContainerMarshaller extends ContainerMarshallerSupport {
@@ -60,9 +63,17 @@ public RouteContainer loadRoutesFromText(String text) {
protected RouteContainer toContainer(XmlModel model) {
List<RouteDefinition> routes = model.getRouteDefinitionList();
- RouteContainer answer = new RouteContainer();
+ RouteContainer answer = new RouteContainer();
+ String id = null;
+ if (model.contextElement() != null && model.contextElement().getId() != null) {
+ id = model.contextElement().getId();
+ } else {
+ Element e = (Element)model.node().get();
+ Attribute a = e.getAttribute("id");
+ if (a != null) id = a.getValue();
+ }
+ answer.setId(id);
answer.addRoutes(routes);
-
answer.setBeans(model.beanMap());
answer.setCamelContextEndpointUris(model.endpointUriSet());
answer.setModel(model);
View
2  plugins/org.fusesource.ide.cheatsheets/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
View
0  ...usesource.ide.cheatsheets/src/main/java/Dummy.txt → plugins/org.fusesource.ide.cheatsheets/src/Dummy.txt
File renamed without changes
View
18 plugins/org.fusesource.ide.commons/plugin.xml
@@ -24,13 +24,8 @@
<extension
point="org.eclipse.ui.navigator.navigatorContent">
- <actionProvider
- class="org.fusesource.ide.commons.views.jmx.JMXContextMenuProvider"
- id="org.fusesource.ide.commons.views.jmx.JMXContextMenuProvider">
- <enablement>
- <instanceof
- value="org.fusesource.ide.commons.ui.ContextMenuProvider">
- <viewerActionBinding
+ <!--
+ <viewerActionBinding
viewerId="org.jboss.tools.jmx.ui.internal.views.navigator.MBeanExplorer">
<includes>
<actionExtension
@@ -41,6 +36,13 @@
<viewerActionBinding
viewerId="org.jboss.tools.jmx.ui.internal.views.navigator.MBeanExplorer">
</viewerActionBinding>
+ -->
+ <actionProvider
+ class="org.fusesource.ide.commons.views.jmx.JMXContextMenuProvider"
+ id="org.fusesource.ide.commons.views.jmx.JMXContextMenuProvider">
+ <enablement>
+ <instanceof
+ value="org.fusesource.ide.commons.ui.ContextMenuProvider">
</instanceof>
</enablement>
</actionProvider>
@@ -50,7 +52,7 @@
<extension
point="org.eclipse.ui.navigator.viewer">
<viewerContentBinding
- viewerId="jmx.ui.internal.views.navigator.MBeanExplorer">
+ viewerId="org.jboss.tools.jmx.ui.internal.views.navigator.MBeanExplorer">
<includes>
<contentExtension
isRoot="false"
View
34 plugins/org.fusesource.ide.commons/src/org/fusesource/ide/commons/util/CamelUtils.java
@@ -13,6 +13,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.fusesource.ide.commons.contenttype.BlueprintXmlMatchingStrategy;
import org.fusesource.ide.commons.contenttype.CamelXmlMatchingStrategy;
@@ -34,25 +35,24 @@
* @return
*/
public static boolean isCamelContextFile(String filePath) {
- boolean isBlueprint = false;
+ boolean isCamelContext = false;
if (filePath != null && filePath.trim().length()>0) {
String rawPath = null;
if (filePath.startsWith("file:")) {
- rawPath = filePath.substring(5);
+ rawPath = filePath.substring("file:".length());
} else {
rawPath = filePath;
}
- Path f = new Path(rawPath);
- java.io.File nf = new java.io.File(f.toOSString());
- if (nf.exists() && nf.isFile()) {
+ IPath f = Path.fromOSString(rawPath);
+ if (f.toFile().exists() && f.toFile().isFile()) {
// file exists, now check if its blueprint or spring
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(f.makeRelativeTo(ResourcesPlugin.getWorkspace().getRoot().getLocation()));
- isBlueprint = camelXmlMatcher.matches(file);
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(f);
+ if (file != null) isCamelContext = camelXmlMatcher.matches(file);
}
}
- return isBlueprint;
+ return isCamelContext;
}
/**
@@ -70,12 +70,11 @@ public static boolean isBlueprintFile(String filePath) {
} else {
rawPath = filePath;
}
- Path f = new Path(rawPath);
- java.io.File nf = new java.io.File(f.toOSString());
- if (nf.exists() && nf.isFile()) {
+ IPath f = Path.fromOSString(rawPath);
+ if (f.toFile().exists() && f.toFile().isFile()) {
// file exists, now check if its blueprint or spring
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(f.makeRelativeTo(ResourcesPlugin.getWorkspace().getRoot().getLocation()));
- isBlueprint = blueprintXmlMatcher.matches(file);
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(f);
+ if (file != null) isBlueprint = blueprintXmlMatcher.matches(file);
}
}
@@ -97,12 +96,11 @@ public static boolean isSpringFile(String filePath) {
} else {
rawPath = filePath;
}
- Path f = new Path(rawPath);
- java.io.File nf = new java.io.File(f.toOSString());
- if (nf.exists() && nf.isFile()) {
+ IPath f = Path.fromOSString(rawPath);
+ if (f.toFile().exists() && f.toFile().isFile()) {
// file exists, now check if its blueprint or spring
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(f.makeRelativeTo(ResourcesPlugin.getWorkspace().getRoot().getLocation()));
- isSpring = springXmlMatcher.matches(file);
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(f);
+ if (file != null) isSpring = springXmlMatcher.matches(file);
}
}
View
2  ....fusesource.ide.fabric.camel/src/org/fusesource/ide/fabric/camel/editor/CamelContextNodeEditorInput.java
@@ -54,7 +54,7 @@ public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
if (adapter.equals(IFile.class)) {
getFileEditorInput();
IPath p = Path.fromOSString(tempFile.getPath());
- IFile file= ResourcesPlugin.getWorkspace().getRoot().getFile(p);
+ IFile file= ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(p);
return file;
}
return null;
View
15 ...usesource.ide.fabric/src/org/fusesource/ide/fabric/navigator/maven/BuildLaunchConfigurationTabGroup.java
@@ -11,14 +11,13 @@
package org.fusesource.ide.fabric.navigator.maven;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.EnvironmentTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.RefreshTab;
-import org.fusesource.ide.launcher.ui.tabs.MavenJRETab;
-
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.EnvironmentTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.RefreshTab;
+import org.eclipse.m2e.ui.internal.launch.MavenJRETab;
/**
* @author lhein
View
6 plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/navigator/maven/FabricDeployAction.java
@@ -15,7 +15,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.List;
-
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Result;
@@ -24,7 +24,7 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-
+
import org.apache.maven.cli.MavenCli;
import org.eclipse.core.resources.IContainer;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
@@ -32,7 +32,7 @@
import org.eclipse.m2e.core.MavenPlugin;
import org.fusesource.ide.fabric.FabricPlugin;
import org.fusesource.ide.fabric.navigator.ProfileNode;
-import org.fusesource.ide.launcher.ui.ExecutePomActionSupport;
+import org.fusesource.ide.launcher.ui.launch.ExecutePomActionSupport;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
View
2  plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/navigator/maven/FabricInstallAction.java
@@ -12,7 +12,7 @@
package org.fusesource.ide.fabric.navigator.maven;
-import org.fusesource.ide.launcher.ui.ExecutePomActionSupport;
+import org.fusesource.ide.launcher.ui.launch.ExecutePomActionSupport;
/**
View
22 ...s/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/navigator/maven/InstallMavenLaunchMainTab.java
@@ -10,18 +10,22 @@
******************************************************************************/
package org.fusesource.ide.fabric.navigator.maven;
-
-import org.fusesource.ide.launcher.ui.tabs.MavenLaunchMainTab;
+
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.m2e.ui.internal.launch.MavenLaunchMainTab;
public class InstallMavenLaunchMainTab extends MavenLaunchMainTab {
public InstallMavenLaunchMainTab(boolean isBuilder) {
- super(isBuilder);
- }
-
- @Override
- protected String getDefaultGoals() {
- return "install";
+ super();
}
-
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.launch.MavenLaunchMainTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ @Override
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(ATTR_GOALS, "install");
+ super.setDefaults(configuration);
+ }
}
View
4 plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/views/MessagesView.java
@@ -162,7 +162,9 @@ private boolean isRelevantSelectionSource(IWorkbenchPart part, ISelection select
// we filter for specific selection sources...
if (part.getClass().getName().equals("org.jboss.tools.jmx.ui.internal.views.navigator.JMXNavigator") ||
part.getClass().getName().equals("org.fusesource.ide.fabric.navigator.FabricNavigator") ||
- part.getClass().getName().equals("org.fusesource.ide.camel.editor.views.DiagramView") ) {
+ part.getClass().getName().equals("org.fusesource.ide.camel.editor.views.DiagramView") ||
+ part.getClass().getName().equals("org.eclipse.wst.server.ui.ServersView")
+ ) {
process = true;
}
View
2  plugins/org.fusesource.ide.fabric/src/org/fusesource/ide/fabric/views/logs/LogsView.java
@@ -150,7 +150,7 @@ protected void removeLocalMenus(IMenuManager manager) {
@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
if (adapter == IPropertySheetPage.class) {
- ISelection selection = viewer.getSelection();
+// ISelection selection = viewer.getSelection();
//TabbedPropertySheetPage answer = new TabbedPropertySheetPage(this);
return new FormPropertySheetPage(new LogDetailForm());
}
View
8 plugins/org.fusesource.ide.launcher.ui/META-INF/MANIFEST.MF
@@ -26,10 +26,12 @@ Require-Bundle: org.fusesource.ide.commons,
org.eclipse.m2e.editor.xml,
org.eclipse.m2e.jdt,
org.eclipse.m2e.launching;bundle-version="1.4.0",
- org.slf4j.api;bundle-version="[1.6.1,2.0.0)"
+ org.eclipse.equinox.security;bundle-version="1.2.0",
+ org.eclipse.ui.views;bundle-version="3.7.0",
+ org.eclipse.ui.workbench.texteditor;bundle-version="3.9.0",
+ org.eclipse.jface.text;bundle-version="3.9.0"
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.fusesource.ide.launcher.ui.Activator
Bundle-ClassPath: .
-Export-Package: org.fusesource.ide.launcher.ui,
- org.fusesource.ide.launcher.ui.tabs
Import-Package: org.eclipse.core.externaltools.internal
+Export-Package: org.fusesource.ide.launcher.ui.launch
View
7 plugins/org.fusesource.ide.launcher.ui/OSGI-INF/l10n/bundle.properties
@@ -12,5 +12,10 @@ Bundle-Name=Fuse Launcher UI Plugin
Bundle-Vendor = JBoss by Red Hat
tabgroup.camelContext.description=Update the settings for running the Camel context locally...
launcher.tab.camelcontext.name=Camel Context
+launcher.tab.debug.name=Debug JMX Connection
launchShortCut.camelContext.label=Local Camel Context
-launchShortCut.camelContext.notests.label=Local Camel Context (without tests)
+launchShortCut.camelContext.notests.label=Local Camel Context (without tests)
+camel.debug.context.name=Camel Debug Context
+camel.debug.context.description=Debugging a Camel Context
+command.variables.resetdebugcounter.name=Reset Debug Counter
+command.variables.resetdebugcounter.description=Resets the debuggers message counter to zero...
View
BIN  plugins/org.fusesource.ide.launcher.ui/icons/endpoint_node.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  plugins/org.fusesource.ide.launcher.ui/icons/message.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  plugins/org.fusesource.ide.launcher.ui/icons/pause_camel_context.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  plugins/org.fusesource.ide.launcher.ui/icons/variable.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
105 plugins/org.fusesource.ide.launcher.ui/plugin.xml
@@ -9,6 +9,7 @@
id="org.fusesource.ide.launcher.ui.launchConfigurationTypeImage.camelContext">
</launchConfigurationTypeImage>
</extension>
+
<extension
point="org.eclipse.debug.ui.launchConfigurationTabGroups">
<launchConfigurationTabGroup
@@ -18,6 +19,7 @@
type="org.fusesource.ide.launcher.camelContext">
</launchConfigurationTabGroup>
</extension>
+
<extension
point="org.eclipse.debug.ui.launchConfigurationTabs">
<tab
@@ -26,15 +28,22 @@
id="org.fusesource.ide.launcher.ui.tab.CamelContext"
name="%launcher.tab.camelcontext.name">
</tab>
+ <tab
+ class="org.fusesource.ide.launcher.ui.tabs.DebugJmxTab"
+ group="org.fusesource.ide.launcher.ui.launchConfigurationTabGroup.camelContext"
+ id="org.fusesource.ide.launcher.ui.tab.Debug"
+ name="%launcher.tab.debug.name">
+ </tab>
</extension>
+
<extension
point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
- class="org.fusesource.ide.launcher.ui.ExecutePomAction:clean package camel:run"
+ class="org.fusesource.ide.launcher.ui.launch.ExecutePomAction:clean package camel:run"
icon="icons/run_camel_context.png"
id="org.fusesource.ide.launcher.ui.shortcut.camelContext"
label="%launchShortCut.camelContext.label"
- modes="run">
+ modes="run,debug">
<contextualLaunch>
<enablement>
@@ -56,12 +65,13 @@
id="org.fusesource.ide.launcher.camelContext">
</configurationType>
</shortcut>
+
<shortcut
- class="org.fusesource.ide.launcher.ui.ExecutePomActionNoTests:clean package camel:run -Dmaven.test.skip=true"
+ class="org.fusesource.ide.launcher.ui.launch.ExecutePomActionNoTests:clean package camel:run"
icon="icons/run_camel_context.png"
id="org.fusesource.ide.launcher.ui.shortcut.camelContextNoTests"
label="%launchShortCut.camelContext.notests.label"
- modes="run">
+ modes="run,debug">
<contextualLaunch>
<enablement>
@@ -80,8 +90,93 @@
</enablement>
</contextualLaunch>
<configurationType
- id="org.fusesource.ide.launcher.camelContextNoTests">
+ id="org.fusesource.ide.launcher.camelContext">
</configurationType>
</shortcut>
</extension>
+
+
+ <extension
+ point="org.eclipse.debug.ui.debugModelPresentations">
+ <debugModelPresentation
+ class="org.fusesource.ide.launcher.ui.debug.model.CamelModelPresentation"
+ id="org.fusesource.ide.launcher.debug.camel">
+ </debugModelPresentation>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.debug.ui.DebugPerspective">
+ </perspectiveExtension>
+ </extension>
+ <extension
+ point="org.eclipse.ui.contexts">
+ <context
+ name="%camel.debug.context.name"
+ description="%camel.debug.context.description"
+ id="org.fusesource.ide.launcher.camel.debugging"
+ parentId="org.eclipse.debug.ui.debugging">
+ </context>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.debugModelContextBindings">
+ <modelContextBinding
+ debugModelId="org.fusesource.ide.launcher.debug.camel"
+ contextId="org.fusesource.ide.launcher.camel.debugging">
+ </modelContextBinding>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.variableValueEditors">
+ <variableValueEditor
+ class="org.fusesource.ide.launcher.ui.debug.editors.VariableValueEditor"
+ modelId="org.fusesource.ide.launcher.debug.camel">
+ </variableValueEditor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.debug.ui.VariableView">
+ <command
+ commandId="org.fusesource.ide.launcher.ui.resetDebugCounterCommand"
+ label="%command.variables.resetdebugcounter.name"
+ style="push"
+ tooltip="%command.variables.resetdebugcounter.description">
+ </command>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="toolbar:org.eclipse.debug.ui.VariableView">
+ <command
+ commandId="org.fusesource.ide.launcher.ui.resetDebugCounterCommand"
+ label="%command.variables.resetdebugcounter.name"
+ style="push"
+ tooltip="%command.variables.resetdebugcounter.description">
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ description="%command.variables.resetdebugcounter.description"
+ id="org.fusesource.ide.launcher.ui.resetDebugCounterCommand"
+ name="%command.variables.resetdebugcounter.name">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.fusesource.ide.launcher.ui.debug.handlers.ResetDebugCounterHandler"
+ commandId="org.fusesource.ide.launcher.ui.resetDebugCounterCommand">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commandImages">
+ <image
+ commandId="org.fusesource.ide.launcher.ui.resetDebugCounterCommand"
+ icon="icons/variable.png">
+ </image>
+ </extension>
+
</plugin>
View
24 plugins/org.fusesource.ide.launcher.ui/src/org/fusesource/ide/launcher/ui/Activator.java
@@ -11,16 +11,14 @@
package org.fusesource.ide.launcher.ui;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.fusesource.ide.commons.logging.RiderLogFacade;
+import org.fusesource.ide.commons.logging.RiderLogFacade;
+import org.fusesource.ide.commons.ui.ImagesActivatorSupport;
/**
* @author lhein
*/
-public class Activator extends AbstractUIPlugin {
+public class Activator extends ImagesActivatorSupport {
private static Activator instance;
@@ -34,16 +32,8 @@ public Activator() {
public static