Package freenet.support

Examples of freenet.support.HTMLNode


          new String[] { "hidden", "filename-"+counter, filename });
    return cell;
  }

  private HTMLNode createCompatModeCell(DownloadRequestStatus get) {
    HTMLNode compatCell = new HTMLNode("td", "class", "request-compat-mode");
    InsertContext.CompatibilityMode[] compat = get.getCompatibilityMode();
    if(!(compat[0] == InsertContext.CompatibilityMode.COMPAT_UNKNOWN && compat[1] == InsertContext.CompatibilityMode.COMPAT_UNKNOWN)) {
      if(compat[0] == compat[1])
        compatCell.addChild("#", NodeL10n.getBase().getString("InsertContext.CompatibilityMode."+compat[0].name())); // FIXME l10n
      else
        compatCell.addChild("#", NodeL10n.getBase().getString("InsertContext.CompatibilityMode."+compat[0].name())+" - "+NodeL10n.getBase().getString("InsertContext.CompatibilityMode."+compat[1].name())); // FIXME l10n
      byte[] overrideCryptoKey = get.getOverriddenSplitfileCryptoKey();
      if(overrideCryptoKey != null)
        compatCell.addChild("#", " - "+l10n("overriddenCryptoKeyInCompatCell")+": "+HexUtil.bytesToHex(overrideCryptoKey));
      if(get.detectedDontCompress())
        compatCell.addChild("#", " ("+l10n("dontCompressInCompatCell")+")");
    }
    return compatCell;
  }
View Full Code Here


    }
    return progressCell;
  }

  private HTMLNode createNumberCell(int numberOfFiles) {
    HTMLNode numberCell = new HTMLNode("td", "class", "request-files");
    numberCell.addChild("span", "class", "number_of_files", String.valueOf(numberOfFiles));
    return numberCell;
  }
View Full Code Here

    numberCell.addChild("span", "class", "number_of_files", String.valueOf(numberOfFiles));
    return numberCell;
  }

  private HTMLNode createFilenameCell(File filename) {
    HTMLNode filenameCell = new HTMLNode("td", "class", "request-filename");
    if (filename != null) {
      filenameCell.addChild("span", "class", "filename_is", filename.toString());
    } else {
      filenameCell.addChild("span", "class", "filename_none", l10n("none"));
    }
    return filenameCell;
  }
View Full Code Here

    }
    return filenameCell;
  }

  private HTMLNode createPriorityCell(short priorityClass, String[] priorityClasses) {
    HTMLNode priorityCell = new HTMLNode("td", "class", "request-priority");
    if(priorityClass < 0 || priorityClass >= priorityClasses.length) {
      priorityCell.addChild("span", "class", "priority_unknown", l10n("unknown"));
    } else {
      priorityCell.addChild("span", "class", "priority_is", priorityClasses[priorityClass]);
    }
    return priorityCell;
  }
View Full Code Here

    }
    return priorityCell;
  }

  private HTMLNode createPriorityControl(PageMaker pageMaker, ToadletContext ctx, short priorityClass, String[] priorityClasses, boolean advancedModeEnabled, boolean isUpload, String controlSuffix) {
    HTMLNode priorityDiv = new HTMLNode("div", "class", "request-priority nowrap");
    priorityDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "change_priority" + controlSuffix, NodeL10n.getBase().getString(isUpload ? "QueueToadlet.changeUploadPriorities" : "QueueToadlet.changeDownloadPriorities") });
    HTMLNode prioritySelect = priorityDiv.addChild("select", "name", "priority"+controlSuffix);
    for (int p = 0; p < RequestStarter.NUMBER_OF_PRIORITY_CLASSES; p++) {
      if(p <= RequestStarter.INTERACTIVE_PRIORITY_CLASS && !advancedModeEnabled) continue;
      if (p == priorityClass) {
        prioritySelect.addChild("option", new String[] { "value", "selected" }, new String[] { String.valueOf(p), "selected" }, priorityClasses[p]);
      } else {
        prioritySelect.addChild("option", "value", String.valueOf(p), priorityClasses[p]);
      }
    }
    return priorityDiv;
  }
