Package com.vaadin.terminal

Examples of com.vaadin.terminal.ThemeResource


    __app = application;
   
    // panel.setWidth("635px");
    // panel.setHeight("620px");
    panel.setSizeUndefined();
    panel.setIcon(new ThemeResource("icons/actions/misc.png"));
    panel.setCaption("Sélectionnez un aéroport");

    table = new Table("Définition des Actions");
    table.setVisible(false);
    _server = new DQSPServerI();
    hlayout.setVisible(false);

    edit = new Button("Editer");
    edit.setIcon(new ThemeResource("icons/actions/edit.png"));
    save = new Button("Enregistrer");
    save.setIcon(new ThemeResource("icons/actions/filesave.png"));

    airports = new ComboBox();
    airports.setNullSelectionAllowed(false);
    airports.setIcon(new ThemeResource("icons/actions/identity.png"));
    for (String s : _server.listOfAirports()) {
      airports.addItem(s);
    }

    airports.setInputPrompt("Aéroport Concerné");
    airports.setImmediate(true);
    airports.addListener(new Property.ValueChangeListener() {

      @Override
      public void valueChange(ValueChangeEvent event) {
       
        if (getActionsContainer(String.valueOf(airports.getValue())).size() != 0 ){
          panel.setCaption("");
          table.setContainerDataSource(getActionsContainer(String.valueOf(airports.getValue())));
          table.setFooterVisible(true);
          table.setPageLength(0);
          table.setColumnFooter("service", "Total");
          table.setColumnFooter("observations", String.valueOf(getActionsContainer(String.valueOf(airports.getValue())).size()));
          table.setVisible(true);
          hlayout.setVisible(true);
        }
        else{
          table.setVisible(false);
          hlayout.setVisible(false);
          __app.getMainWindow().showNotification("Notification", "pas de réclamations pour cet aéroport", Window.Notification.TYPE_TRAY_NOTIFICATION);
        }
      }
    });
   

    addComponent(airports);
    setComponentAlignment(airports, "right");

    table.setWidth("100%");
    table.setSelectable(true);
    table.setColumnReorderingAllowed(true);
    table.setColumnCollapsingAllowed(true);
    //table.setVisibleColumns(table.getColumnHeaders());

    table.setColumnIcon("service", new ThemeResource("icons/actions/power.png"));
    table.setColumnIcon("theme", new ThemeResource("icons/actions/misc.png"));
    table.setColumnIcon("observations", new ThemeResource("icons/actions/messagebox_warning.png"));
    table.setColumnIcon("action", new ThemeResource("icons/actions/redo.png"));
   

    setMargin(true);
    setSpacing(true);
View Full Code Here


   
    custom.addComponent(mainmenu, "mainmenu");
    custom.addComponent(centrale, "centrale");
    addComponent(custom);
   
    centrale.setIcon(new ThemeResource("icons/actions/wizard.png"));
    centrale.setWidth("635px");
    //centrale.setHeight("620px");
    //centrale.setSizeUndefined();
    centrale.setVisible(false);
   
    //adding items the Main Menu
    MenuBar.MenuItem email = mainmenu.addItem("Email", null);
    email.setIcon(new ThemeResource("icons/actions/message.png"));
    email.addItem("Nouveau Email", new ThemeResource("icons/actions/mail_new.png"), mailCommand);
    email.addSeparator();
    email.addItem("Consulter", new ThemeResource("icons/actions/mail_get.png"), null);
    email.addSeparator();
    email.addItem("Liste des contacts", new ThemeResource("icons/actions/mail_replyall.png"), getMailingList);
   
   
    MenuBar.MenuItem analyse = mainmenu.addItem("Actions Entreprise", null);
    analyse.setIcon(new ThemeResource("icons/actions/wizard.png"));
    analyse.addItem("Tableau des actions", new ThemeResource("icons/actions/misc.png"), getAnalyse);
   
    MenuBar.MenuItem dConsole = mainmenu.addItem("Konsole", decisiaKonsole);
    dConsole.setIcon(new ThemeResource("icons/actions/openterm.png"));
   
    MenuBar.MenuItem print = mainmenu.addItem("Imprimer", null);
    print.setIcon(new ThemeResource("icons/actions/fileprint.png"));
   
    MenuBar.MenuItem help = mainmenu.addItem("Help", null);
    help.setIcon(new ThemeResource("icons/actions/help.png"));
   
    MenuBar.MenuItem logout = mainmenu.addItem("Logout", _logout);
    logout.setIcon(new ThemeResource("icons/actions/exit.png"));
   
    setMargin(true);
   
  }
