Skip to content

Commit

Permalink
[eclipse] Add shortcuts for "Run as" and "Debug as".
Browse files Browse the repository at this point in the history
close #475

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Sep 8, 2016
1 parent d5be08b commit 4f68510
Show file tree
Hide file tree
Showing 7 changed files with 705 additions and 0 deletions.
1 change: 1 addition & 0 deletions eclipse-sarl/plugins/io.sarl.eclipse/META-INF/MANIFEST.MF
Expand Up @@ -33,6 +33,7 @@ Export-Package: io.sarl.eclipse,
io.sarl.eclipse.launching.config,
io.sarl.eclipse.launching.dialog,
io.sarl.eclipse.launching.runner,
io.sarl.eclipse.launching.shortcuts,
io.sarl.eclipse.launching.sreproviding;x-friends:="io.sarl.eclipse.tests",
io.sarl.eclipse.natures;x-friends:="io.sarl.eclipse.tests",
io.sarl.eclipse.navigator;x-friends:="io.sarl.eclipse.tests",
Expand Down
Expand Up @@ -15,6 +15,8 @@ preference.errorWarning = Errors/Warnings
launch.sarlApplication = SARL Application
launch.sarlLauncher = SARL Standard Launcher
launch.sarlLauncherDescription = The SARL application launcher supports running and debugging SARL applications on compatible platform.
launch.runas = Run SARL Agent
launch.debugas = Debug SARL Agent
keyword.sarl = SARL
keyword.sarl.sre = SRE
keyword.sarl.runtime = Runtime
Expand Down
43 changes: 43 additions & 0 deletions eclipse-sarl/plugins/io.sarl.eclipse/plugin.xml
Expand Up @@ -200,6 +200,49 @@
id="io.sarl.eclipse.debug.LaunchConfigTabGroup"
type="io.sarl.eclipse.debug.LaunchConfigType" />
</extension>

<!-- Launch shortcuts (Run As, Debug As) -->
<extension
point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
class="io.sarl.eclipse.SARLEclipseExecutableExtensionFactory:io.sarl.eclipse.launching.shortcuts.SARLLaunchShortcut"
icon="icons/sarl_16.png"
id="io.sarl.eclipse.launching.shortcuts.SARLLaunchShortcut"
label="%launch.sarlApplication"
modes="run,debug">
<contextualLaunch>
<contextLabel mode="run" label="%launch.runas" />
<contextLabel mode="debug" label="%launch.debugas" />
<enablement>
<with variable="selection">
<count value="1"/>
<iterate ifEmpty="false" operator="or">
<or>
<reference definitionId="io.sarl.lang.SARL.Editor.opened"/>
<and>
<instanceof value="org.eclipse.core.resources.IFile"/>
<adapt type="org.eclipse.core.resources.IFile">
<test property="org.eclipse.core.resources.extension" value="sarl"/>
</adapt>
</and>
<instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
<instanceof value="org.eclipse.jdt.core.IPackageFragmentRoot"/>
<instanceof value="org.eclipse.core.resources.IProject"/>
<and>
<instanceof value="org.eclipse.jdt.core.IJavaProject"/>
<adapt type="org.eclipse.core.resources.IProject">
<test property="org.eclipse.core.resources.projectNature"
value="io.sarl.eclipse.SARLProjectNature"/>
</adapt>
</and>
</or>
</iterate>
</with>
</enablement>
</contextualLaunch>
</shortcut>
</extension>

<extension
point="org.eclipse.ui.preferencePages">
<page
Expand Down
@@ -0,0 +1,50 @@
/*
* $Id$
*
* SARL is an general-purpose agent programming language.
* More details on http://www.sarl.io
*
* Copyright (C) 2014-2016 the original authors or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.sarl.eclipse.launching.shortcuts;

import org.eclipse.osgi.util.NLS;

/** NLS Messages.
*
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
*/
@SuppressWarnings("all")
public class Messages extends NLS {
private static final String BUNDLE_NAME = "io.sarl.eclipse.launching.shortcuts.messages"; //$NON-NLS-1$
public static String SARLLaunchShortcut_0;
public static String SARLLaunchShortcut_2;
public static String SARLLaunchShortcut_5;
public static String SARLLaunchShortcut_6;
public static String SARLLaunchShortcut_7;
public static String SARLLaunchShortcut_8;
public static String SARLLaunchShortcut_9;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}

private Messages() {
}
}

0 comments on commit 4f68510

Please sign in to comment.