Пример #1
0
 /** Display a message in lieu of the normal page */
 protected void displayMsgInLieuOfPage(String msg) throws IOException {
   // TODO: Look at HTML
   Page page = newPage();
   Composite warning = new Composite();
   warning.add(msg);
   warning.add("<br>");
   page.add(warning);
   layoutFooter(page);
   page.write(resp.getWriter());
 }
Пример #2
0
 /**
  * Return a labelled rasio button
  *
  * @param label appears to right of circle if non null
  * @param value value assigned to key if box checked
  * @param key form key to which value is assigned
  * @param checked if true, is initially checked
  * @return a readio button Element
  */
 protected Element radioButton(String label, String value, String key, boolean checked) {
   Composite c = new Composite();
   Input in = new Input(Input.Radio, key, value);
   if (checked) {
     in.check();
   }
   setTabOrder(in);
   c.add(in);
   c.add(label);
   return c;
 }
Пример #3
0
 /**
  * Return a (possibly labelled) checkbox.
  *
  * @param label appears to right of checkbox if non null
  * @param value value included in result set if box checked
  * @param key form key to which result set is assigned
  * @param checked if true, box is initially checked
  * @return a checkbox Element
  */
 Element checkBox(String label, String value, String key, boolean checked) {
   Input in = new Input(Input.Checkbox, key, value);
   if (checked) {
     in.check();
   }
   setTabOrder(in);
   if (StringUtil.isNullString(label)) {
     return in;
   } else {
     Composite c = new Composite();
     c.add(in);
     c.add(" ");
     c.add(label);
     return c;
   }
 }
Пример #4
0
  /** Common page setup. */
  protected Page newPage() {
    // Compute heading
    String heading = getHeading();
    if (heading == null) {
      heading = "Box Administration";
    }

    // Create page and layout header
    Page page = ServletUtil.doNewPage(getPageTitle(), isFramed());
    Iterator inNavIterator;
    if (myServletDescr().hasNoNavTable()) {
      inNavIterator = CollectionUtil.EMPTY_ITERATOR;
    } else {
      inNavIterator =
          new FilterIterator(
              new ObjectArrayIterator(getServletDescrs()),
              new Predicate() {
                public boolean evaluate(Object obj) {
                  return isServletInNav((ServletDescr) obj);
                }
              });
    }
    ServletUtil.layoutHeader(
        this,
        page,
        heading,
        isLargeLogo(),
        getMachineName(),
        getLockssApp().getStartDate(),
        inNavIterator);
    String warnMsg = CurrentConfig.getParam(PARAM_UI_WARNING);
    if (warnMsg != null) {
      Composite warning = new Composite();
      warning.add("<center><font color=red size=+1>");
      warning.add(warnMsg);
      warning.add("</font></center><br>");
      page.add(warning);
    }
    return page;
  }
Пример #5
0
 private void linkToJavaScript(Composite comp) {
   Script script = new Script("");
   script.attribute("src", "admin.js");
   comp.add(script);
 }
Пример #6
0
 private void includeJavaScript0(Composite comp) {
   Script script = new Script(getJavascript());
   comp.add(script);
 }