use of org.eclipse.titan.designer.core.TITANJob in project titan.EclipsePlug-ins by eclipse.
the class ConvertXSD2TTCN method doConversion.
/**
* Do the actual work of converting the selected files to TTCN-3
*/
private void doConversion() {
if (!TITANInstallationValidator.check(true)) {
return;
}
if (!LicenseValidator.check()) {
return;
}
processSelection();
if (files == null || files.isEmpty()) {
ErrorReporter.parallelErrorDisplayInMessageDialog(JOB_TITLE + FAILURE_SUFFIX, NO_VALID_FILES);
return;
}
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
final DirectoryDialog dialog = new DirectoryDialog(new Shell(Display.getDefault()), SWT.SAVE | SWT.PRIMARY_MODAL | SWT.FOCUSED | SWT.ON_TOP);
dialog.setFilterPath(project.getLocation().toOSString());
String outFolder = dialog.open();
if (outFolder != null) {
outFolder = outFolder.trim();
if (outFolder.length() > 0) {
setOutputFolder(new File(outFolder));
}
}
}
});
if (outputFolder == null) {
return;
}
final TITANJob titanJob = new TITANJob(JOB_TITLE, files, outputFolder, project);
titanJob.setPriority(Job.DECORATE);
titanJob.setUser(true);
titanJob.setRule(project);
final boolean reportDebugInformation = Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null);
final List<String> command = new ArrayList<String>();
final IPreferencesService prefs = Platform.getPreferencesService();
final String pathOfTITAN = prefs.getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.TITAN_INSTALLATION_PATH, "", null);
command.add(PathConverter.convert(new Path(pathOfTITAN + File.separatorChar + "bin" + File.separatorChar + "xsd2ttcn").toOSString(), reportDebugInformation, TITANDebugConsole.getConsole()));
for (String filePath : files.keySet()) {
command.add('\'' + filePath + '\'');
}
titanJob.addCommand(command, JOB_TITLE);
titanJob.removeCompilerMarkers();
final String markersAfterCompiler = Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.ONTHEFLYMARKERSAFTERCOMPILER, PreferenceConstantValues.ONTHEFLYOPTIONREMOVE, null);
if (PreferenceConstantValues.ONTHEFLYOPTIONREMOVE.equals(markersAfterCompiler)) {
titanJob.removeOnTheFlyMarkers();
}
titanJob.schedule();
}
use of org.eclipse.titan.designer.core.TITANJob in project titan.EclipsePlug-ins by eclipse.
the class GenerateTestPortSkeleton method doGenerateSkeleton.
/**
* Do generate the skeletons
*/
private void doGenerateSkeleton() {
if (!TITANInstallationValidator.check(true)) {
return;
}
if (!LicenseValidator.check()) {
return;
}
processSelection();
if (files.isEmpty()) {
ErrorReporter.parallelErrorDisplayInMessageDialog(JOB_TITLE + FAILURE_SUFFIX, NO_VALID_FILES);
return;
}
reportOnTheFlyOutdating();
final TITANJob titanJob = new TITANJob(JOB_TITLE, files, workingDir, project);
titanJob.setPriority(Job.DECORATE);
titanJob.setUser(true);
titanJob.setRule(project);
final boolean reportDebugInformation = Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null);
final List<String> command = new ArrayList<String>();
command.add(PathConverter.convert(getCompilerPath().toOSString(), reportDebugInformation, TITANDebugConsole.getConsole()));
command.add('-' + GENERATE_TESTPORT_FLAG + getTITANActionFlags());
for (String filePath : files.keySet()) {
command.add('\'' + filePath + '\'');
}
titanJob.addCommand(command, JOB_TITLE);
titanJob.removeCompilerMarkers();
final String markersAfterCompiler = Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.ONTHEFLYMARKERSAFTERCOMPILER, PreferenceConstantValues.ONTHEFLYOPTIONREMOVE, null);
if (PreferenceConstantValues.ONTHEFLYOPTIONREMOVE.equals(markersAfterCompiler)) {
titanJob.removeOnTheFlyMarkers();
}
titanJob.schedule();
}
use of org.eclipse.titan.designer.core.TITANJob in project titan.EclipsePlug-ins by eclipse.
the class MakeArchive method doMakeArchive.
/**
* This method creates the needed {@link TITANJob} and schedules it.
* <p>
* The actual work:
* <ul>
* <li>creates the command that invokes "make archive"
* <li>creates a TITANJob for invoking the command and redirecting the results
* <li>schedules the job.
* </ul>
*/
private void doMakeArchive() {
processSelection();
if (singleSelectedProject == null) {
TITANConsole.println("Make archive works only for single selected project");
return;
}
final File binDir = new File(singleSelectedProject.getLocation().toFile(), BIN_SUBPATH);
final TITANJob titanJob = new TITANJob(JOB_TITLE, new HashMap<String, IFile>(), binDir, project);
titanJob.setPriority(Job.DECORATE);
titanJob.setUser(true);
titanJob.setRule(project);
final List<String> command = new ArrayList<String>();
command.add(COMMAND);
titanJob.addCommand(command, JOB_TITLE);
titanJob.schedule();
}
use of org.eclipse.titan.designer.core.TITANJob in project titan.EclipsePlug-ins by eclipse.
the class CheckSemantic method doCheckSemantics.
/**
* do the actual work of checking the syntax of the selected resources.
*/
private void doCheckSemantics() {
if (!TITANInstallationValidator.check(true)) {
return;
}
if (!LicenseValidator.check()) {
return;
}
processSelection();
if (files == null || files.isEmpty()) {
ErrorReporter.parallelErrorDisplayInMessageDialog(JOB_TITLE + FAILURE_SUFFIX, NO_VALID_FILES);
return;
}
reportOnTheFlyOutdating();
final TITANJob titanJob = new TITANJob(JOB_TITLE, files, workingDir, project);
titanJob.setPriority(Job.DECORATE);
titanJob.setUser(true);
titanJob.setRule(project);
final boolean reportDebugInformation = Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null);
final List<String> command = new ArrayList<String>();
command.add(PathConverter.convert(getCompilerPath().toOSString(), reportDebugInformation, TITANDebugConsole.getConsole()));
// If a single project is selected used than use it's attributes used to generate the Makefile, otherwise use the general preferences.
if (singleSelectedProject == null) {
TITANConsole.println("Using the general preferences to do the external semantic check");
command.add('-' + SEMANTIC_CHECK_FLAG + getTITANActionFlags());
} else {
TITANConsole.println("Using the project properties to do the external semantic check");
boolean useRuntime2 = false;
try {
if ("true".equals(project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, MakefileCreationData.FUNCTIONTESTRUNTIME_PROPERTY)))) {
useRuntime2 = true;
}
} catch (CoreException e) {
ErrorReporter.logExceptionStackTrace("Error while reading persistent property", e);
}
final String flags = TITANFlagsOptionsData.getTITANFlags(singleSelectedProject, useRuntime2);
command.add('-' + SEMANTIC_CHECK_FLAG + " " + flags);
}
for (String filePath : files.keySet()) {
command.add('\'' + filePath + '\'');
}
titanJob.addCommand(command, JOB_TITLE);
titanJob.removeCompilerMarkers();
final String markersAfterCompiler = Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.ONTHEFLYMARKERSAFTERCOMPILER, PreferenceConstantValues.ONTHEFLYOPTIONREMOVE, null);
if (PreferenceConstantValues.ONTHEFLYOPTIONREMOVE.equals(markersAfterCompiler)) {
titanJob.removeOnTheFlyMarkers();
}
titanJob.schedule();
}
use of org.eclipse.titan.designer.core.TITANJob in project titan.EclipsePlug-ins by eclipse.
the class CheckSyntax method doCheckSyntax.
/**
* do the actual work of checking the syntax of the selected resources.
*/
private void doCheckSyntax() {
if (!TITANInstallationValidator.check(true)) {
return;
}
if (!LicenseValidator.check()) {
return;
}
processSelection();
if (files == null || files.isEmpty()) {
ErrorReporter.parallelErrorDisplayInMessageDialog(JOB_TITLE + FAILURE_SUFFIX, NO_VALID_FILES);
return;
}
reportOnTheFlyOutdating();
final TITANJob titanJob = new TITANJob(JOB_TITLE, files, workingDir, project);
titanJob.setPriority(Job.DECORATE);
titanJob.setUser(true);
titanJob.setRule(project);
final boolean reportDebugInformation = Platform.getPreferencesService().getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null);
final List<String> command = new ArrayList<String>();
command.add(PathConverter.convert(getCompilerPath().toOSString(), reportDebugInformation, TITANDebugConsole.getConsole()));
command.add('-' + SYNTAX_CHECK_FLAG + getTITANActionFlags());
for (String filePath : files.keySet()) {
command.add('\'' + filePath + '\'');
}
titanJob.addCommand(command, JOB_TITLE);
titanJob.removeCompilerMarkers();
final String markersAfterCompiler = Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.ONTHEFLYMARKERSAFTERCOMPILER, PreferenceConstantValues.ONTHEFLYOPTIONREMOVE, null);
if (PreferenceConstantValues.ONTHEFLYOPTIONREMOVE.equals(markersAfterCompiler)) {
titanJob.removeOnTheFlyMarkers();
}
titanJob.schedule();
}
Aggregations