コード例 #1
0
  @Override
  public void actionPerformed(ActionEvent e) {
    super.actionPerformed(e);

    super.actionPerformed(e);
    Opcat2.getGlassPane().setVisible(true);
    Opcat2.getGlassPane().start();

    try {
      JFileChooser myFileChooser = new JFileChooser();
      myFileChooser.setSelectedFile(new File(""));
      myFileChooser.resetChoosableFileFilters();
      myFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

      int retVal = myFileChooser.showOpenDialog(Opcat2.getFrame());
      if (retVal == JFileChooser.APPROVE_OPTION) {
        OpcatMCManager.getInstance()
            .doImport(
                myFileChooser.getSelectedFile(),
                entry,
                "Importing from Opcat user - " + OpcatUser.getCurrentUser().getName());
        GuiControl.getInstance().getRepository().getModelsView().repaintKeepOpen();
      }
    } catch (Exception ex) {
      OpcatLogger.logError(ex);
    }

    Opcat2.getGlassPane().setVisible(false);
    Opcat2.getGlassPane().stop();
  }
コード例 #2
0
  @Override
  public void actionPerformed(ActionEvent e) {
    super.actionPerformed(e);

    Opcat2.getGlassPane().setVisible(true);
    Opcat2.getGlassPane().start();

    try {

      ArrayList<OpcatExposeUser> users =
          OpcatExposeManager.getExposeUsage(entry.getURL().getURIEncodedPath());

      if (users.size() > 0) {
        JOptionPane.showMessageDialog(Opcat2.getFrame(), "File has used exports, delete canceled");

        return;
      } else {
        // remove expose as there is no users
        ArrayList<OpcatExposeKey> keys =
            OpcatExposeManager.getExposeKey(entry.getURL().getURIEncodedPath());
        for (OpcatExposeKey key : keys) {
          OpcatExposeManager.removeExposeFromDB(key);
        }
      }

      boolean done = false;
      while (!done) {
        String msg =
            (String)
                JOptionPane.showInputDialog(
                    Opcat2.getFrame(),
                    "Enter delete note",
                    "Delete",
                    JOptionPane.PLAIN_MESSAGE,
                    null,
                    null,
                    "Deleted by " + OpcatUser.getCurrentUser().getName());

        if ((msg != null) && (msg.length() > 0)) {
          OpcatMCManager.getInstance().doRemoteDelete(entry, msg);
          GuiControl.getInstance()
              .getRepository()
              .getSVNView()
              .repaintKeepOpen(View_RefreshState.KEEP_OPEN);
        }

        done = true;
      }

    } catch (Exception ex) {
      OpcatLogger.logError(ex);
    }

    Opcat2.getGlassPane().setVisible(false);
    Opcat2.getGlassPane().stop();
  }