Skip to content

Commit 8927f86

Browse files
committed
DEMO
0 parents  commit 8927f86

File tree

8 files changed

+280
-0
lines changed

8 files changed

+280
-0
lines changed
+187
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.motasim</groupId>
6+
<artifactId>OptionGroupS-demo</artifactId>
7+
<packaging>war</packaging>
8+
<version>1.0-SNAPSHOT</version>
9+
<name>OptionGroupS Add-on Demo</name>
10+
11+
<prerequisites>
12+
<maven>3</maven>
13+
</prerequisites>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<maven.compiler.source>1.8</maven.compiler.source>
18+
<maven.compiler.target>1.8</maven.compiler.target>
19+
<vaadin.version>7.7.3</vaadin.version>
20+
<vaadin.plugin.version>7.7.3</vaadin.plugin.version>
21+
<jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>
22+
</properties>
23+
24+
<!--
25+
<organization>
26+
<name>My Name</name>
27+
<url>https://github.com/mygithubaccount/OptionGroupS/</url>
28+
</organization>
29+
30+
<scm>
31+
<url>git://github.com/mygithubaccount/OptionGroupS.git</url>
32+
<connection>scm:git:git://github.com/mygithubaccount/OptionGroupS.git</connection>
33+
<developerConnection>scm:git:ssh://[email protected]:/mygithubaccount/${componentClassName}.git</developerConnection>
34+
<tag>OptionGroupS add-on for Vaadin</tag>
35+
</scm>
36+
37+
<issueManagement>
38+
<system>GitHub</system>
39+
<url>https://github.com/mygithubaccount/OptionGroupS/issues</url>
40+
</issueManagement>
41+
-->
42+
43+
<licenses>
44+
<license>
45+
<name>Apache 2</name>
46+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
47+
<distribution>repo</distribution>
48+
</license>
49+
</licenses>
50+
51+
<repositories>
52+
<repository>
53+
<id>vaadin-addons</id>
54+
<url>http://maven.vaadin.com/vaadin-addons</url>
55+
</repository>
56+
</repositories>
57+
58+
<dependencyManagement>
59+
<dependencies>
60+
<dependency>
61+
<groupId>com.vaadin</groupId>
62+
<artifactId>vaadin-bom</artifactId>
63+
<version>${vaadin.version}</version>
64+
<type>pom</type>
65+
<scope>import</scope>
66+
</dependency>
67+
</dependencies>
68+
</dependencyManagement>
69+
70+
<dependencies>
71+
<dependency>
72+
<groupId>com.motasim</groupId>
73+
<artifactId>OptionGroupS</artifactId>
74+
<version>${project.version}</version>
75+
</dependency>
76+
<dependency>
77+
<groupId>com.vaadin</groupId>
78+
<artifactId>vaadin-push</artifactId>
79+
</dependency>
80+
<dependency>
81+
<groupId>com.vaadin</groupId>
82+
<artifactId>vaadin-client-compiler</artifactId>
83+
<scope>provided</scope>
84+
</dependency>
85+
<dependency>
86+
<groupId>com.vaadin</groupId>
87+
<artifactId>vaadin-themes</artifactId>
88+
</dependency>
89+
<dependency>
90+
<groupId>javax.servlet</groupId>
91+
<artifactId>javax.servlet-api</artifactId>
92+
<version>3.0.1</version>
93+
<scope>provided</scope>
94+
</dependency>
95+
</dependencies>
96+
97+
<build>
98+
<plugins>
99+
<plugin>
100+
<artifactId>maven-war-plugin</artifactId>
101+
<version>2.6</version>
102+
<configuration>
103+
<failOnMissingWebXml>false</failOnMissingWebXml>
104+
</configuration>
105+
</plugin>
106+
107+
<plugin>
108+
<groupId>com.vaadin</groupId>
109+
<artifactId>vaadin-maven-plugin</artifactId>
110+
<version>${vaadin.plugin.version}</version>
111+
<executions>
112+
<!-- You are free to mark this as permanently ignored in Eclipse -->
113+
<execution>
114+
<configuration>
115+
<!-- if you don't specify any modules, the plugin will find them -->
116+
</configuration>
117+
<goals>
118+
<goal>resources</goal>
119+
<goal>update-widgetset</goal>
120+
<goal>compile</goal>
121+
</goals>
122+
</execution>
123+
</executions>
124+
<configuration>
125+
<runTarget>http://localhost:8080/OptionGroupS</runTarget>
126+
</configuration>
127+
</plugin>
128+
129+
<!-- The Jetty plugin allows us to easily test the development build by -->
130+
<!-- running jetty:run on the command line. -->
131+
<plugin>
132+
<groupId>org.eclipse.jetty</groupId>
133+
<artifactId>jetty-maven-plugin</artifactId>
134+
<version>${jetty.plugin.version}</version>
135+
<configuration>
136+
<scanIntervalSeconds>2</scanIntervalSeconds>
137+
</configuration>
138+
</plugin>
139+
140+
</plugins>
141+
142+
</build>
143+
144+
<profiles>
145+
<profile>
146+
<!-- Vaadin pre-release repositories -->
147+
<id>vaadin-prerelease</id>
148+
<activation>
149+
<activeByDefault>false</activeByDefault>
150+
</activation>
151+
152+
<repositories>
153+
<repository>
154+
<id>vaadin-prereleases</id>
155+
<url>http://maven.vaadin.com/vaadin-prereleases</url>
156+
</repository>
157+
<repository>
158+
<id>vaadin-snapshots</id>
159+
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
160+
<releases>
161+
<enabled>false</enabled>
162+
</releases>
163+
<snapshots>
164+
<enabled>true</enabled>
165+
</snapshots>
166+
</repository>
167+
</repositories>
168+
<pluginRepositories>
169+
<pluginRepository>
170+
<id>vaadin-prereleases</id>
171+
<url>http://maven.vaadin.com/vaadin-prereleases</url>
172+
</pluginRepository>
173+
<pluginRepository>
174+
<id>vaadin-snapshots</id>
175+
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
176+
<releases>
177+
<enabled>false</enabled>
178+
</releases>
179+
<snapshots>
180+
<enabled>true</enabled>
181+
</snapshots>
182+
</pluginRepository>
183+
</pluginRepositories>
184+
</profile>
185+
</profiles>
186+
187+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.motasim.optiongroups.demo;
2+
3+
import com.motasim.optiongroups.OptionGroupS;
4+
5+
import javax.servlet.annotation.WebServlet;
6+
7+
import com.vaadin.annotations.Theme;
8+
import com.vaadin.annotations.Title;
9+
import com.vaadin.annotations.VaadinServletConfiguration;
10+
import com.vaadin.server.VaadinRequest;
11+
import com.vaadin.server.VaadinServlet;
12+
import com.vaadin.ui.Alignment;
13+
import com.vaadin.ui.UI;
14+
import com.vaadin.ui.VerticalLayout;
15+
import java.util.Arrays;
16+
import com.vaadin.ui.Notification;
17+
import com.vaadin.ui.Notification.Type;
18+
19+
@Theme("demo")
20+
@Title("OptionGroupS Add-on Demo")
21+
@SuppressWarnings("serial")
22+
public class DemoUI extends UI
23+
{
24+
25+
@WebServlet(value = "/*", asyncSupported = true)
26+
@VaadinServletConfiguration(productionMode = false, ui = DemoUI.class)
27+
public static class Servlet extends VaadinServlet {
28+
}
29+
30+
@Override
31+
protected void init(VaadinRequest request) {
32+
33+
// Initialize our new UI component
34+
// Initialize our new UI component
35+
final OptionGroupS component = new OptionGroupS("Please choose the features you want to activate: ", Arrays.asList("GPS", "Google Maps", "RFID", "TRY THIS", "HELLO"));
36+
37+
38+
component.addValueChangeListener(e -> Notification.show("Value changed:",
39+
String.valueOf(e.getProperty().getValue()),
40+
Type.TRAY_NOTIFICATION));
41+
42+
43+
// Show it in the middle of the screen
44+
final VerticalLayout layout = new VerticalLayout();
45+
layout.setStyleName("demoContentLayout");
46+
layout.setSizeFull();
47+
layout.addComponent(component);
48+
layout.setComponentAlignment(component, Alignment.MIDDLE_CENTER);
49+
setContent(layout);
50+
}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please add your static resources here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Class-Path:
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Context antiJARLocking="true" path="/OptionGroupS"/>
Binary file not shown.
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@import "../valo/valo.scss";
2+
3+
$gray: #d1d1cf;
4+
$green: #40b527;
5+
$darkgreen: darken($green, 30%);
6+
7+
// Prefix all selectors in your theme with .demo
8+
.demo {
9+
10+
// Include valo theme styles in your theme
11+
@include valo;
12+
13+
// You can style your demo app right here
14+
.demoContentLayout {
15+
background-color: $gray;
16+
background-image: url(images/radial-gradient.png);
17+
background-size: 90%;
18+
background-position: center center;
19+
background-repeat: no-repeat;
20+
}
21+
22+
// You can also customize your component for the demo
23+
// app, but remember that these styles are not part of
24+
// the component. To include built-in CSS for your component,
25+
// edit client/styles.css under java sources
26+
div.OptionGroupS {
27+
color: $green;
28+
font-size: 50pt;
29+
font-weight: bold;
30+
text-shadow: 0px 3px 0px $darkgreen,
31+
0px 14px 10px rgba(0,0,0,0.15),
32+
0px 24px 2px rgba(0,0,0,0.1),
33+
0px 34px 30px rgba(0,0,0,0.1);
34+
text-align: center;
35+
}
36+
}

0 commit comments

Comments
 (0)