View Full Code Here

    }
    return priorityDiv;
  }
 
  private HTMLNode createRecommendControl(PageMaker pageMaker, ToadletContext ctx) {
    HTMLNode recommendDiv = new HTMLNode("div", "class", "request-recommend");
    recommendDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "recommend_request", l10n("recommendFilesToFriends") });
    return recommendDiv;
  }
View Full Code Here

    recommendDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "recommend_request", l10n("recommendFilesToFriends") });
    return recommendDiv;
  }

  private HTMLNode createRemoveFinishedDownloadsControl( PageMaker pageMaker, ToadletContext ctx ) {
    HTMLNode deleteDiv = new HTMLNode("div", "class", "request-delete-finished-downloads");
    deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "remove_finished_downloads_request", l10n("removeFinishedDownloads") });
    return deleteDiv;
  }
View Full Code Here

    return deleteDiv;
  }
 
  /** Create a delete or restart control at the top of a table. It applies to whichever requests are checked in the table below. */
  private HTMLNode createDeleteControl(PageMaker pageMaker, ToadletContext ctx, boolean isDownloadToTemp, boolean canRestart, boolean disableFilterChecked, boolean isUpload, String mimeType, boolean isCompleted) {
    HTMLNode deleteDiv = new HTMLNode("div", "class", "request-delete");
    if(isDownloadToTemp) {
      deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "delete_request", l10n("deleteFilesFromTemp") });
    } else {
      deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "remove_request", l10n("removeFilesFromList") });
      if (isUpload && isCompleted) deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "remove_finished_uploads_request", l10n("removeFinishedUploads") });
    }
    if(canRestart) {
      deleteDiv.addChild("br");
      // FIXME: Split stuff with a permanent redirect to a separate grouping and use QueueToadlet.follow here?
      String restartName = NodeL10n.getBase().getString(/*followRedirect ? "QueueToadlet.follow" : */ isUpload ? "QueueToadlet.restartUploads" : "QueueToadlet.restartDownloads");
      deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "restart_request", restartName });
      if(mimeType != null) {
        HTMLNode input = deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] {"checkbox", "disableFilterData", "disableFilterData" });
        if(disableFilterChecked) {
          input.addAttribute("checked", "checked");
        }
        deleteDiv.addChild("#", l10n("disableFilter", "type", mimeType));
      }
    }
    return deleteDiv;
View Full Code Here

    return deleteDiv;
  }

  private HTMLNode createPanicBox(PageMaker pageMaker, ToadletContext ctx) {
    InfoboxNode infobox = pageMaker.getInfobox("infobox-alert", l10n("panicButtonTitle"), "panic-button", true);
    HTMLNode panicBox = infobox.outer;
    HTMLNode panicForm = ctx.addFormChild(infobox.content, path(), "queuePanicForm");
    panicForm.addChild("#", (SimpleToadletServer.noConfirmPanic ? l10n("panicButtonNoConfirmation") : l10n("panicButtonWithConfirmation")) + ' ');
    panicForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "panic", l10n("panicButton") });
    return panicBox;
  }
View Full Code Here

    panicForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "panic", l10n("panicButton") });
    return panicBox;
  }

  private HTMLNode createIdentifierCell(FreenetURI uri, String identifier, boolean directory) {
    HTMLNode identifierCell = new HTMLNode("td", "class", "request-identifier");
    if (uri != null) {
      identifierCell.addChild("span", "class", "identifier_with_uri").addChild("a", "href", "/" + uri + (directory ? "/" : ""), identifier);
    } else {
      identifierCell.addChild("span", "class", "identifier_without_uri", identifier);
    }
    return identifierCell;
  }
View Full Code Here

TOP

Related Classes of freenet.support.HTMLNode

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.