forked from eclipse/vorto
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated function block editor with devtool. Added missing files fr…
…om previous commit Signed-off-by: shiv12095 <shiv12095@iiitd.ac.in>
- Loading branch information
Showing
9 changed files
with
156 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?xml version="1.0"?> | ||
<project | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.eclipse.vorto</groupId> | ||
<artifactId>bundles</artifactId> | ||
<version>0.4.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.eclipse.vorto.editor.web</artifactId> | ||
|
||
<name>Vorto Editor Web</name> | ||
|
||
<build> | ||
<sourceDirectory>src</sourceDirectory> | ||
<resources> | ||
<resource> | ||
<directory>src</directory> | ||
<excludes> | ||
<exclude>**/*.java</exclude> | ||
<exclude>**/*.xtend</exclude> | ||
</excludes> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.xtend</groupId> | ||
<artifactId>xtend-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>add-source</id> | ||
<phase>initialize</phase> | ||
<goals> | ||
<goal>add-source</goal> | ||
<goal>add-resource</goal> | ||
</goals> | ||
<configuration> | ||
<sources> | ||
<source>src-gen</source> | ||
</sources> | ||
<resources> | ||
<resource> | ||
<directory>src-gen</directory> | ||
<excludes> | ||
<exclude>**/*.java</exclude> | ||
</excludes> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>org.eclipse.xtext.xbase.web</artifactId> | ||
<version>${xtext.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>org.eclipse.xtext.web.servlet</artifactId> | ||
<version>${xtext.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.xtend</groupId> | ||
<artifactId>org.eclipse.xtend.lib</artifactId> | ||
<version>${xtext.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
42 changes: 42 additions & 0 deletions
42
...o.editor.web/src/org/eclipse/vorto/editor/web/resource/WebEditorResourceSetProvider.xtend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.eclipse.vorto.editor.web.resource | ||
|
||
import com.google.inject.Inject | ||
import java.util.HashSet | ||
import java.util.Set | ||
import javax.inject.Provider | ||
import javax.inject.Singleton | ||
import org.eclipse.emf.ecore.resource.ResourceSet | ||
import org.eclipse.xtext.web.server.IServiceContext | ||
import org.eclipse.xtext.web.server.model.IWebResourceSetProvider | ||
|
||
@Singleton | ||
class WebEditorResourceSetProvider implements IWebResourceSetProvider { | ||
|
||
@Inject package Provider<ResourceSet> provider | ||
|
||
override ResourceSet get(String resourceId, IServiceContext serviceContext) { | ||
return getResourceSetFromSession(serviceContext) | ||
} | ||
|
||
def ResourceSet getResourceSetFromSession(IServiceContext serviceContext) { | ||
if (serviceContext.getSession().get("set") === null) { | ||
var ResourceSet resourceSet = provider.get() | ||
serviceContext.getSession().put("set", resourceSet) | ||
println(resourceSet); | ||
return resourceSet | ||
} else { | ||
println(serviceContext.getSession().get("set")); | ||
return serviceContext.getSession().get("set") | ||
} | ||
} | ||
|
||
def Set<String> getReferencedResourcesFromSession(IServiceContext serviceContext) { | ||
if (serviceContext.getSession().get("referenceSet") === null) { | ||
var HashSet<String> referencedResourceSet = new HashSet() | ||
serviceContext.getSession().put("referenceSet", referencedResourceSet) | ||
return referencedResourceSet | ||
} else { | ||
return serviceContext.getSession().get("referenceSet") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters