Package com.aesthete.swingobjects.fw.common

Examples of com.aesthete.swingobjects.fw.common.SwingObjectsException


        fos=new RandomAccessFile(file,"rw");
      }
    } catch (FileNotFoundException e) {
      isLocked=true;
    }catch (Exception e) {
      throw new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE, null, e, FileHelper.class);
    }finally {
      try {
        if(fos!=null) {
          fos.close();
        }
      }catch(Exception e) {
        throw new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE, null, e, FileHelper.class);
      }
    }
    return isLocked;
  }
View Full Code Here


    File folder=new File(folderPath);
    if(folder.exists()) {
      try {
        FileUtils.deleteDirectory(folder);
      }catch(IOException e) {
        new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE,"Exception for us to log",e, FileHelper.class);
        String message = e.getMessage();
        if(message.indexOf("\\")!=-1) {
          message=message.replaceAll(Pattern.quote("\\"), Matcher.quoteReplacement("/"));
        }
        throw new SwingObjectsException("error.deleteunable", ErrorSeverity.ERROR, null, FileHelper.class,message);
      }
    }
  }
View Full Code Here

      CommonUtilities.updateWaitDialogBoxMessage(Properties.getAppProps("waitdialog.done"));
    }catch(final IOException e) {
      try {
        SwingUtilities.invokeAndWait(new Runnable() {
          public void run() {
            new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE,"Exception for us to log",e, FileHelper.class);
            String message = e.getMessage();
            if(message.indexOf("\\")!=-1) {
              message=message.replaceAll(Pattern.quote("\\"), Matcher.quoteReplacement("/"));
            }
            int option = JOptionPane.showConfirmDialog(null, Properties.getErrorDesc("error.deleteunable",message),
                Properties.getAppProps("common.dialog.title.confirm"), JOptionPane.DEFAULT_OPTION);

            if (option == JOptionPane.YES_OPTION) {
              deleteFolderWaitIfOpen(folder);
            }
          }
        });
      } catch (Exception e1) {
        new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE,"Exception for us to log",e, FileHelper.class);
      }
    }

  }
View Full Code Here

        return isDirSame;
      }else {
        return true;
      }
    } catch (Exception e) {
      throw new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE, null, e, FileHelper.class);
    }
  }
View Full Code Here

      /*
       *  This is where you go to your database to confirm that the
       *  user id and password exists in the database.
       */
      if(!dto.getUserId().equals("swingobjects") || !dto.getPassword().equals("12345")) {
        throw new SwingObjectsException("error.logonfailed", ErrorSeverity.ERROR, null, UserAction.class);
      }
      CommonUtilities.updateWaitDialogBoxMessage("\nChecking database...");
      Thread.sleep(4000);
      CommonUtilities.updateWaitDialogBoxMessage("Done");

      dto.setUserName("SwingObjects User 1");
    } catch(SwingObjectsException e){
      scopeObj.setErrorObj(e);
    }catch (Exception e) {
      scopeObj.setErrorObj(new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE, null, e, UserAction.class));
    }
  }
View Full Code Here

                } catch (final Exception ex) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            CommonUI.showErrorDialogForComponent(scopeObj.getActionPerformOnComp(),
                                                 new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE,
                                                        "Eeror occured while invoking and waiting", ex,ActionProcessor.class));
                        }
                    });
                }
           }else{
               BaseAppSwingWorker swingWorker=SwingActionFactory.getSwingWorker(action, scopeKey);
               swingWorker.execute();
           }
       }else{
         if(scopeObj.getErrorObj()==null){
               CommonUI.showErrorDialogForComponent(scopeObj.getActionPerformOnComp(),
                       new SwingObjectsException("error.op.common", ErrorSeverity.ERROR, null,CommonUI.class));
           }else{
               CommonUI.showErrorDialogForComponent(scopeObj.getActionPerformOnComp(),scopeObj.getErrorObj());
           }
           CommonUI.setDefaultsComponents(scopeObj.getCompMap().values().iterator());
       }
View Full Code Here

                        handleErrorAndCallLaucnher();
                    }catch(SwingObjectsException e){
                        CommonUI.showErrorDialogForComponent(scopeObj.getActionPerformOnComp(),e);
                    }catch(Exception e){
                        CommonUI.showErrorDialogForComponent(scopeObj.getActionPerformOnComp(),
                                new SwingObjectsException("error.severe.SF001",ErrorSeverity.SEVERE,
                                "Exception caugth while waiting on get on swing worker", e,BaseAppSwingWorker.class));
                    }
                }
            });
View Full Code Here




    private void handleErrorAndCallLaucnher() throws SwingObjectsException {
        final SwingObjectsException exceptionObj=scopeObj.getErrorObj();
        if(exceptionObj==null){
            callLauncher();
            return;
        }
        switch(exceptionObj.getErrorType()){
            case SEVERE: throw exceptionObj;
            case ERROR :
                if (exceptionObj.isCallConnector()) {
                  callLauncher();
                }
        CommonUI.showErrorDialogForComponent(scopeObj.getActionPerformOnComp(),exceptionObj);
                break;
            case WARNING:
View Full Code Here

    if(rows==null){
      return null;
    }else{
      if(rows.size()<=row){
        // for error logging only
        new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE,
            "rows- "+rows.size()+" less than row-"+row,CommonTableModel.class);
      }else{
        List<Object> rowList=rows.get(row);
        if(rowList==null){
          return null;
        }
        if(rowList.size()<=column){
          //for error logging only
          new SwingObjectsException("error.severe.SF001", ErrorSeverity.SEVERE,
              "columns- "+rowList.size()+" less than column-"+column,CommonTableModel.class);
        }else{
          return rowList.get(column);
        }
      }
View Full Code Here

TOP

Related Classes of com.aesthete.swingobjects.fw.common.SwingObjectsException

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.