Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlatools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tlatools
Commits
793df1b2
Commit
793df1b2
authored
Oct 27, 2017
by
Markus Alexander Kuppe
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused/dead class.
[Refactor][Toolbox]
parent
fb99862c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.lamport.tla.toolbox.tool.tlc/src/org/lamport/tla/toolbox/tool/tlc/job/TLAModelFilesCreationOperation.java
+0
-72
0 additions, 72 deletions
.../toolbox/tool/tlc/job/TLAModelFilesCreationOperation.java
with
0 additions
and
72 deletions
org.lamport.tla.toolbox.tool.tlc/src/org/lamport/tla/toolbox/tool/tlc/job/TLAModelFilesCreationOperation.java
deleted
100644 → 0
+
0
−
72
View file @
fb99862c
package
org.lamport.tla.toolbox.tool.tlc.job
;
import
java.io.ByteArrayInputStream
;
import
org.eclipse.core.resources.IFile
;
import
org.eclipse.core.resources.IProject
;
import
org.eclipse.core.resources.IWorkspaceRunnable
;
import
org.eclipse.core.runtime.CoreException
;
import
org.eclipse.core.runtime.IPath
;
import
org.eclipse.core.runtime.IProgressMonitor
;
import
org.eclipse.core.runtime.SubProgressMonitor
;
import
org.lamport.tla.toolbox.util.ResourceHelper
;
/**
* Creates the stub for modelecking, extending the specification root module
* @author Simon Zambrovski
* @version $Id$
*/
public
class
TLAModelFilesCreationOperation
implements
IWorkspaceRunnable
{
// project to create files in
private
IProject
project
;
// path to the root module, which name will be added after EXTEND keyword
// the .tla and .cfg files will be createed in the same directory
// as the rootModule
private
IPath
rootModulePath
;
/**
* Construct an operation for creation of the files for model checking
* @param project project to link files into
* @param rootModulePath root module to be extended
*/
public
TLAModelFilesCreationOperation
(
IProject
project
,
IPath
rootModulePath
)
{
this
.
rootModulePath
=
rootModulePath
;
this
.
project
=
project
;
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public
void
run
(
IProgressMonitor
monitor
)
throws
CoreException
{
monitor
.
beginTask
(
"Creating files"
,
2
);
// foo.tla
String
rootModuleFilename
=
this
.
rootModulePath
.
lastSegment
();
// foo
String
rootModuleName
=
ResourceHelper
.
getModuleName
(
rootModuleFilename
);
String
tlaModuleName
=
"MC"
;
IPath
tlaPath
=
this
.
rootModulePath
.
removeLastSegments
(
1
).
append
(
tlaModuleName
).
addFileExtension
(
"tla"
);
IPath
cfgPath
=
this
.
rootModulePath
.
removeLastSegments
(
1
).
append
(
tlaModuleName
).
addFileExtension
(
"cfg"
);
byte
[]
content
=
ResourceHelper
.
getExtendingModuleContent
(
tlaModuleName
,
rootModuleName
).
append
(
ResourceHelper
.
getModuleClosingTag
()).
toString
().
getBytes
();
try
{
IFile
tlaFile
=
project
.
getFile
(
tlaPath
);
tlaFile
.
create
(
new
ByteArrayInputStream
(
content
),
false
/* force*/
,
new
SubProgressMonitor
(
monitor
,
1
));
IFile
cfgFile
=
project
.
getFile
(
cfgPath
);
cfgFile
.
create
(
new
ByteArrayInputStream
(
""
.
getBytes
()),
false
/* force*/
,
new
SubProgressMonitor
(
monitor
,
1
));
}
finally
{
monitor
.
done
();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment