Examples of BOFile


Examples of com.zycus.dotproject.bo.BOFile

  private void onVersions() {
    int selectedIndex = projectFiles.getSelectedRow();
    if (selectedIndex < 0) {
      return;
    }
    BOFile taskFile = (BOFile) projectFiles.getValueAt(selectedIndex, -1);
    DialogUtility.showDialog(new FileVersionsPanel(fileManager.getAllVersions(taskFile.getRootFileID(), ApplicationContext.getCurrentUser())), "All versions", new Dimension(550, 200));
  }
View Full Code Here

Examples of com.zycus.dotproject.bo.BOFile

  private void onViewFile() {
    int selectedIndex = projectFiles.getSelectedRow();
    if (selectedIndex < 0) {
      return;
    }
    BOFile taskFile = (BOFile) projectFiles.getValueAt(selectedIndex, -1);
    JFileChooser fileChooser = new JFileChooser() {
      @Override
      public void cancelSelection() {
        Map<Thread, StackTraceElement[]> stackTrace = Thread.getAllStackTraces();
        if (stackTrace.get(Thread.currentThread())[4].getFileName().contains("AbstractButton")) {
          super.cancelSelection();
        }
      }
    };
    File f = null;
    if (ApplicationContext.getUserPreferences().getUserSelectedDir() != null) {
      f = new File(ApplicationContext.getUserPreferences().getUserSelectedDir() + File.separator + taskFile.getRealFilename());
    } else {
      f = new File(System.getProperty("java.io.tmpdir") + taskFile.getRealFilename());

    }
    fileChooser.setSelectedFile(f);
    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    fileChooser.setMultiSelectionEnabled(false);
View Full Code Here

Examples of com.zycus.dotproject.bo.BOFile

    if (JOptionPane.showConfirmDialog(ApplicationContext.getCurrentFrame(), "Are you sure that you want to delete the selected version?", "Delete Confirmation", JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
      return;
    }

    BOFile taskFile = (BOFile) projectFiles.getValueAt(selectedIndex, -1);
    try {
      fileManager.deleteFile(taskFile, ApplicationContext.getCurrentUser());
      fileTableModel.updateFileList(fileManager.getAllFile((BOProject) lstProjects.getSelectedValue(), ApplicationContext.getCurrentUser()));
    } catch (Throwable a_th) {
      a_th.printStackTrace();
View Full Code Here

Examples of com.zycus.dotproject.bo.BOFile

    int selectedIndex = projectFiles.getSelectedRow();
    if (selectedIndex < 0) {
      return;
    }

    BOFile taskFile = (BOFile) projectFiles.getValueAt(selectedIndex, -1);

    FileEditorPanel fe = new FileEditorPanel(FileEditorMode.FileCheckIn);
    fe.setFile(taskFile);
    DialogUtility.showDialog(fe, "CheckIn file", new Dimension(350, 250));
    if (fe.getRealFile() == null || fe.getFile() == null) {
      return;
    }

    taskFile.setFileCheckout("");
    taskFile.setCheckedOutUser(null);
    taskFile.setFileDate(new Date());

    BOFile newTaskFile = fe.getFile();
    File realFile = fe.getRealFile();
    newTaskFile.setTaskID(taskFile.getTaskID());

    newTaskFile.setProject((BOProject) lstProjects.getSelectedValue());
    newTaskFile.setFileName(newTaskFile.generateFileName());
    newTaskFile.setFileVersion(taskFile.getFileVersion() + 1);
    newTaskFile.setFileDate(new Date());
    try {
      fileManager.checkInFile(taskFile, newTaskFile, realFile, ApplicationContext.getCurrentUser());
      fileTableModel.updateFileList(fileManager.getAllFile((BOProject) lstProjects.getSelectedValue(), ApplicationContext.getCurrentUser()));
    } catch (Throwable a_th) {
      a_th.printStackTrace();
View Full Code Here

Examples of com.zycus.dotproject.bo.BOFile

    String strReason = area.getText();
    if (strReason == null) {
      return;
    }
    BOFile taskFile = (BOFile) projectFiles.getValueAt(selectedIndex, -1);
    taskFile.setCheckedOutUser(ApplicationContext.getCurrentUser());
    taskFile.setFileCheckoutReason(strReason);
    taskFile.setFileDate(new Date());
    taskFile.setFileCheckout(ApplicationContext.getCurrentUser().getUserID() + "");
    try {
      fileManager.checkOutFile(taskFile, ApplicationContext.getCurrentUser());
      fileTableModel.updateFileList(fileManager.getAllFile((BOProject) lstProjects.getSelectedValue(), ApplicationContext.getCurrentUser()));
    } catch (Throwable a_th) {
      a_th.printStackTrace();
View Full Code Here

Examples of com.zycus.dotproject.bo.BOFile

    FileEditorPanel fe = new FileEditorPanel(FileEditorMode.FileAdd);
    DialogUtility.showDialog(fe, "Add new file", new Dimension(350, 250));
    if (fe.getRealFile() == null || fe.getFile() == null) {
      return;
    }
    BOFile file = fe.getFile();
    File f = fe.getRealFile();

    file.setProject((BOProject) lstProjects.getSelectedValue());
    file.setFileName(file.generateFileName());
    try {
      fileManager.addFile(file, f);
      fileTableModel.updateFileList(fileManager.getAllFile((BOProject) lstProjects.getSelectedValue(), ApplicationContext.getCurrentUser()));
    } catch (Throwable a_th) {
      a_th.printStackTrace();
View Full Code Here

Examples of com.zycus.dotproject.bo.BOFile

      } else if (column == 1) {
        return files.get(row).getRealFilename();
      } else if (column == 2) {
        return files.get(row).getFileDescription();
      } else if (column == 3) {
        BOFile file = files.get(row);
        if (file.getVersionCount() > 1) {
          return files.get(row).getFileVersion() + " ( " + file.getVersionCount() + " )";
        } else {
          return files.get(row).getFileVersion();
        }
      } else if (column == 4) {
        return files.get(row).getFileCategory();
View Full Code Here

Examples of com.zycus.dotproject.bo.BOFile

  private void onVersions() {
    int selectedIndex = projectFiles.getSelectedRow();
    if (selectedIndex < 0) {
      return;
    }
    BOFile taskFile = (BOFile) projectFiles.getValueAt(selectedIndex, -1);
    DialogUtility.showDialog(new FileVersionsPanel(fileManager.getAllVersions(taskFile.getRootFileID(), ApplicationContext.getCurrentUser())), "All versions", new Dimension(550, 200));
  }
View Full Code Here

Examples of com.zycus.dotproject.bo.BOFile

  private void onViewFile() {
    int selectedIndex = projectFiles.getSelectedRow();
    if (selectedIndex < 0) {
      return;
    }
    BOFile taskFile = (BOFile) projectFiles.getValueAt(selectedIndex, -1);
    JFileChooser fileChooser = new JFileChooser() {
      @Override
      public void cancelSelection() {
        Map<Thread, StackTraceElement[]> stackTrace = Thread.getAllStackTraces();
        if (stackTrace.get(Thread.currentThread())[4].getFileName().contains("AbstractButton")) {
          super.cancelSelection();
        }
      }
    };
    File f = null;
    if (ApplicationContext.getUserPreferences().getUserSelectedDir() != null) {
      f = new File(ApplicationContext.getUserPreferences().getUserSelectedDir() + File.separator + taskFile.getRealFilename());
    } else {
      f = new File(System.getProperty("java.io.tmpdir") + taskFile.getRealFilename());

    }
    fileChooser.setSelectedFile(f);
    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    fileChooser.setMultiSelectionEnabled(false);
View Full Code Here

Examples of com.zycus.dotproject.bo.BOFile

    if (JOptionPane.showConfirmDialog(ApplicationContext.getCurrentFrame(), "Are you sure that you want to delete the selected version?", "Delete Confirmation", JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
      return;
    }

    BOFile taskFile = (BOFile) projectFiles.getValueAt(selectedIndex, -1);
    try {
      fileManager.deleteFile(taskFile, ApplicationContext.getCurrentUser());
      fileTableModel.updateFileList(fileManager.getAllFile((BOProject) lstProjects.getSelectedValue(), ApplicationContext.getCurrentUser()));
    } catch (Throwable a_th) {
      a_th.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.