Exemplo n.º 1
0
        public void menuSelected(MenuItem selectedItem) {
          if (selectedItem.getText().equals("Cadastrar")) {
            SsamUsuario U = new SsamUsuario();
            Window mainWindow3 = new Window("Cadastrar");
            // System.out.println("PARENT " + getWindow().getParent());
            mainWindow3.setWidth(1500, Window.UNITS_PIXELS);
            mainWindow3.setHeight(1500, Window.UNITS_PIXELS);
            mainWindow3.addComponent(U);
            getWindow().getParent().addWindow(mainWindow3);

          } else if (selectedItem.getText().equals("Consultar")) {
            SsamConsulta U;
            try {
              U = new SsamConsulta(verificaTpUsuario(Logou));
              Window mainWindow3 = new Window("Consultar");
              // System.out.println("PARENT " + getWindow().getParent());
              mainWindow3.setWidth(1200, Window.UNITS_PIXELS);
              mainWindow3.setHeight(1000, Window.UNITS_PIXELS);
              mainWindow3.addComponent(U);
              getWindow().getParent().addWindow(mainWindow3);
            } catch (SQLException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
          } else if (selectedItem.getText().equals("Seleção")) {
            SsamSelecao S;
            SelecaoDao aprovados = new SelecaoDao();
            try {
              S = new SsamSelecao(aprovados.calcula(), aprovados.getNome());
              Window mainWindow3 = new Window("Seleção");
              mainWindow3.setWidth(1200, Window.UNITS_PIXELS);
              mainWindow3.setHeight(1000, Window.UNITS_PIXELS);
              mainWindow3.addComponent(S);
              getWindow().getParent().addWindow(mainWindow3);

            } catch (SQLException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }

            ///// //Colocar na tela SSamSelecao

          } else if (selectedItem.getText().equals("Alterar Senha")) {
            SsamAlterarSenha U = new SsamAlterarSenha();
            Window mainWindow3 = new Window("Alterar Senha");
            // System.out.println("PARENT " + getWindow().getParent());
            mainWindow3.setWidth(400, Window.UNITS_PIXELS);
            mainWindow3.setHeight(300, Window.UNITS_PIXELS);
            mainWindow3.addComponent(U);
            getWindow().getParent().addWindow(mainWindow3);
          }
        }
Exemplo n.º 2
0
 private static void assertUniqueIds(Set<Object> ids, MenuItem item) {
   int id = item.getId();
   System.out.println("Item " + item.getText() + ", id: " + id);
   Assert.assertFalse(ids.contains(id));
   ids.add(id);
   if (item.getChildren() != null) {
     for (MenuItem subItem : item.getChildren()) {
       assertUniqueIds(ids, subItem);
     }
   }
 }