Commit abc300b3 authored by ekrisza's avatar ekrisza
Browse files

somewhat better comments.


Signed-off-by: default avatarekrisza <ekrisza@HU00060815.ericsson.se>
parent 3953f185
......@@ -32,8 +32,11 @@ import org.eclipse.titan.executor.tabpages.hostcontrollers.HostControllersTab;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
//FIXME comment
/**
* This class lets the user create a launch configuration via a shortcut.
* By selecting a project and the proper type of launch configuration in the runs on menu, a temporal launch configuration is created.
* If this is a new launch configuration it is saved with a temporal name, if something with the same selection input can be found it is reused.
*
* @author Kristof Szabados
* */
public abstract class LaunchShortcut implements ILaunchShortcut {
......@@ -50,6 +53,14 @@ public abstract class LaunchShortcut implements ILaunchShortcut {
public abstract boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration,
final IProject project, final String configFilePath);
/**
* Creates a working copy of the launch configuration from the available information,
* that can be used to initialize the pages of the launch configuration.
*
* @param project the project to use.
* @param file the file selected by the user.
* @param mode one of the launch modes defined by the launch manager
* */
protected ILaunchConfigurationWorkingCopy getWorkingCopy(final IProject project, final IFile file, final String mode) {
try {
......@@ -103,12 +114,14 @@ public abstract class LaunchShortcut implements ILaunchShortcut {
}
@Override
/** {@inheritDoc} */
public final void launch(final IEditorPart editor, final String mode) {
// Execution from editors is not supported
ErrorReporter.INTERNAL_ERROR("LaunchShortcut.launch called from an editor even though it is no registered to support such calls.");
}
@Override
/** {@inheritDoc} */
public final void launch(final ISelection selection, final String mode) {
if (!(selection instanceof IStructuredSelection)) {
return;
......
......@@ -32,6 +32,10 @@ import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
/**
* This class lets the user create a launch configuration via a shortcut.
* By selecting a configuration file and the proper type of launch configuration in the runs on menu, a temporal launch configuration is created.
* If this is a new launch configuration it is saved with a temporal name, if something with the same selection input can be found it is reused.
*
* @author Kristof Szabados
* */
public abstract class LaunchShortcutConfig implements ILaunchShortcut {
......@@ -48,6 +52,14 @@ public abstract class LaunchShortcutConfig implements ILaunchShortcut {
public abstract boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration,
final IProject project, final String configFilePath);
/**
* Creates a working copy of the launch configuration from the available information,
* that can be used to initialize the pages of the launch configuration.
*
* @param project the project to use.
* @param file the file selected by the user.
* @param mode one of the launch modes defined by the launch manager
* */
protected ILaunchConfigurationWorkingCopy getWorkingCopy(final IProject project, final IFile file, final String mode) {
try {
......@@ -102,12 +114,14 @@ public abstract class LaunchShortcutConfig implements ILaunchShortcut {
@Override
/** {@inheritDoc} */
public final void launch(final IEditorPart editor, final String mode) {
// Execution from editors is not supported
ErrorReporter.INTERNAL_ERROR("LaunchShortcutConfig.launch called from an editor even though it is no registered to support such calls.");
}
@Override
/** {@inheritDoc} */
public final void launch(final ISelection selection, final String mode) {
if (!(selection instanceof IStructuredSelection)) {
return;
......
......@@ -17,16 +17,19 @@ import org.eclipse.titan.executor.tabpages.maincontroller.JNIMainControllerTab;
public final class LaunchShortcut extends org.eclipse.titan.executor.executors.LaunchShortcut {
@Override
/** {@inheritDoc} */
protected String getConfigurationId() {
return "org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate";
}
@Override
/** {@inheritDoc} */
protected String getDialogTitle() {
return "Select (parallel) jni mode execution configuration";
}
@Override
/** {@inheritDoc} */
public boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration, final IProject project, final String configFilePath) {
return JNIMainControllerTab.initLaunchConfiguration(configuration, project, configFilePath);
}
......
......@@ -16,16 +16,19 @@ import org.eclipse.titan.executor.tabpages.maincontroller.JNIMainControllerTab;
* */
public final class LaunchShortcutConfig extends org.eclipse.titan.executor.executors.LaunchShortcutConfig {
@Override
/** {@inheritDoc} */
protected String getConfigurationId() {
return "org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate";
}
@Override
/** {@inheritDoc} */
protected String getDialogTitle() {
return "Select jni mode execution";
}
@Override
/** {@inheritDoc} */
public boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration, final IProject project, final String configFilePath) {
return JNIMainControllerTab.initLaunchConfiguration(configuration, project, configFilePath);
}
......
......@@ -16,16 +16,19 @@ import org.eclipse.titan.executor.tabpages.maincontroller.MctrCliMainControllerT
* */
public final class LaunchShortcut extends org.eclipse.titan.executor.executors.LaunchShortcut {
@Override
/** {@inheritDoc} */
protected String getConfigurationId() {
return "org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate";
}
@Override
/** {@inheritDoc} */
protected String getDialogTitle() {
return "Select (parallel) mctr_cli mode execution configuration";
}
@Override
/** {@inheritDoc} */
public boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration, final IProject project, final String configFilePath) {
return MctrCliMainControllerTab.initLaunchConfiguration(configuration, project, configFilePath);
}
......
......@@ -16,16 +16,19 @@ import org.eclipse.titan.executor.tabpages.maincontroller.MctrCliMainControllerT
* */
public final class LaunchShortcutConfig extends org.eclipse.titan.executor.executors.LaunchShortcutConfig {
@Override
/** {@inheritDoc} */
protected String getConfigurationId() {
return "org.eclipse.titan.executor.executors.mctr.cli.LaunchConfigurationDelegate";
}
@Override
/** {@inheritDoc} */
protected String getDialogTitle() {
return "Select mctr_cli mode execution";
}
@Override
/** {@inheritDoc} */
public boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration, final IProject project, final String configFilePath) {
return MctrCliMainControllerTab.initLaunchConfiguration(configuration, project, configFilePath);
}
......
......@@ -17,16 +17,19 @@ import org.eclipse.titan.executor.tabpages.maincontroller.SingleMainControllerTa
public final class LaunchShortcut extends org.eclipse.titan.executor.executors.LaunchShortcut {
@Override
/** {@inheritDoc} */
protected String getConfigurationId() {
return "org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate";
}
@Override
/** {@inheritDoc} */
protected String getDialogTitle() {
return "Select single mode execution configuration";
}
@Override
/** {@inheritDoc} */
public boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration, final IProject project, final String configFilePath) {
return SingleMainControllerTab.initLaunchConfiguration(configuration, project, configFilePath);
}
......
......@@ -16,16 +16,19 @@ import org.eclipse.titan.executor.tabpages.maincontroller.SingleMainControllerTa
* */
public final class LaunchShortcutConfig extends org.eclipse.titan.executor.executors.LaunchShortcutConfig {
@Override
/** {@inheritDoc} */
protected String getConfigurationId() {
return "org.eclipse.titan.executor.executors.single.LaunchConfigurationDelegate";
}
@Override
/** {@inheritDoc} */
protected String getDialogTitle() {
return "Select single mode execution";
}
@Override
/** {@inheritDoc} */
public boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration, final IProject project, final String configFilePath) {
return SingleMainControllerTab.initLaunchConfiguration(configuration, project, configFilePath);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment