Beispiel #1
0
 private void loadNotesIncidencia(Request r) {
   ArrayList<Note> arrayNotes = null;
   DefaultListModel m = new DefaultListModel();
   this.lstNotes.setModel(m);
   try {
     arrayNotes = this.objServidor.getNotesByRequestId(r.requestId());
   } catch (RemoteException e) {
     System.out.println("Exception while calling getNotesByRequestId");
     e.printStackTrace();
     return;
   }
   try {
     Iterator<Note> it = arrayNotes.iterator();
     DefaultListModel model = new DefaultListModel();
     while (it.hasNext()) {
       Note n = it.next();
       model.addElement(n.noteDescription().toString());
       this.lstNotes.setModel(model);
       this.hashRequests.put(r.toString(), r);
     }
   } catch (Exception arrEx) {
     System.out.println("Can't iterate through Notes");
     // arrEx.printStackTrace();
     // return;
   }
 }
Beispiel #2
0
  private void loadIncidencies(String type) {
    String tipus = "";
    this.isComboLoading = true;
    this.cmbIncidencia.removeAllItems();
    if (type.equals("Resolta")) {
      tipus = "Y";

    } else if (type.equals("Oberta")) {
      tipus = "N";
    } else {
      tipus = "";
    }
    ArrayList<Request> arrayRequest = null;
    try {
      arrayRequest = this.objServidor.getRequestsByState(tipus);
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      System.out.println("Can't call getResquestByState");
      e.printStackTrace();
      return;
    }
    try {
      Iterator<Request> it = arrayRequest.iterator();
      while (it.hasNext()) {
        Request r = it.next();
        System.out.println(r.toString());
        this.cmbIncidencia.addItem(r);
        this.hashRequests.put(r.toString(), r);
      }
    } catch (Exception arrEx) {
      System.out.println("Can't iterate through requests");
      return;
    }
    this.isComboLoading = false;
    this.cmbIncidencia.addActionListener(this);
  }