- Wählen Sie im Menü File > New > RapidClipse Project.
Geben Sie bei Project name den im folgenden Projekt-Assistenten bei Name den Namen Ihres Projektes ein.
Optionen:
...
, z.B. Example.
Klicken Sie auf Finish.
Hinweis:
Beim Anlegen eines neuen RapidClipse Projektes werden einmalig alle für ein RapidClipse Projekt benötigten Bibliotheken mit deren Abhängigkeiten automatisch vom Maven Central Repository herunter geladen. Dazu müssen Sie online sein. Der Download kann je nach Internet-Verbindung einige Minuten dauern. Anschließend können Sie mit RapidClipse auch offline arbeiten.
Optionen:
- Template
- Beim Erstellen eines Projektes werden gestylte Beispiel-Views mit einer schon vorhandenen Navigation mit generiert.
Ergebnis:
Der Assistent lädt automatisch alle für ein RapidClipse Projekt benötigten Libraries mit dazugehörigen Dependencies via Maven
...
und
...
legt ein RapidClipse
...
Expand title persistence.xml Code Block language sass theme Emacs linenumbers true <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="example"><provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <properties> <property name="hibernate.archive.autodetection" value="class, hbm" /> <property name="hibernate.show_sql" value="false" /> <property name="hibernate.hbm2ddl.auto" value="validate" /> <property name="hibernate.transaction.auto_close_session" value="false" /> </properties> </persistence-unit> </persistence>
Expand title pom.xml Code Block language sass theme Emacs linenumbers true <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.company</groupId> <artifactId>example</artifactId> <version>0.1.0-SNAPSHOT</version> <packaging>war</packaging> <build> <sourceDirectory>src</sourceDirectory> <resources> <resource> <directory>src</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <warSourceDirectory>WebContent</warSourceDirectory> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <repositories> <repository> <id>ossrh-releases</id> <url> https://oss.sonatype.org/content/repositories/releases </url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>vaadin-addons</id> <url>http://maven.vaadin.com/vaadin-addons</url> </repository> </repositories> <dependencies> <dependency> <groupId>com.xdev-software</groupId> <artifactId>xdev-server-core</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>com.xdev-software</groupId> <artifactId>xdev-server-ui</artifactId> <version>1.0.0</version> </dependency> </dependencies> <name>Example</name> </project>
Expand title web.xml Code Block language sass theme Emacs linenumbers true <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> <display-name>Example</display-name> <context-param> <param-name>persistenceUnit</param-name> <param-value>example</param-value> </context-param> <listener> <listener-class>com.xdev.communication.XdevHttpSessionListener</listener-class> </listener> </web-app>
Expand title MainUI.Projekt mit einen leerer MainLayout an.
MainLayout.java
Code Block Eclipselanguage java theme Confluence linenumbers true package com.company.
exampledemoproj.ui; import com.vaadin.flow.component.
annotationsorderedlayout.
PushVerticalLayout; import com.vaadin.
annotationsflow.router.
ThemeRoute; import com.vaadin.flow.server.
VaadinRequestInitialPageSettings; import com.vaadin.
xdevflow.
uiserver.
XdevUIPageConfigurator;
import@Route("
Example") public class
MainUIMainLayout extends
XdevUIVerticalLayout implements PageConfigurator {
public MainUI() { super(); } /** * {@inheritDoc} */ @Override public void init(VaadinRequest request) {public MainLayout() { super(); this.initUI();
}
/*@Override
Dopublic
contentvoid
ofconfigurePage(final
thisInitialPageSettings
methodsettings)
is{
Expand title MainView.java Code Block package com.company.example.ui; import com.xdev.ui.XdevGridLayout; import com.xdev.ui.XdevView; public class MainView extends XdevView { /** * */ public MainView() { super(); this.initUI(); } /*language java theme Eclipse linenumbers true settings.addLink("shortcut icon", "frontend/images/favicon.ico"); settings.addFavIcon("icon", "frontend/images/favicon256.png", "256x256"); } /* WARNING: Do NOT edit!<br>The content of this method is always regenerated
*by the UI designer.
*/
// <generated-code name="initUI">
private void initUI() {
this.gridLayout = new XdevGridLayout(); this.gridLayout.this.setSizeFull();
this.setContent(this.gridLayout); this.setSizeFull(); } // </generated-code> // <generated-code name="variables"> private XdevGridLayout gridLayout; //} // </generated-code> }
Expand title Servlet.javaAppServlet.java - Startet die Anwendung (Servlet) im Servlet-Container.
Code Block Eclipselanguage java theme Confluence package com.company.
example.uidemoproj; import javax.servlet.annotation.WebServlet; import com.rapidclipse.
vaadinframework.
annotationsserver.
VaadinServletConfigurationRapServlet;
import@WebServlet(
valueurlPattern = "/*", asyncSupported = true
) @VaadinServletConfiguration(productionMode = false, ui = MainUI.class) public class
ServletAppServlet extends
XdevServletRapServlet { public
ServletAppServlet() { super(); } }
...