Exemplo n.º 1
0
    public void actionPerformed(java.awt.event.ActionEvent arg0) {
      if (JTable1.getSelectedRowCount() != 1) {
        Utilities.errorMessage(resourceBundle.getString("Please select a view to delete"));
        return;
      }

      if (JOptionPane.showConfirmDialog(
              null,
              resourceBundle.getString("Are you sure you want to delete the selected view "),
              resourceBundle.getString("Warning!"),
              JOptionPane.YES_NO_OPTION,
              JOptionPane.WARNING_MESSAGE,
              null)
          == JOptionPane.NO_OPTION) return;

      Vector viewvec = model.getAllViews();
      for (int i = 0; i < viewvec.size(); i++) {
        String viewname = ((AuthViewWithOperations) viewvec.elementAt(i)).getAuthorizedViewName();
        if (JTable1.getValueAt(JTable1.getSelectedRow(), 0).toString().equals(viewname)) {
          AuthViewWithOperations avop = (AuthViewWithOperations) viewvec.elementAt(i);

          model.delViewOp(
              avop.getAuthorizedViewName(), avop.getViewProperties(), avop.getOperations());
        }
      }

      disableButtons();
    }
Exemplo n.º 2
0
  public void setData() {
    /*
       if(model.getAllViews() == null)
    	{
            	return;
    }
    */
    for (int i = JTable1.getRowCount() - 1; i >= 0; i--) {
      ViewTableModel.removeRow(i);
    }

    Vector views = model.getAllViews();
    for (int j = 0; j < views.size(); j++) {
      AuthViewWithOperations view = (AuthViewWithOperations) views.elementAt(j);
      String viewNa = view.getAuthorizedViewName();
      ViewTableModel.addRow(new Object[] {viewNa});
    }
  }