che-server/samples/sample-plugin-filetype
Roman Iuvshin b3ae33acf5 RELEASE: Set next development version 2017-05-10 10:54:42 +00:00
..
che-sample-plugin-filetype-ide RELEASE: Set next development version 2017-05-10 10:54:42 +00:00
README.md Update references to hold documentation site. (#4166) 2017-02-20 15:39:37 +01:00
pom.xml RELEASE: Set next development version 2017-05-10 10:54:42 +00:00

README.md

Description

This sample extension illustrate how to extend the Eclipse Che code editor by defining a custom file type and associating it with the specific editor to be opened.

Read the tutorial at: https://www.eclipse.org/che/docs/plugins/code-editors/index.html#file-types

How to test che-sample-filetype plugin

The plugin-filetype extension is only a client-side (IDE) extension. You have to introduce your extension as a dependency in /che/assembly/assembly-ide-war/pom.xml.

Add:

<dependency>
  <groupId>org.eclipse.che.sample</groupId>
  <artifactId>che-sample-plugin-filetype-ide</artifactId>
</dependency>

You can insert the dependency anywhere in the list. After you have inserted it, run mvn sortpom:sort and maven will order the pom.xml for you.

2- Register dependency to the GWT application

Link the GUI extension into the GWT app. You will add an <inherits> tag to the module definition. The name of the GWT extension is derived from the direction + package structure given to the GWT module defined in our extension.

In: assembly-ide-war/src/main/resources/org/eclipse/che/ide/IDE.gwt.xml

Add:

<inherits name='org.eclipse.che.plugin.filetype.MyFileType'/>

3- Rebuild Eclipse Che

# Build a new IDE.war
# This IDE web app will be bundled into the assembly
cd che/assembly/assembly-ide-war
mvn clean install

# Create a new Che assembly that includes all new server- and client-side extensions
cd assembly/assembly-main
mvn clean install

4- Run Eclipse Che

# Start Che using the CLI with your new assembly
# Replace <local-repo> with the path to your Che repository, to use local binaries in your local image
# Replace <version> with the actual version you are working on
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock \
                    -v <local-path>:/data \
                    -v <local-repo>:/repo \
                       eclipse/che:<version> start --debug

Documentation resources