Skip to content
Snippets Groups Projects
Commit 8d9678f9 authored by Maximilian Komp's avatar Maximilian Komp
Browse files

add Templating View Added Navigation Bar Add Shell Layout

parent 525738d5
No related branches found
No related tags found
No related merge requests found
Showing
with 524 additions and 281 deletions
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<element id="module-output" name="shopInShop" /> <element id="module-output" name="shopInShop" />
</element> </element>
<element id="directory" name="lib"> <element id="directory" name="lib">
<element id="library" level="project" name="Maven: org.postgresql:postgresql:42.0.0" /> <element id="library" level="project" name="Maven: org.postgresql:postgresql:42.1.1.jre7" />
<element id="library" level="project" name="Maven: com.vaadin:vaadin-server:7.7.8" /> <element id="library" level="project" name="Maven: com.vaadin:vaadin-server:7.7.8" />
<element id="library" level="project" name="Maven: com.vaadin:vaadin-sass-compiler:0.9.13" /> <element id="library" level="project" name="Maven: com.vaadin:vaadin-sass-compiler:0.9.13" />
<element id="library" level="project" name="Maven: org.w3c.css:sac:1.3" /> <element id="library" level="project" name="Maven: org.w3c.css:sac:1.3" />
......
This diff is collapsed.
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.postgresql:postgresql:42.0.0" level="project" /> <orderEntry type="library" name="Maven: org.postgresql:postgresql:42.1.1.jre7" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.0.1" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.0.1" level="project" />
<orderEntry type="library" name="Maven: com.vaadin:vaadin-server:7.7.8" level="project" /> <orderEntry type="library" name="Maven: com.vaadin:vaadin-server:7.7.8" level="project" />
<orderEntry type="library" name="Maven: com.vaadin:vaadin-sass-compiler:0.9.13" level="project" /> <orderEntry type="library" name="Maven: com.vaadin:vaadin-sass-compiler:0.9.13" level="project" />
......
...@@ -8,22 +8,13 @@ import com.vaadin.annotations.VaadinServletConfiguration; ...@@ -8,22 +8,13 @@ import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.navigator.Navigator; import com.vaadin.navigator.Navigator;
import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet; import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.UI; import com.vaadin.ui.*;
import org.s4s.gui.views.ArtikeldetailsView; import org.s4s.gui.views.*;
import org.s4s.gui.views.BenutzerkontoView;
import org.s4s.gui.views.CheckoutView;
import org.s4s.gui.views.FaqView;
import org.s4s.gui.views.ImpressumView;
import org.s4s.gui.views.KaufbestaetigungView;
import org.s4s.gui.views.LoginView;
import org.s4s.gui.views.PasswortView;
import org.s4s.gui.views.ShopView;
import org.s4s.gui.views.VerkaeuferbewertungView;
import org.s4s.gui.views.WelcomeView;
import org.s4s.gui.views.WarenkorbView;
import org.s4s.services.db.JDBCConnection; import org.s4s.services.db.JDBCConnection;
import org.s4s.services.util.Views; import org.s4s.services.util.Views;
import static javax.accessibility.AccessibleRole.FOOTER;
/** /**
* This UI is the application entry point. A UI may either represent a browser window * This UI is the application entry point. A UI may either represent a browser window
* (or tab) or some part of a html page where a Vaadin application is embedded. * (or tab) or some part of a html page where a Vaadin application is embedded.
...@@ -50,8 +41,11 @@ public class InitView extends UI { ...@@ -50,8 +41,11 @@ public class InitView extends UI {
navi.addView(Views.FAQ, FaqView.class); navi.addView(Views.FAQ, FaqView.class);
navi.addView(Views.KAUFBESTAETIGUNG, KaufbestaetigungView.class); navi.addView(Views.KAUFBESTAETIGUNG, KaufbestaetigungView.class);
navi.addView(Views.VERKAEUFERBEWERTUNG, VerkaeuferbewertungView.class); navi.addView(Views.VERKAEUFERBEWERTUNG, VerkaeuferbewertungView.class);
navi.addView(Views.CONTACT, ContactView.class);
UI.getCurrent().getNavigator().navigateTo(Views.WELCOME); UI.getCurrent().getNavigator().navigateTo(Views.WELCOME);
this.addStyleName("customShell");
this.setWidth(64f, Unit.PERCENTAGE);
} }
......
...@@ -13,11 +13,12 @@ import com.vaadin.ui.VerticalLayout; ...@@ -13,11 +13,12 @@ import com.vaadin.ui.VerticalLayout;
* *
* @author Holger * @author Holger
*/ */
public class ArtikeldetailsView extends VerticalLayout implements View{ public class ArtikeldetailsView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} }
} }
...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout; ...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout;
* *
* @author Holger * @author Holger
*/ */
public class BenutzerkontoView extends VerticalLayout implements View{ public class BenutzerkontoView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
......
...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout; ...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout;
* *
* @author Holger * @author Holger
*/ */
public class CheckoutView extends VerticalLayout implements View{ public class CheckoutView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
......
package org.s4s.gui.views;
import com.vaadin.navigator.ViewChangeListener;
/**
* Created by Max-Desktop on 16.05.2017.
*/
public class ContactView extends TemplateView{
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout; ...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout;
* *
* @author Holger * @author Holger
*/ */
public class FaqView extends VerticalLayout implements View{ public class FaqView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
......
...@@ -15,7 +15,7 @@ import com.vaadin.ui.VerticalLayout; ...@@ -15,7 +15,7 @@ import com.vaadin.ui.VerticalLayout;
* *
* @author Holger * @author Holger
*/ */
public class ImpressumView extends VerticalLayout implements View{ public class ImpressumView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
...@@ -23,8 +23,8 @@ public class ImpressumView extends VerticalLayout implements View{ ...@@ -23,8 +23,8 @@ public class ImpressumView extends VerticalLayout implements View{
} }
private void setUp(){ private void setUp(){
setSizeFull(); VerticalLayout vertLayout = new VerticalLayout();
setMargin(true); vertLayout.setSizeFull();
Label label = new Label("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, " Label label = new Label("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, "
+ "sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat," + "sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,"
+ " sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum." + " sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum."
...@@ -33,7 +33,11 @@ public class ImpressumView extends VerticalLayout implements View{ ...@@ -33,7 +33,11 @@ public class ImpressumView extends VerticalLayout implements View{
+ " tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." + " tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."
+ " At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, " + " At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, "
+ "no sea takimata sanctus est Lorem ipsum dolor sit amet."); + "no sea takimata sanctus est Lorem ipsum dolor sit amet.");
addComponent(label); vertLayout.addComponent(label);
setComponentAlignment(label,Alignment.MIDDLE_CENTER); vertLayout.setComponentAlignment(label,Alignment.MIDDLE_CENTER);
super.setUpFooterAndHeader(vertLayout);
} }
} }
...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout; ...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout;
* *
* @author Holger * @author Holger
*/ */
public class KaufbestaetigungView extends VerticalLayout implements View{ public class KaufbestaetigungView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
......
...@@ -23,7 +23,7 @@ import org.s4s.services.util.Views; ...@@ -23,7 +23,7 @@ import org.s4s.services.util.Views;
* *
* @author Holger * @author Holger
*/ */
public class LoginView extends VerticalLayout implements View { public class LoginView extends TemplateView {
private final KundenDAO kundenDAO = new LoginControl(); private final KundenDAO kundenDAO = new LoginControl();
......
...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout; ...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout;
* *
* @author Holger * @author Holger
*/ */
public class PasswortView extends VerticalLayout implements View{ public class PasswortView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
......
...@@ -28,7 +28,7 @@ import org.s4s.dao.impl.ProductSearch; ...@@ -28,7 +28,7 @@ import org.s4s.dao.impl.ProductSearch;
* *
* @author Holger * @author Holger
*/ */
public class ShopView extends VerticalLayout implements View{ public class ShopView extends TemplateView{
private final ProductDAO products = ProductSearch.getInstance(); private final ProductDAO products = ProductSearch.getInstance();
......
package org.s4s.gui.views;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.ui.*;
import org.s4s.services.util.Views;
import javax.swing.text.AbstractDocument;
/**
* Created by Max-Desktop on 14.05.2017.
*/
public class TemplateView extends VerticalLayout implements View {
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
}
public void setUpFooterAndHeader(AbstractComponent content) {
//HEADER
final GridLayout headerLayout = new GridLayout(3,1);
Label lblTitle = new Label("S4S Das Shop in Shop System");
headerLayout.addComponent(lblTitle,1,0);
headerLayout.setComponentAlignment(lblTitle, Alignment.TOP_CENTER);
headerLayout.setSpacing(true);
final HorizontalLayout navigationPanelGrid = new HorizontalLayout();
Button btnOffer = new Button("Angebote");
btnOffer.addClickListener((Button.ClickEvent event) -> {
UI.getCurrent().getNavigator().navigateTo(Views.WELCOME);
});
Button btnCategory = new Button("Kategorien");
btnOffer.addClickListener((Button.ClickEvent event) -> {
UI.getCurrent().getNavigator().navigateTo(Views.SHOP);
});
Button btnShopingCard = new Button("Warenkorb");
btnOffer.addClickListener((Button.ClickEvent event) -> {
UI.getCurrent().getNavigator().navigateTo(Views.WARENKORB);
});
Button btnCheckout = new Button("Kasse");
btnOffer.addClickListener((Button.ClickEvent event) -> {
UI.getCurrent().getNavigator().navigateTo(Views.CHECKOUT);
});
Button btnAccount = new Button("Mein Konto");
btnOffer.addClickListener((Button.ClickEvent event) -> {
UI.getCurrent().getNavigator().navigateTo(Views.LOGIN);
});
Button btnContact = new Button("Kontakt");
btnOffer.addClickListener((Button.ClickEvent event) -> {
UI.getCurrent().getNavigator().navigateTo(Views.CONTACT);
});
navigationPanelGrid.addComponent(btnOffer);
navigationPanelGrid.addComponent(btnCategory);
navigationPanelGrid.addComponent(btnShopingCard);
navigationPanelGrid.addComponent(btnCheckout);
navigationPanelGrid.addComponent(btnAccount);
navigationPanelGrid.addComponent(btnContact);
navigationPanelGrid.setSpacing(true);
//FOOTER
final VerticalLayout footerLayout = new VerticalLayout(new Label("FOOTER"));
Button btnImpressum = new Button("Impressum");
footerLayout.addComponent(btnImpressum);
btnImpressum.addClickListener((Button.ClickEvent event) -> {
UI.getCurrent().getNavigator().navigateTo(Views.IMPRESSUM);
});
// Footer Section
final VerticalLayout mainLayout = new VerticalLayout(headerLayout,navigationPanelGrid, content, footerLayout);
mainLayout.setSizeFull();
mainLayout.setExpandRatio(content, 1);
mainLayout.setSpacing(true);
mainLayout.setComponentAlignment(footerLayout, Alignment.BOTTOM_CENTER);
addComponent(mainLayout);
this.setSpacing(true);
this.setHeightUndefined();
//this.setMargin(true);
//setComponentAlignment(headerLayout, Alignment.TOP_CENTER);
//setComponentAlignment(footerLayout, Alignment.TOP_CENTER);
}
}
...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout; ...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout;
* *
* @author Holger * @author Holger
*/ */
public class VerkaeuferbewertungView extends VerticalLayout implements View{ public class VerkaeuferbewertungView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
......
...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout; ...@@ -13,7 +13,7 @@ import com.vaadin.ui.VerticalLayout;
* *
* @author Holger * @author Holger
*/ */
public class WarenkorbView extends VerticalLayout implements View{ public class WarenkorbView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
......
...@@ -7,19 +7,14 @@ package org.s4s.gui.views; ...@@ -7,19 +7,14 @@ package org.s4s.gui.views;
import com.vaadin.navigator.View; import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener; import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.ui.Alignment; import com.vaadin.ui.*;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import org.s4s.services.util.Views; import org.s4s.services.util.Views;
/** /**
* *
* @author Holger * @author Holger
*/ */
public class WelcomeView extends VerticalLayout implements View{ public class WelcomeView extends TemplateView{
@Override @Override
public void enter(ViewChangeListener.ViewChangeEvent event) { public void enter(ViewChangeListener.ViewChangeEvent event) {
...@@ -27,7 +22,18 @@ public class WelcomeView extends VerticalLayout implements View{ ...@@ -27,7 +22,18 @@ public class WelcomeView extends VerticalLayout implements View{
} }
public void setUp(){ public void setUp(){
setSizeFull();
//CONTENT goes here
final VerticalLayout contentLayout = new VerticalLayout();
for (int i = 0; i < 25; i++) {
contentLayout.addComponent(new Button("test" + i));
}
final Panel contentPanel = new Panel(contentLayout);
contentPanel.setSizeFull();
super.setUpFooterAndHeader(contentPanel);
/* setSizeFull();
setMargin(true); setMargin(true);
final HorizontalLayout horizontalLayout = new HorizontalLayout(); final HorizontalLayout horizontalLayout = new HorizontalLayout();
final HorizontalLayout buttonLayout = new HorizontalLayout(); final HorizontalLayout buttonLayout = new HorizontalLayout();
...@@ -68,7 +74,7 @@ public class WelcomeView extends VerticalLayout implements View{ ...@@ -68,7 +74,7 @@ public class WelcomeView extends VerticalLayout implements View{
addComponent(horizontalLayout); addComponent(horizontalLayout);
setComponentAlignment(horizontalLayout, Alignment.TOP_CENTER); setComponentAlignment(horizontalLayout, Alignment.TOP_CENTER);*/
} }
} }
...@@ -22,7 +22,8 @@ public final class Views { ...@@ -22,7 +22,8 @@ public final class Views {
public final static String FAQ = "faq"; public final static String FAQ = "faq";
public final static String KAUFBESTAETIGUNG = "kaufbestaetigung"; public final static String KAUFBESTAETIGUNG = "kaufbestaetigung";
public final static String VERKAEUFERBEWERTUNG = "verkaeuferbewertung"; public final static String VERKAEUFERBEWERTUNG = "verkaeuferbewertung";
public final static String CONTACT = "kontakt";
private Views(){ private Views(){
} }
......
...@@ -35,4 +35,9 @@ ...@@ -35,4 +35,9 @@
@include valo; @include valo;
// Insert your own theme rules here // Insert your own theme rules here
.customShell{
margin-left: 18%;
margin-right: 18%;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment