Beispiel #1
0
 public void carregarItemMenuListener(ActionEvent event) {
   String migalha = null;
   String idCommandLink = null;
   if (event.getSource() instanceof HtmlCommandLink) {
     HtmlCommandLink commandLink = (HtmlCommandLink) event.getSource();
     idCommandLink = (String) commandLink.getId();
     Acesso acessoTemp = mapAcessos.get(idCommandLink);
     if (acessoTemp != null) {
       migalha = acessoTemp.obterMigalha();
     }
   }
   FacesUtil.adicionarAtributoSessao(MIGALHA, migalha);
 }
Beispiel #2
0
 public void buttonClicked(ActionEvent e) {
   CustomButtonNode currentButton = (CustomButtonNode) e.getSource();
   if (currentButton.isExpanded()) {
     collapseNode(currentButton);
   } else {
     expandNode(currentButton);
   }
 }
Beispiel #3
0
 public void processAction(ActionEvent event) throws AbortProcessingException {
   log.debug("TreeHandler::processAction()");
   UIComponent component = (UIComponent) event.getSource();
   while (!(component != null && component instanceof HtmlTree)) {
     component = component.getParent();
   }
   if (component != null) {
     HtmlTree tree = (HtmlTree) component;
     tree.setNodeSelected(event);
   }
 }
  public void editarProduto(ActionEvent event) {
    System.out.println(produto.getProduto());
    System.out.println(event.getSource().toString());
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("modal", true);
    params.put("draggable", false);
    params.put("resizable", false);
    params.put("contentHeight", 600);
    params.put("contentWidth", 1200);

    getSessaoAtual()
        .setAttribute(
            ServletExibicaoTemporariaEdicaoProdutos.IMAGEM_A_SER_EDITADA, getProduto().getFoto());

    getPrimefacesRequestContext().openDialog("toDialogEditarProduto", params, null);
  }
  public void populateWinnerList1(ActionEvent auctionevt) {
    localWinners.clear();
    remoteWinners.clear();
    claimed = false;

    HtmlCommandLink detail = (HtmlCommandLink) auctionevt.getSource();
    Map<String, Object> attributes = auctionevt.getComponent().getAttributes();
    String auctionId = (String) attributes.get("timeStamp");
    System.out.println("Attribute found:" + auctionId);
    String userId = getUserObj().getName();
    // String auctionId = (String) detail.getValue();
    currentAuctionKey = userId + "_" + auctionId;
    AuctionResults results = getAuctionResults(currentAuctionKey);
    if (results != null) {
      localWinners.addAll(results.getLocalWinners());
      remoteWinners.addAll(results.getRemoteWinners());
      claimed = results.getClaimed();
    }
    // System.out.println("Received auctionId: " + detail.getValue());
    // System.out.println("Received category: " +
    // buyerCriteria.getCategory());
  }
Beispiel #6
0
  /*
   * Processes the event queued on the graph component when a particular
   * node in the tree control is to be expanded or collapsed.
   */
  public void processGraphEvent(ActionEvent event) {
    if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.fine("TRACE: GraphBean.processGraphEvent ");
    }
    Graph graph = null;
    GraphComponent component = (GraphComponent) event.getSource();
    String path = (String) component.getAttributes().get("path");

    // Acquire the root node of the graph representing the menu
    graph = (Graph) component.getValue();
    if (graph == null) {
      if (LOGGER.isLoggable(Level.SEVERE)) {
        LOGGER.severe("ERROR: Graph could not located in scope ");
      }
    }
    // Toggle the expanded state of this node
    Node node = graph.findNode(path);
    if (node == null) {
      if (LOGGER.isLoggable(Level.SEVERE)) {
        LOGGER.severe("ERROR: Node " + path + "could not be located. ");
      }
      return;
    }
    boolean current = node.isExpanded();
    node.setExpanded(!current);
    if (!current) {
      Node parent = node.getParent();
      if (parent != null) {
        Iterator kids = parent.getChildren();
        while (kids.hasNext()) {
          Node kid = (Node) kids.next();
          if (kid != node) {
            kid.setExpanded(false);
          }
        }
      }
    }
  }