View Full Code Here

  {
    __app = application;
   
    panel.setSizeUndefined();
    panel.setCaption("Email");
    panel.setIcon(new ThemeResource("icons/actions/message.png"));
    setSpacing(false);
   
    hlayout.setSpacing(true);
    hlayout.setMargin(true);
   
    _hlayout.setSpacing(true);

   
    TextField smtp = new TextField("SMTP");
    smtp.setRequired(true);
    smtp.setInputPrompt("msg.onda.ma");
    hlayout.addComponent(smtp);
   
    TextField port = new TextField("Port");
    port.setRequired(true);
    port.setInputPrompt("xxx");
    hlayout.addComponent(port);
   
    addComponent(hlayout);
   
    TextField user = new TextField("Utilisateur");
    user.setRequired(true);
    user.setInputPrompt("admin");
    __hlayout.addComponent(user);
    vlayout.addComponent(__hlayout);
    addComponent(vlayout);
   
    TextField email = new TextField("Email");
    email.setRequired(true);
    email.setInputPrompt("admin@onda.ma");
    _hlayout.addComponent(email);
   
    TextField password = new TextField("Password");
    password.setRequired(true);
    password.setSecret(true);
    _hlayout.addComponent(password);
   
    vlayout.addComponent(_hlayout);
   
    vlayout.setMargin(true);
    addComponent(vlayout);
   
    TextField to = new TextField("To");
    to.setRequired(true);
    ___hlayout.addComponent(to);
    _vlayout.addComponent(___hlayout);
   
    TextField subject = new TextField("Subject");
    subject.setWidth("15em");
    ____hlayout.addComponent(subject);
    _vlayout.addComponent(____hlayout);
   
    _vlayout.setMargin(true);
   
    RichTextArea body = new RichTextArea("Message");
    body.setWidth("530px");
    body.setWordwrap(true);
    _vlayout.addComponent(body);
   
    addComponent(_vlayout);
   
    Button send = new Button("Envoyer", this, "sendButtonClick");
    send.setIcon(new ThemeResource("icons/actions/mail_send.png"));
    custom.addComponent(send, "send");
    addComponent(custom);
    setComponentAlignment(custom, Alignment.MIDDLE_CENTER);
    setMargin(true);
  }
View Full Code Here

    __app = application;
    //panel.setWidth("635px");
    //panel.setHeight("620px");
    panel.setSizeUndefined();
    panel.setCaption("Sélectionnez un aéroport");
    panel.setIcon(new ThemeResource("icons/actions/toggle_log.png"));
   
    formatter = new SimpleDateFormat("d/MM/yyyy");
    table = new Table("Tableau d'analyse - " + formatter.format(new java.util.Date()));
    table.setVisible(false);
    edit = new Button("Editer");
    save = new Button("Enregistrer");
    hlayout = new HorizontalLayout();
    hlayout.setVisible(false);
    am = new AnalyseModel();
    _server = new DQSPServerI();
   
    airports = new ComboBox();
    airports.setNullSelectionAllowed(false);
    airports.setIcon(new ThemeResource("icons/actions/identity.png"));
    for (String s : _server.listOfAirports()){
      airports.addItem(s);
    }
   
    airports.setInputPrompt("Aéroport Concerné");
    airports.setImmediate(true);
    addComponent(airports);
    setComponentAlignment(airports, "right");
   
    airports.addListener(new Property.ValueChangeListener() {
     
      @Override
      public void valueChange(ValueChangeEvent event) {
       
        //filling out the container
        IndexedContainer container = new IndexedContainer();
        container.addContainerProperty("Service", String.class, null);
        container.addContainerProperty("Thème", String.class, null);
        container.addContainerProperty("Nombre de Réclamations", Integer.class, null);
        container.addContainerProperty("Observations", String.class, null);
       
        if (am.buildAnalyseTable(String.valueOf(airports.getValue())).size() != 0)
        {
          panel.setCaption("Tableau d'analyse");
          for (AnalyseTable at : am.buildAnalyseTable(String.valueOf(airports.getValue())))
          {
            Item item = container.addItem(at);
            item.getItemProperty("Service").setValue(at.getService());
            item.getItemProperty("Thème").setValue(at.getTheme());
            item.getItemProperty("Nombre de Réclamations").setValue(at.getNbreRecla());
            item.getItemProperty("Observations").setValue(at.getDescriptif());
          }
          table.setContainerDataSource(container);
          table.setPageLength(0);
          table.setFooterVisible(true);
          table.setVisible(true);
        } else {
          panel.setCaption("Sélectionnez un aéroport");
          table.setVisible(false);
          __app.getMainWindow().showNotification("Notification", "Pas de réclamations pour cet aéroport", Window.Notification.TYPE_TRAY_NOTIFICATION);
        }
        //hlayout.setVisible(true);
      }
    });
   
    table.setWidth("100%");
    table.setSelectable(true);
    table.setColumnReorderingAllowed(true);
    table.setColumnCollapsingAllowed(true);
   
    setMargin(true);
    setSpacing(true);
    table.setWriteThrough(false);
   
    table.setColumnIcon("Service", new ThemeResource("icons/actions/power.png"));
    table.setColumnIcon("Thème", new ThemeResource("icons/actions/misc.png"));
    table.setColumnIcon("Nombre de Réclamations", new ThemeResource("icons/actions/signature.png"));
    table.setColumnIcon("Observations", new ThemeResource("icons/actions/messagebox_warning.png"));
   
   
    addComponent(table);
   
    hlayout.setMargin(true);
