// Sort
  void sortTasks(ArrayList<String> ids) {
    String[] array = new String[ids.size()];

    for (int i = 0; i < array.length; i++) {
      array[i] = ids.get(i);
    }

    CurrentProject.getProcessList().getProcess(processId).setTaskOrder(array);
    CurrentStorage.get().storeProcessList(CurrentProject.getProcessList(), CurrentProject.get());

    this.getContentPane().remove(taskPanel);
    drawTaskPanel();
    pack();
  }
 MimeType addResourceType(String fpath) {
   ResourceTypeDialog dlg =
       new ResourceTypeDialog(App.getFrame(), Local.getString("Resource type"));
   Dimension dlgSize = new Dimension(420, 300);
   dlg.setSize(dlgSize);
   Dimension frmSize = App.getFrame().getSize();
   Point loc = App.getFrame().getLocation();
   dlg.setLocation(
       (frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
   dlg.ext = MimeTypesList.getExtension(fpath);
   dlg.setVisible(true);
   if (dlg.CANCELLED) return null;
   int ix = dlg.getTypesList().getSelectedIndex();
   MimeType mt = (MimeType) MimeTypesList.getAllMimeTypes().toArray()[ix];
   mt.addExtension(MimeTypesList.getExtension(fpath));
   CurrentStorage.get().storeMimeTypesList();
   return mt;
 }
  boolean checkApp(MimeType mt) {
    String appId = mt.getAppId();
    AppList appList = MimeTypesList.getAppList();
    File d;
    if (appId == null) {
      appId = Util.generateId();
      d = new File("/");
    } else {
      File exe = new File(appList.getFindPath(appId) + "/" + appList.getExec(appId));
      if (exe.isFile()) return true;
      d = new File(exe.getParent());
      while (!d.exists()) d = new File(d.getParent());
    }
    SetAppDialog dlg =
        new SetAppDialog(
            App.getFrame(),
            Local.getString(
                Local.getString("Select the application to open files of type")
                    + " '"
                    + mt.getLabel()
                    + "'"));
    Dimension dlgSize = new Dimension(420, 300);
    dlg.setSize(dlgSize);
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    dlg.setLocation(
        (frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.setDirectory(d);
    dlg.appPanel.argumentsField.setText("$1");
    dlg.setVisible(true);
    if (dlg.CANCELLED) return false;
    File f = new File(dlg.appPanel.applicationField.getText());

    appList.addOrReplaceApp(
        appId,
        f.getParent().replace('\\', '/'),
        f.getName().replace('\\', '/'),
        dlg.appPanel.argumentsField.getText());
    mt.setApp(appId);
    /*appList.setFindPath(appId, chooser.getSelectedFile().getParent().replace('\\','/'));
    appList.setExec(appId, chooser.getSelectedFile().getName().replace('\\','/'));*/
    CurrentStorage.get().storeMimeTypesList();
    return true;
  }
Exemplo n.º 4
0
 public void setDocument(Note note) {
   // Note note = CurrentProject.getNoteList().getActiveNote();
   // try {
   // this.editor.editor.setPage(CurrentStorage.get().getNoteURL(note));
   editor.document = (HTMLDocument) CurrentStorage.get().openNote(note);
   editor.initEditor();
   if (note != null) titleField.setText(note.getTitle());
   else titleField.setText("");
   initialTitle = titleField.getText();
   /*
    * } catch (Exception ex) { new ExceptionDialog(ex); }
    */
   /*
    * Document doc = CurrentStorage.get().openNote(note); try {
    * this.editor.editor.setText(doc.getText(0, doc.getLength())); } catch
    * (Exception ex){ ex.printStackTrace(); }
    */
   // .setDocument(CurrentStorage.get().openNote(note));
 }