Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2017-05-02 16:23:02 +0000
committerRoland Grunberg2017-06-08 18:56:20 +0000
commit32a4a7d5905a42450535fe50471b2f36fe6ef3f5 (patch)
tree25d4f2c8f3619722c57b24401f4002a0304b65ee
parent68ae0ef7ee2ed3acf85ab37f915c0723e7f72978 (diff)
downloadorg.eclipse.linuxtools-32a4a7d5905a42450535fe50471b2f36fe6ef3f5.tar.gz
org.eclipse.linuxtools-32a4a7d5905a42450535fe50471b2f36fe6ef3f5.tar.xz
org.eclipse.linuxtools-32a4a7d5905a42450535fe50471b2f36fe6ef3f5.zip
Add the boilerplate classes and extension points.
- launch shortcut, delegate, launch configuration type, and their necessary dependencies Change-Id: I3892ed275d59e5cc79a0a68c52b2dba82aa51916 Reviewed-on: https://git.eclipse.org/r/98930 Reviewed-by: Roland Grunberg <rgrunber@redhat.com> Tested-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF10
-rw-r--r--containers/org.eclipse.linuxtools.jdt.docker.launcher/build.properties4
-rw-r--r--containers/org.eclipse.linuxtools.jdt.docker.launcher/icons/repository-synchronize-attributes.pngbin0 -> 514 bytes
-rw-r--r--containers/org.eclipse.linuxtools.jdt.docker.launcher/plugin.xml68
-rw-r--r--containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/JavaAppInContainerLaunchDelegate.java27
-rw-r--r--containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/JavaApplicationInContainerLaunchShortcut.java27
6 files changed, 133 insertions, 3 deletions
diff --git a/containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF b/containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF
index 55fb2cadd4..fe8edb34c3 100644
--- a/containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF
+++ b/containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF
@@ -6,5 +6,11 @@ Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Eclipse Linux Tools
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.jdt.debug.ui;bundle-version="3.8.0",
- org.eclipse.jdt.launching;bundle-version="3.9.0"
+Require-Bundle: org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.equinox.common,
+ org.eclipse.ui.workbench,
+ org.eclipse.jface,
+ org.eclipse.jdt.launching;bundle-version="3.9.0",
+ org.eclipse.jdt.core;bundle-version="3.13.0",
+ org.eclipse.jdt.debug.ui;bundle-version="3.8.0"
diff --git a/containers/org.eclipse.linuxtools.jdt.docker.launcher/build.properties b/containers/org.eclipse.linuxtools.jdt.docker.launcher/build.properties
index 1fcd874828..5aed6e9933 100644
--- a/containers/org.eclipse.linuxtools.jdt.docker.launcher/build.properties
+++ b/containers/org.eclipse.linuxtools.jdt.docker.launcher/build.properties
@@ -2,4 +2,6 @@ source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
- about.html
+ about.html,\
+ plugin.xml,\
+ icons/
diff --git a/containers/org.eclipse.linuxtools.jdt.docker.launcher/icons/repository-synchronize-attributes.png b/containers/org.eclipse.linuxtools.jdt.docker.launcher/icons/repository-synchronize-attributes.png
new file mode 100644
index 0000000000..195659f77c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.jdt.docker.launcher/icons/repository-synchronize-attributes.png
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.jdt.docker.launcher/plugin.xml b/containers/org.eclipse.linuxtools.jdt.docker.launcher/plugin.xml
new file mode 100644
index 0000000000..cb934505b8
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.jdt.docker.launcher/plugin.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.debug.ui.launchShortcuts">
+ <shortcut
+ class="org.eclipse.linuxtools.jdt.docker.launcher.JavaApplicationInContainerLaunchShortcut"
+ description="Run the current Java application within a container"
+ icon="icons/repository-synchronize-attributes.png"
+ id="org.eclipse.linuxtools.jdt.docker.launcher.container.launch"
+ label="Java Application In Container"
+ modes="run, debug">
+ <contextualLaunch>
+ <enablement>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate>
+ <and>
+ <adapt
+ type="org.eclipse.jdt.core.IJavaElement">
+ <test
+ property="org.eclipse.jdt.core.isInJavaProject">
+ </test>
+ </adapt>
+ <or>
+ <test
+ property="org.eclipse.jdt.launching.hasMain">
+ </test>
+ <test
+ property="org.eclipse.jdt.launching.isContainer">
+ </test>
+ <test
+ property="org.eclipse.jdt.launching.isPackageFragment">
+ </test>
+ <test
+ property="org.eclipse.jdt.launching.isPackageFragmentRoot">
+ </test>
+ </or>
+ </and>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ </extension>
+ <extension
+ point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ delegate="org.eclipse.linuxtools.jdt.docker.launcher.JavaAppInContainerLaunchDelegate"
+ id="org.eclipse.linuxtools.jdt.docker.launcher.JavaAppInContainerLaunchConfigurationType"
+ modes="run, debug"
+ name="Java App In Container"
+ sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector">
+ </launchConfigurationType>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+ <launchConfigurationTypeImage
+ configTypeID="org.eclipse.linuxtools.jdt.docker.launcher.JavaAppInContainerLaunchConfigurationType"
+ icon="icons/repository-synchronize-attributes.png"
+ id="org.eclipse.linuxtools.jdt.docker.launcher.JavaAppInContainerLaunchConfigurationTypeImage">
+ </launchConfigurationTypeImage>
+ </extension>
+
+</plugin>
diff --git a/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/JavaAppInContainerLaunchDelegate.java b/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/JavaAppInContainerLaunchDelegate.java
new file mode 100644
index 0000000000..67a2c93d59
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/JavaAppInContainerLaunchDelegate.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Red Hat Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.jdt.docker.launcher;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate;
+
+public class JavaAppInContainerLaunchDelegate extends AbstractJavaLaunchConfigurationDelegate {
+
+ @Override
+ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
+ System.out.println("Launching From Delegate.");
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/JavaApplicationInContainerLaunchShortcut.java b/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/JavaApplicationInContainerLaunchShortcut.java
new file mode 100644
index 0000000000..e921c6cc5a
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/JavaApplicationInContainerLaunchShortcut.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Red Hat Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.jdt.docker.launcher;
+
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut;
+
+public class JavaApplicationInContainerLaunchShortcut extends JavaApplicationLaunchShortcut {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#getConfigurationType()
+ */
+ @Override
+ protected ILaunchConfigurationType getConfigurationType() {
+ return DebugPlugin.getDefault().getLaunchManager()
+ .getLaunchConfigurationType("org.eclipse.linuxtools.jdt.docker.launcher.JavaAppInContainerLaunchConfigurationType"); //$NON-NLS-1$
+ }
+}

Back to the top