View Full Code Here

    __app = application;

    panel.setSizeUndefined();
    panel.setCaption("Tableau de Bord");
    panel.setIcon(new ThemeResource("icons/actions/connect_established.png"));

    menu = new TouchMenu();
    menu.setImmediate(true);
    menu.setColumns(2);

    // Evolutions per theme
    menu.addButton("Evolutions", new TouchMenu.Command() {
      @Override
      public void menuSelected(TouchMenuButton selectedButton) {

        evolutions = new Window("Evolutions");
        evolutions.center();
        evolutions.setWidth("400px");
        evolutions.setHeight("200px");
        // evolutions.setSizeFull();
        evolutions.setImmediate(true);

        eairports = new ComboBox("Aéroport");
        eairports.setInputPrompt("Sélectionnez un aéroport");
        eairports.setIcon(new ThemeResource(
            "icons/actions/identity.png"));
        eairports.setImmediate(true);
        eairports.setNullSelectionAllowed(false);

        themes = new ComboBox("Thème");
        themes.setInputPrompt("Sélectionnez un thème");
        themes.setVisible(false);
        themes.setIcon(new ThemeResource(
            "icons/actions/connect_creating.png"));
        themes.setImmediate(true);
        themes.setNullSelectionAllowed(false);

        options = new ComboBox("Type d'évolution");
        options.setIcon(new ThemeResource("icons/actions/history.png"));
        options.addItem("Mensuelle");
        options.addItem("Annuelle");
        options.setInputPrompt("Choisissez un type");
        options.setImmediate(true);
        options.setNullSelectionAllowed(false);
        options.setVisible(false);

        esave = new Button();
        esave.setIcon(new ThemeResource("icons/actions/filesave.png"));
        esave.setVisible(false);

        vlayout.setSpacing(true);
        vlayout.setMargin(true);
        vlayout.setImmediate(true);
        _vpanel.addComponent(vlayout);
        _vpanel.setVisible(false);

        // to ensure the repaint of the horizontal layout
        hlayout.removeAllComponents();

        hlayout.setSpacing(true);
        hlayout.setSpacing(true);
        hlayout.addComponent(eairports);
        hlayout.setComponentAlignment(eairports, Alignment.BOTTOM_LEFT);
        hlayout.addComponent(themes);
        hlayout.addComponent(options);
        hlayout.setComponentAlignment(options, Alignment.BOTTOM_RIGHT);
        hlayout.addComponent(esave);
        hlayout.setComponentAlignment(esave, Alignment.BOTTOM_RIGHT);

        evolutions.addComponent(hlayout);
        evolutions.addComponent(_vpanel);

        // filling the airports
        __server = new DQSPServerI();
        for (String s : __server.listOfAirports()) {
          eairports.addItem(s);
        }

        // listener for airports
        eairports.addListener(new Property.ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            // checking if there are any claims for the selected
            // airport, so the existence of themes
            if (__server.listOfThemes(
                String.valueOf(eairports.getValue())).size() != 0) {

              // filling themes
              for (String s : __server.listOfThemes(String
                  .valueOf(eairports.getValue()))) {
                themes.addItem(s);
              }

              themes.setVisible(true);
              evolutions.setWidth("690px");
              evolutions.setHeight("200px");
              themes.addListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(ValueChangeEvent event) {
                  options.setVisible(true);
                  vlayout.removeAllComponents();

                  // Default behavior
                  // creating and wrapping the chart
                  evoWrap = new JFreeChartWrapper(
                      createChart(
                          createMonthlyDataset(
                              String.valueOf(eairports
                                  .getValue()),
                              String.valueOf(themes
                                  .getValue())),
                          String.valueOf(themes
                              .getValue()),
                          "Nombre de Réclamations",
                          "MMM-yyyy"));
                  vlayout.addComponent(evoWrap);
                  vlayout.setComponentAlignment(evoWrap,
                      Alignment.MIDDLE_CENTER);
                  _vpanel.setVisible(true);
                  esave.setVisible(true);
                  evolutions.setSizeFull();
                  evolutions.center();
                  options.setValue("Mensuelle");
                  // listener for the save button
                  esave.addListener(new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                      if (String.valueOf(
                          options.getValue()).equals(
                          "Mensuelle")) {
                        // saving a monthly chart
                        try {
                          ChartUtilities
                              .saveChartAsJPEG(
                                  new File(
                                      "/home/matrix/Desktop/graphs/m_evoGraph.jpg"),
                                  createChart(
                                      createMonthlyDataset(
                                          String.valueOf(eairports
                                              .getValue()),
                                          String.valueOf(themes
                                              .getValue())),
                                      themes.getValue()
                                          .toString(),
                                      "Nombre de Réclamations",
                                      "MMM-yyyy"),
                                  500, 300);

                        } catch (IOException e) {
                          e.printStackTrace();
                        }
                        __app.getMainWindow()
                            .showNotification(
                                "Notification",
                                "Graphe Enregistré",
                                Window.Notification.TYPE_TRAY_NOTIFICATION);
                      }
                    }
                  });

                  // decide which type of evolution you want
                  options.addListener(new Property.ValueChangeListener() {
                    @Override
                    public void valueChange(
                        ValueChangeEvent event) {
                      if (String.valueOf(
                          options.getValue()).equals(
                          "Mensuelle")) {

                        vlayout.removeAllComponents();
                        // creating and wrapping the
                        // chart
                        evoWrap = new JFreeChartWrapper(
                            createChart(
                                createMonthlyDataset(
                                    String.valueOf(eairports
                                        .getValue()),
                                    String.valueOf(themes
                                        .getValue())),
                                themes.getValue()
                                    .toString(),
                                "Nombre de Réclamations",
                                "MMM-yyyy"));
                        vlayout.addComponent(evoWrap);
                        vlayout.setComponentAlignment(
                            evoWrap,
                            Alignment.MIDDLE_CENTER);
                        _vpanel.setVisible(true);
                        esave.setVisible(true);
                        evolutions.setSizeFull();
                        evolutions.center();
                      } else if (String.valueOf(
                          options.getValue()).equals(
                          "Annuelle")) {
                        vlayout.removeAllComponents();
                        // creating and wrapping the
                        // chart
                        evoWrap = new JFreeChartWrapper(
                            createChart(
                                createAnnualDataset(
                                    String.valueOf(eairports
                                        .getValue()),
                                    String.valueOf(themes
                                        .getValue())),
                                themes.getValue()
                                    .toString(),
                                "Nombre de Réclamations",
                                "yyyy"));
                        vlayout.addComponent(evoWrap);
                        vlayout.setComponentAlignment(
                            evoWrap,
                            Alignment.MIDDLE_CENTER);
                        _vpanel.setVisible(true);
                        esave.setVisible(true);
                        evolutions.setSizeFull();
                        evolutions.center();
                        // setting a listener for the
                        // save button for annual_data
                        esave.addListener(new Button.ClickListener() {
                          @Override
                          public void buttonClick(
                              ClickEvent event) {
                            // saving an annual
                            // chart
                            try {
                              ChartUtilities
                                  .saveChartAsJPEG(
                                      new File(
                                          "/home/matrix/Desktop/graphs/a_evoGraph.jpg"),
                                      createChart(
                                          createMonthlyDataset(
                                              String.valueOf(eairports
                                                  .getValue()),
                                              String.valueOf(themes
                                                  .getValue())),
                                          themes.getValue()
                                              .toString(),
                                          "Nombre de Réclamations",
                                          "yyyy"),
                                      500,
                                      300);

                            } catch (IOException e) {
                              e.printStackTrace();
                            }
                            __app.getMainWindow()
                                .showNotification(
                                    "Notification",
                                    "Graphe Enregistré",
                                    Window.Notification.TYPE_TRAY_NOTIFICATION);
                          }
                        });
                      }
                    }
                  });
                }
              });

            } else {
              esave.setVisible(false);
              themes.setVisible(false);
              options.setVisible(false);
              _vpanel.setVisible(false);
              evolutions.setWidth("400px");
              evolutions.setHeight("200px");
              evolutions.center();
              __app.getMainWindow().showNotification(
                  "Notification",
                  "Pas de données pour cet aéroport",
                  Window.Notification.TYPE_TRAY_NOTIFICATION);
            }

          }
        });
        __app.getMainWindow().addWindow(evolutions);
      }
    });

    // Recurrences
    menu.addButton("Récurrences", new TouchMenu.Command() {
      @Override
      public void menuSelected(TouchMenuButton selectedButton) {
        rec = new Window("Récurrences");
        rec.center();
        rec.setWidth("400px");
        rec.setHeight("200px");
        rec.setImmediate(true);

        airports = new ComboBox("Aéroport");
        airports.setInputPrompt("Sélectionnez un aéroport");
        airports.setIcon(new ThemeResource("icons/actions/identity.png"));
        airports.setImmediate(true);
        airports.setNullSelectionAllowed(false);

        save = new Button();
        save.setIcon(new ThemeResource("icons/actions/filesave.png"));
        save.setVisible(false);

        _vlayout.setSpacing(true);
        _vlayout.setMargin(true);
        _vlayout.setImmediate(true);
        vpanel.addComponent(_vlayout);
        vpanel.setVisible(false);

        glayout = new GridLayout(2, 2);
        glayout.setSpacing(true);
        glayout.setSpacing(true);
        glayout.addComponent(airports, 0, 0);
        glayout.setComponentAlignment(airports, Alignment.BOTTOM_LEFT);
        glayout.addComponent(save, 1, 0);
        glayout.setComponentAlignment(save, Alignment.BOTTOM_RIGHT);

        rec.addComponent(glayout);
        rec.addComponent(vpanel);

        // filling the airports
        _server = new DQSPServerI();
        for (String s : _server.listOfAirports()) {
          airports.addItem(s);
        }
        // listener for airports
        airports.addListener(new Property.ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            if (_server.listOfThemes(
                String.valueOf(airports.getValue())).size() != 0) {
              rec.center();
              // rec.setWidth("780px");
              // rec.setHeight("700px");
              rec.setSizeFull();

              dataSet = new DefaultCategoryDataset();
              dataSet.clear();

              _vlayout.removeAllComponents();

              for (String s : _server.listOfThemes(String
                  .valueOf(airports.getValue()))) {
                int val = _server.numberOfAppearancesPerMonth(
                    s, String.valueOf(airports.getValue())) * 100 / 4;
                dataSet.setValue(val, s, s);
              }
              // for save button
              save.setVisible(true);
              save.addListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                  try {
                    ChartUtilities
                        .saveChartAsJPEG(
                            new File(
                                "/home/matrix/Desktop/graphs/graph.jpg"),
                            chartOfThemes, 500, 300);
                  } catch (IOException e) {
                    e.printStackTrace();
                  }
                  __app.getMainWindow()
                      .showNotification(
                          "Notification",
                          "Graphe Enregistré",
                          Window.Notification.TYPE_TRAY_NOTIFICATION);
                }
              });
              chartOfThemes = ChartFactory.createBarChart3D(
                  "Récurrences", "Thème", "Récurrence (%)",
                  dataSet, PlotOrientation.VERTICAL, true,
                  true, false);
              wrapChart = new JFreeChartWrapper(chartOfThemes);
              wrapChart.setImmediate(true);
              _vlayout.addComponent(wrapChart);
              _vlayout.setComponentAlignment(wrapChart,
                  Alignment.MIDDLE_CENTER);
              vpanel.setVisible(true);
            } else {
              save.setVisible(false);
              vpanel.setVisible(false);
              rec.setWidth("400px");
              rec.setHeight("200px");
              rec.center();
              __app.getMainWindow().showNotification(
                  "Notification",
                  "Pas de données pour cet aéroport",
                  Window.Notification.TYPE_TRAY_NOTIFICATION);
            }
          }
        });
        __app.getMainWindow().addWindow(rec);
      }
    });

    // Comparisons
    menu.addButton("Comparaisons", new TouchMenu.Command() {
      @Override
      public void menuSelected(TouchMenuButton selectedButton) {

        compa = new Window("Comparaisons");
        compa.center();
        compa.setWidth("400px");
        compa.setHeight("200px");
        compa.setImmediate(true);
        compa.removeAllComponents();
        // connecting to server
        ___server = new DQSPServerI();

        // to ensure the repaint of the horizontal layout
        __hlayout.removeAllComponents();

        compaType = new ComboBox("Type de Comparaison");
        compaType.setImmediate(true);
        compaType.setIcon(new ThemeResource("icons/actions/misc.png"));
        compaType.setInputPrompt("Choisissez un type");
        compaType.addItem("globale");
        compaType.addItem("thématique");
        compaType.setNullSelectionAllowed(false);
        __hlayout.addComponent(compaType);
        __hlayout.setComponentAlignment(compaType,
            Alignment.BOTTOM_LEFT);

        _history = new ComboBox("Année");
        _history.setImmediate(true);
        _history.setInputPrompt("Année");
        _history.setIcon(new ThemeResource("icons/actions/history.png"));
        _history.setVisible(false);
        _history.setNullSelectionAllowed(false);
        __hlayout.addComponent(_history);
        __hlayout.setComponentAlignment(_history,
            Alignment.BOTTOM_RIGHT);
        for (Integer i : ___server.listOfYears()) {
          _history.addItem(i);
        }

        compaTheme = new ComboBox("Thème");
        compaTheme
            .setIcon(new ThemeResource("icons/actions/blend.png"));
        compaTheme.setVisible(false);
        compaTheme.setImmediate(true);
        compaTheme.setNullSelectionAllowed(false);
        compaTheme.setInputPrompt("Choisissez un thème");
        // filling themes
        for (String s : ___server.listOfThemesInClaims()) {
          compaTheme.addItem(s);
        }
        __hlayout.addComponent(compaTheme);
        __hlayout.setComponentAlignment(compaTheme,
            Alignment.BOTTOM_RIGHT);

        saveComp = new Button();
        saveComp.setIcon(new ThemeResource("icons/actions/filesave.png"));
        saveComp.setDescription("Enregistrer");
        saveComp.setVisible(false);
        __hlayout.addComponent(saveComp);
        __hlayout.setComponentAlignment(saveComp,
            Alignment.BOTTOM_RIGHT);
View Full Code Here

  @SuppressWarnings("deprecation")
  Panel createInfoWindow(String airport) {

    Panel mainPanel = new Panel();
    mainPanel.setSizeUndefined();
    mainPanel.setIcon(new ThemeResource("icons/actions/view_sidetree.png"));
    // to layout each panel
    HorizontalLayout content = new HorizontalLayout();

    // Points Faibles
    VerticalLayout vlayout = new VerticalLayout();
View Full Code Here

   
    //panel.setWidth("635px");
    //panel.setHeight("620px");
    panel.setSizeUndefined();
    panel.setCaption("Sélectionnez un aéroport");
    panel.setIcon(new ThemeResource("icons/actions/toggle_log.png"));
   
    table = new Table("Tableau de Réclamations");
    table.setVisible(false);
    rm = new ReclamationModel();
    _server = new DQSPServerI();
   
    airports = new ComboBox();
    airports.setIcon(new ThemeResource("icons/actions/identity.png"));
    for (String s : _server.listOfAirports()){
      airports.addItem(s);
    }
   
    airports.setInputPrompt("Aéroport Concerné");
    airports.setImmediate(true);
    airports.setNullSelectionAllowed(false);
    airports.addListener(new Property.ValueChangeListener() {
     
      @Override
      public void valueChange(ValueChangeEvent event) {
       
        //getting the container
        IndexedContainer container = new IndexedContainer();
        container.addContainerProperty("ID Passager", Integer.class, null);
        container.addContainerProperty("Date", java.sql.Date.class, null);
        container.addContainerProperty("Terminale", String.class, null);
        container.addContainerProperty("Descriptif", String.class, null);
       
        if (rm.getAirportsReclamations(String.valueOf(airports.getValue())).size() != 0){
          panel.setCaption("Tableau de Réclamations");
          //filling out the container
          for (Reclamation a : rm.getAirportsReclamations(String.valueOf(airports.getValue())))
          {
            Item item = container.addItem(a);
            item.getItemProperty("ID Passager").setValue(a.getIdPassager());
            item.getItemProperty("Date").setValue(a.getDate());
            item.getItemProperty("Terminale").setValue(a.getTerminale());
            item.getItemProperty("Descriptif").setValue(a.getDescriptif());
          }
         
          table.setContainerDataSource(container);
          table.setFooterVisible(true);
          table.setColumnFooter("ID Passager", "Total");
          table.setColumnFooter("Descriptif", String.valueOf(rm.getAirportsReclamations(String.valueOf(airports.getValue())).size()));
          table.setPageLength(0);
          table.setVisible(true);
        } else {
          panel.setCaption("Sélectionnez un aéroport");
          __app.getMainWindow().showNotification("Notification","Pas de réclamations pour cet aéroport",Window.Notification.TYPE_TRAY_NOTIFICATION);
          table.setVisible(false);
        }
      }
    });
     
    addComponent(airports);
    setComponentAlignment(airports, "right");
   
    table.setWidth("100%");
    table.setSelectable(true);
    table.setColumnReorderingAllowed(true);
    table.setColumnCollapsingAllowed(true);
   
    table.setColumnIcon("ID Passager", new ThemeResource("icons/actions/power.png"));
    table.setColumnIcon("Date", new ThemeResource("icons/actions/misc.png"));
    table.setColumnIcon("Terminale", new ThemeResource("icons/actions/signature.png"));
    table.setColumnIcon("Descriptif", new ThemeResource("icons/actions/messagebox_warning.png"));
   
    setMargin(true);
    setSpacing(true);
   
    addComponent(table);
View Full Code Here

  public MailingList(ReclaadminApplication application, Panel panel) {
    __app = application;

    panel.setWidth("625px");
   
    panel.setIcon(new ThemeResource("icons/actions/mail_replyall.png"));
    panel.setCaption("Liste des contacts");
   
    setMargin(true);

    table = new Table("Liste des contacts");
    table.setWidth("100%");
    table.setPageLength(0);

    addComponent(table);

    IndexedContainer container = new IndexedContainer();
    container.addContainerProperty("Nom", String.class, null);
    container.addContainerProperty("Email", String.class, null);

    for (Passager p : getPassagerMailList()) {
      Item item = container.addItem(p);
      item.getItemProperty("Nom").setValue(p.getNom());
      item.getItemProperty("Email").setValue(p.getEmail());
    }

    table.setContainerDataSource(container);
    table.setColumnReorderingAllowed(true);
    table.setColumnCollapsingAllowed(true);
    table.setSelectable(true);

    // setting the table footer
    table.setFooterVisible(true);
    table.setColumnFooter("Nom", "Total");
    table.setColumnFooter("Email",
        String.valueOf(getPassagerMailList().size()));
   
    table.setColumnIcon("Nom",new ThemeResource("icons/actions/identity.png"));
    table.setColumnIcon("Email",new ThemeResource("icons/actions/mail_generic.png"));

    Button send = new Button("Envoyer");
    send.setIcon(new ThemeResource("icons/actions/mail_replyall.png"));
    send.addListener(new Button.ClickListener() {
      @Override
      public void buttonClick(ClickEvent event) {
        // Here code to reply to passengers
        __app.getMainWindow().showNotification(
            "Notification","Votre Message est délivré avec succés",Window.Notification.TYPE_TRAY_NOTIFICATION);
      }
    });

    hlayout.setSpacing(true);
    hlayout.setMargin(true);

    hlayout.addComponent(send);

    final Button button = new Button("Editer");
    button.setIcon(new ThemeResource("icons/actions/edit.png"));
    hlayout.addComponent(button);
    button.addListener(new Button.ClickListener() {
      @Override
      public void buttonClick(ClickEvent event) {
        table.setEditable(!table.isEditable());
View Full Code Here

  {
    __app = application;
   
    panel.setSizeUndefined();
    panel.setCaption("Sélectionnez un aéroport");
    panel.setIcon(new ThemeResource("icons/actions/wizard.png"));
    hlayout.setVisible(false);
   
    formatter = new SimpleDateFormat("d/MM/yyyy");
    table = new Table("Tableau d'actions Entreprise - "+formatter.format(new java.util.Date()));
    table.setVisible(false);
   
    send = new Button("Envoyer");
    send.setIcon(new ThemeResource("icons/actions/mail_send.png"));
   
    airports = new ComboBox();
    airports.setIcon(new ThemeResource("icons/actions/identity.png"));
    airports.setImmediate(true);
    airports.setNullSelectionAllowed(false);
    airports.setInputPrompt("Aéroport Concerné");
    for(String s : _server.listOfAirports()){
      airports.addItem(s);
    }
   
    //the application must detect which airport is this
    airports.addListener(new Property.ValueChangeListener() {
     
      @Override
      public void valueChange(ValueChangeEvent event) {
       
        if (actionsModel.listOfActions(String.valueOf(airports.getValue())).size() != 0) {
         
          panel.setCaption("Tabeau Actions Entreprises");
         
          table.setImmediate(true);
          table.setWidth("100%");
          //clearing the table
          table.removeAllItems();
         
          //----------------------------------------
          table.addContainerProperty("service", String.class  , null);
          table.addContainerProperty("thème", String.class  , null);
          table.addContainerProperty("observations", String.class  , null);
          table.addContainerProperty("action", String.class, null);
          table.addContainerProperty("validation", String.class, null);
          table.addContainerProperty(" ", PopupView.class, null);
         
          // getting a connection
          Connection c = DBConnexion.getConnection();
          String SQLquery = "SELECT m.`service`, m.`theme`,m.`observations`, m.`action`, m.`validation` FROM myActions m WHERE validation='EN COURS' AND idAeroport=?";

          try {
            // creating the statement
            PreparedStatement ps = c.prepareStatement(SQLquery);
            ps.setString(1, String.valueOf(airports.getValue()));
           
            ResultSet rs = ps.executeQuery();
            int i =0;
            while(rs.next() && i<actionsModel.listOfActions(String.valueOf(airports.getValue())).size()){
              table.addItem(new Object[]{rs.getString("service"), rs.getString("theme"), rs.getString("observations"),rs.getString("action"), rs.getString("validation"),createPopUpView(table)}, i);
              i++;
            }
           
            ps.close();
            rs.close();
          } catch (SQLException e) {
            e.printStackTrace();
          }
         
          //------------------------------------------
          table.setSelectable(true);
          table.setWriteThrough(true);
          table.setPageLength(0);
          table.setFooterVisible(true);
          table.setVisible(true);
          table.setColumnReorderingAllowed(true);
          table.setColumnCollapsingAllowed(true);
          hlayout.setVisible(true);
        } else{
          panel.setCaption("Sélectionnez un aéroport");
          table.removeAllItems();
          table.setVisible(false);
          hlayout.setVisible(false);
          __app.getMainWindow().showNotification("Notification","Pas d'actions pour cet aéroport",Window.Notification.TYPE_TRAY_NOTIFICATION);
        }

      }
    });
   
     
    addComponent(airports);
    setComponentAlignment(airports, "right");
   
   
    table.setColumnIcon("service", new ThemeResource("icons/actions/power.png"));
    table.setColumnIcon("thème", new ThemeResource("icons/actions/misc.png"));
    table.setColumnIcon("observations", new ThemeResource("icons/actions/messagebox_warning.png"));
    table.setColumnIcon("action", new ThemeResource("icons/actions/redo.png"));
    table.setColumnIcon("validation", new ThemeResource("icons/actions/apply.png"));
    table.setColumnIcon(" ", new ThemeResource("icons/actions/down.png"));
   
    setMargin(true);
    //setSpacing(true);
   
    addComponent(table);
View Full Code Here

   
   
    final ComboBox validation = new ComboBox();
    validation.setImmediate(true);
    validation.setInputPrompt("Choisissez un état");
    validation.setIcon(new ThemeResource("icons/actions/misc.png"));
    validation.setNullSelectionAllowed(false);
    validation.addItem("EN COURS");
    validation.addItem("FAITE");
    hlayout.addComponent(validation);
    hlayout.setComponentAlignment(validation, Alignment.BOTTOM_LEFT);
   
    Button b = new Button();
    b.setDescription("Modifier");
    b.setIcon(new ThemeResource("icons/actions/filesave.png"));
    hlayout.addComponent(b);
    hlayout.setComponentAlignment(b, Alignment.BOTTOM_RIGHT);
    b.addListener(new Button.ClickListener() {
      
      @Override
View Full Code Here

TOP

Related Classes of com.vaadin.terminal.ThemeResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.