Package org.dspace.app.xmlui.wing.element

Examples of org.dspace.app.xmlui.wing.element.CheckBox


      String url = contextPath+"/handle/"+item.getHandle();
     
      Row row = table.addRow();
     
      CheckBox select = row.addCell().addCheckBox("itemID");
      select.setLabel("Select");
      select.addOption(itemID);
     
      row.addCellContent(owning);
      row.addCell().addXref(url,author);
      row.addCell().addXref(url,title);
    }
View Full Code Here


      if (highlight)
        row = table.addRow(null,null,"highlight");
      else
        row = table.addRow();
     
      CheckBox select = row.addCell().addCheckBox("select_field");
      select.setLabel(id);
      select.addOption(id);
     
      row.addCell().addContent(id);
      row.addCell().addXref(url,fieldName);
      row.addCell().addContent(fieldScopeNote);
    }
View Full Code Here

                }
            }

            if (canBeMapped)
            {
                CheckBox select = row.addCell().addCheckBox("itemID");
                select.setLabel("Select");
                select.addOption(itemID);
            }
            else
            {
                row.addCell().addContent("");
            }
View Full Code Here

          else
            row = table.addRow();
         
          if (group.getID() > 1)
          {
            CheckBox select = row.addCell().addCheckBox("select_group");
            select.setLabel(new Integer(group.getID()).toString());
            select.addOption(new Integer(group.getID()).toString());
          }
          else
          {
            // Don't allow the user to remove the administrative (id:1) or
            // anonymous group (id:0)
View Full Code Here

        fragmentField.setLabel("Fragment");
        fragmentField.setHelp("Enter free formed text, you may use <p>,<a>,<b>,<i>, or <img> tags.");
        fragmentField.setSize(15, 50);
        fragmentField.setValue(fragment);
       
        CheckBox optionsField = form.addItem().addCheckBox("options");
        optionsField.setLabel("Options");
        optionsField.addOption("blankLines", "Treat blank lines as paragraph breaks.");
        if (blankLines)
          optionsField.setOptionSelected("blankLines");
       
       
        Button submit = form.addItem().addButton("submit");
        submit.setValue("Test HTML Rendering");
       
View Full Code Here

        p.addContent(", embedded in a paragraph.");
       
        // Single Checkbox field
        p = suited.addPara();
    p.addContent("This is a singe 'CheckBox' field, ");
        CheckBox checkBox = p.addCheckBox("yes-or-no");
        if (help)
          checkBox.setHelp("Select either yes or no.");
        if (error)
          checkBox.addError("You are incorrect, try again.");
        checkBox.setLabel("Yes or no");
        checkBox.addOption("yes");
        p.addContent(", embedded in a paragraph.");
       
        // File
        p = suited.addPara();
    p.addContent("This is a 'File' field, ");
        File file = p.addFile("file");
        file.setLabel("File");
        if (help)
          file.setHelp("Upload a file.");
        if (error)
          file.addError("This field is in error.");
        p.addContent(", embedded in a paragraph.");
       
        // Select (single)
        p = suited.addPara();
    p.addContent("This is single 'Select' (aka dropdown) field, ");
        Select select = p.addSelect("select");
        select.setLabel("Select (single)");
        if (help)
          select.setHelp("Select one of the options");
        if (error)
          select.addError("This field is in error.");
        select.addOption("one","uno");
        select.addOption("two","dos");
        select.addOption("three","tres");
        select.addOption("four","cuatro");
        select.addOption("five","cinco");
        select.setOptionSelected("one");
        p.addContent(", embedded in a paragraph.");
       
        // Button
        p = suited.addPara();
    p.addContent("This is a 'Button' field, ");
        Button button = p.addButton("button");
        button.setLabel("Button");
        button.setValue("When you touch me I do things, lots of things");
        if (help)
          button.setHelp("Submit buttons allow the user to submit the form.");
        if (error)
          button.addError("This button is in error.");
        p.addContent(", embedded in a paragraph.");
       
       
       
        Division unsuited = body.addDivision("unsuited");
        unsuited.setHead("Fields typicaly unsuited towards being used inline");
   
        unsuited.addPara("Below are a list of embedded fields that are normally considered useless in an inline context. This is because there widgets normally cross multiple lines making them hard to render inline. However these are all legal, but perhaps not advisable, and in some circumstances may be needed.");
   
       
        // Text Area Field
        p = unsuited.addPara();
    p.addContent("This is a 'Text Area' field, ");
        TextArea textArea = p.addTextArea("textarea");
        textArea.setLabel("Text Area");
        if (help)
          textArea.setHelp("This is helpfull text.");
        if (error)
          textArea.addError("This field is in error.");
        textArea.setValue("This is the raw value");
        p.addContent(", embedded in a paragraph.");
       
        // Multi-option Checkbox field
        p = unsuited.addPara();
    p.addContent("This is a multi-option 'CheckBox' field, ");
        checkBox = p.addCheckBox("fruit");
        if (help)
          checkBox.setHelp("Select all the fruits that you like to eat");
        if (error)
          checkBox.addError("You are incorrect you actualy do like Tootse Rolls.");
        checkBox.setLabel("fruits");
        checkBox.addOption("apple","Apples");
        checkBox.addOption(true,"orange","Oranges");
        checkBox.addOption("pear","Pears");
        checkBox.addOption("tootsie","Tootsie Roll");
        checkBox.addOption(true,"cherry","Cherry");
        p.addContent(", embedded in a paragraph.");
       
        // multi-option Radio field
        p = unsuited.addPara();
    p.addContent("This is a multi-option 'Radio' field, ");
View Full Code Here

      addSubmissionProgressList(div);
     
      List form = div.addList("submit-initial-questions", List.TYPE_FORM);
        form.setHead(T_head);   
       
        CheckBox multipleTitles = form.addItem().addCheckBox("multiple_titles");
        multipleTitles.setLabel(T_multiple_titles);
        multipleTitles.setHelp(T_multiple_titles_help);
        multipleTitles.addOption("true");
        if (submission.hasMultipleTitles())
        {
          multipleTitles.setOptionSelected("true");
        }
       
        // If any titles would be removed if the user unselected this box then
        // warn the user!
        if (titles.length > 0)
        {
          org.dspace.app.xmlui.wing.element.Item note = form.addItem();
          note.addHighlight("bold").addContent(T_important_note);
          note.addContent(T_multiple_titles_note);
          for (int i=0; i< titles.length; i++)
          {
            if (i > 0)
              note.addContent(T_separator);
            note.addContent("\"");
            note.addHighlight("bold").addContent(titles[i].value);
            note.addContent("\"");
          }
        }
       
        CheckBox publishedBefore = form.addItem().addCheckBox("published_before");
        publishedBefore.setLabel(T_published_before);
        publishedBefore.setHelp(T_published_before_help);
        publishedBefore.addOption("true");
        if (submission.isPublishedBefore())
        {
          publishedBefore.setOptionSelected("true");
        }
       
        // If any metadata would be removed if the user unselected the box then warn
        // the user about what will be removed.
        if (dateIssued.length > 0 || citation.length > 0 || publisher.length > 0)
View Full Code Here

        String editURL = contextPath + "/admin/item?administrative-continue="+knot.getId()+"&bitstreamID="+bitstream.getID()+"&submit_edit";
        String viewURL = contextPath + "/bitstream/id/"+bitstream.getID()+"/"+bitstream.getName();


        Row row = files.addRow();
        CheckBox remove = row.addCell().addCheckBox("remove");
        remove.setLabel("remove");
        remove.addOption(bundle.getID() + "/" +bitstream.getID() );
        if (!AuthorizeManager.authorizeActionBoolean(context, item, Constants.REMOVE))
        {
          remove.setDisabled();
        }

        if (AuthorizeManager.authorizeActionBoolean(context, bitstream, Constants.WRITE))
        {
          // The user can edit the bitstream give them a link.
View Full Code Here

          hidden.setHelp("This is hidden help?");
        if (error)
          hidden.addError("This a hidden error - I have no idea what this means?");
       
        // Checkbox field
        CheckBox checkBox = list.addItem().addCheckBox("fruit");
        if (help)
          checkBox.setHelp("Select all the fruits that you like to eat");
        if (error)
          checkBox.addError("You are incorrect you actualy do like Tootse Rolls.");
        checkBox.setLabel("fruits");
        checkBox.addOption("apple","Apples");
        checkBox.addOption(true,"orange","Oranges");
        checkBox.addOption("pear","Pears");
        checkBox.addOption("tootsie","Tootsie Roll");
        checkBox.addOption(true,"cherry","Cherry");
       
        // Radio buttons
       
        Radio radio = list.addItem().addRadio("sex");
        radio.setLabel("Football colors");        
        if (help)
          radio.setHelp("Select the colors of the best (college) football team.");
        if (error)
          radio.addError("Error, Maroon & White is the only acceptable answer.");
        radio.addOption("ut","Burnt Orange & White");
        radio.addOption(true,"tamu","Maroon & White");
        radio.addOption("ttu","Tech Red & Black");
        radio.addOption("baylor","Green & Gold");
        radio.addOption("rice","Blue & Gray");
        radio.addOption("uh","Scarlet Red & Albino White");
       
        // File
        File file = list.addItem().addFile("file");
        file.setLabel("File");
        if (help)
          file.setHelp("Upload a file.");
        if (error)
          file.addError("This field is in error.");
       
        // Select (single)
        Select select = list.addItem().addSelect("select");
        select.setLabel("Select (single)");
        if (help)
          select.setHelp("Select one of the options");
        if (error)
          select.addError("This field is in error.");
        select.addOption("one","uno");
        select.addOption("two","dos");
        select.addOption("three","tres");
        select.addOption("four","cuatro");
        select.addOption("five","cinco");
        select.setOptionSelected("one");

        select = list.addItem().addSelect("multi-select");
        select.setLabel("Select (multiple)");
        select.setMultiple();
        select.setSize(4);
        if (help)
          select.setHelp("Select one or more options");
        if (error)
          select.addError("This field is in error.");
        select.addOption("one","uno");
        select.addOption("two","dos");
        select.addOption("three","tres");
        select.addOption("four","cuatro");
        select.addOption("five","cinco");
        select.setOptionSelected("one");
        select.setOptionSelected("three");
        select.setOptionSelected("five");
       
        // Non-Field-item
        list.addLabel("Non-Field");
        list.addItem().addContent("This is just text, not a field, but it has a list label.");
       
        // Button
        Button button = list.addItem().addButton("button");
        button.setLabel("Button");
        button.setValue("When you touch me I do things, lots of things");
        if (help)
          button.setHelp("Submit buttons allow the user to submit the form.");
        if (error)
          button.addError("This button is in error.");
       
        // Non-field-unlabeled-item
        list.addItem().addContent("The following fields are all various use cases of composites. Also note that this item is an item inside a list of type form that 1) does not contain a field and 2) does not have a label.");
       
        // Composite
        Composite composite = list.addItem().addComposite("composite-2text");
        composite.setLabel("Composite (two text fields)");
        if (help)
          composite.setHelp("I am the help for the entire composite");
        if (error)
          composite.addError("Just the composite is in error");
        text = composite.addText("partA");
        text.setLabel("Part A");
        text.setValue("Value for part A");
        if (help)
          text.setHelp("Part A");
        text = composite.addText("partB");
        text.setLabel("Part B");
        text.setValue("Value for part B");
        if (help)
          text.setHelp("Part B");
       
        // composite select & text fields 
        composite = list.addItem().addComposite("compositeB");
        composite.setLabel("Composite (select & text fields)");
        if (help)
          composite.setHelp("This field is composed of a select and text field, select one and type the other.");
 
        select = composite.addSelect("selectB");
        select.setLabel("Numbers");
        if (help)
          select.setHelp("Me, me, me..... select me!");
        if (error)
          select.addError("The composite components are in error.");
        select.addOption("one","uno");
        select.addOption("two","dos");
        select.addOption("three","tres");
        select.addOption("four","cuatro");
        select.addOption("five","cinco");
        select.setOptionSelected("one");
       
        text = composite.addText("TextB");
        text.setLabel("Spanish Numbers");
        if (help)
          text.setHelp("Yay, yet another text field");
        if (error)
          text.addError("The composite components are in error.");
       
       
        // Composite
        composite = list.addItem().addComposite("composite-date");
        composite.setLabel("Composite (date)");
        if (help)
          composite.setHelp("The data the item was published.");
        if (error)
          composite.addError("The date is in error.");
       
        text = composite.addText("year");
        text.setLabel("Year");
        text.setSize(4,4);
        if (help)
          text.setHelp("year");
        if (error)
          text.addError("The year is in error");
       
       
        select = composite.addSelect("month");
        select.setLabel("Month");
        if (error)
          select.addError("The month is in error");
        if (help)
          text.setHelp("month");
        select.addOption("","(Select Month)");
        select.addOption(1,"January");
        select.addOption(2,"Feburary");
        select.addOption(3,"March");
        select.addOption(4,"April");
        select.addOption(5,"May");
        select.addOption(6,"June");
        select.addOption(7,"July");
        select.addOption(8,"August");
        select.addOption(9,"September");
        select.addOption(10,"August");
        select.addOption(11,"October");
        select.addOption(12,"November");
        select.addOption(13,"December");
       
        text = composite.addText("day");
        text.setLabel("Day");
        if (help)
          text.setHelp("day");
        if (error)
          text.addError("The day is in error.");
        text.setSize(4,2);
       
        // Buttons one typical finds at the end of forums
        Item actions = list.addItem();
        actions.addButton("submit_save").setValue("Save");
        actions.addButton("submit_cancel").setValue("Cancel");
       
       
       
       
        /////////////////////////////////////////////////
        /// Multi section
        ////////////////////////////////////////////////
       
        div.addPara("This next test will use form sections. Sections are logical groupings of related fields that together form the entire set.");
       
        list = div.addList("sectionTest",List.TYPE_FORM);
        list.setHead("Multi-Section form");
        List identity = list.addList("identity",List.TYPE_FORM);
        identity.setHead("Identity");
       
        Text name = identity.addItem().addText("name");
        name.setLabel("Username");
        if (help)
          name.setHelp("The username you wish to chooose");
        if (error)
          name.addError("Sorry, that username is allready used by another user.");
       
        Composite ssn = identity.addItem().addComposite("ssn");
        ssn.setLabel("SSN");
        if (help)
          ssn.setHelp("Your Social Security Number, really we won't use it for anything bad.... you can trust me.");
        if (error)
          ssn.addError("The SSN you entered is invalid.");
        Text ssn1 = ssn.addText("ssn1");
        ssn1.setSize(4,4);
        Text ssn2 = ssn.addText("ssn2");
        ssn2.setSize(2,2);
        Text ssn3 = ssn.addText("ssn3");
        ssn3.setSize(4,4);
       
        List intrests = list.addList("intrests",List.TYPE_FORM);
        intrests.setHead("Intrests");
       
        CheckBox intrest = intrests.addItem().addCheckBox("intrests");
        intrest.setLabel("Intrests");
        if (help)
          intrest.setHelp("Select all topics which are of intrests to you.");
        if (error)
          intrest.addError("You're intrests are in error?");
        intrest.addOption("DL","Digital Libraries");
        intrest.addOption("HT","Hypertexts");
        intrest.addOption("IM","Information Managment");
        intrest.addOption("ID","Information Discovery");
        intrest.addOption("SI","Social Impact");
       
        List affiliation = list.addList("affiliation",List.TYPE_FORM);
        affiliation.setHead("Affiliation");
       
        Text institution = affiliation.addItem().addText("institution");
View Full Code Here

           
            Message state = getWorkflowStateMessage(owned);

            Row row = table.addRow();
           
            CheckBox remove = row.addCell().addCheckBox("workflowID");
            remove.setLabel("selected");
            remove.addOption(workflowItemID);
           
            // The task description
            row.addCell().addXref(url,state);

            // The item description
            if (titles != null && titles.length > 0)
            {
              String displayTitle = titles[0].value;
              if (displayTitle.length() > 50)
                displayTitle = displayTitle.substring(0,50)+ " ...";
              row.addCell().addXref(url,displayTitle);
            }
            else
              row.addCell().addXref(url,T_untitled);

            // Submitted too
            row.addCell().addXref(url,collectionName);

            // Submitted by
            Cell cell = row.addCell();
            cell.addContent(T_email);
            cell.addXref("mailto:"+submitterEmail,submitterName);
          }
         
          Row row = table.addRow();
         row.addCell(0,5).addButton("submit_return_tasks").setValue(T_w_submit_return);
         
        }
        else
        {
          Row row = table.addRow();
          row.addCell(0,5).addHighlight("italic").addContent(T_w_info2);
        }
      
       
       
       
        // Tasks in the pool
        table = workflow.addTable("workflow-tasks",pooledItems.size()+2,5);
        table.setHead(T_w_head3);
       
        header = table.addRow(Row.ROLE_HEADER);
        header.addCellContent(T_w_column1);
        header.addCellContent(T_w_column2);
        header.addCellContent(T_w_column3);
        header.addCellContent(T_w_column4);
        header.addCellContent(T_w_column5);
       
        if (pooledItems.size() > 0)
        {

          for (WorkflowItem pooled : pooledItems)
          {
            int workflowItemID = pooled.getID();
            String url = contextPath+"/handle/"+pooled.getCollection().getHandle()+"/workflow?workflowID="+workflowItemID;
            DCValue[] titles = pooled.getItem().getDC("title", null, Item.ANY);
            String collectionName = pooled.getCollection().getMetadata("name");
            EPerson submitter = pooled.getSubmitter();
            String submitterName = submitter.getFullName();
            String submitterEmail = submitter.getEmail();

            Message state = getWorkflowStateMessage(pooled);
           
           
            Row row = table.addRow();
           
            CheckBox remove = row.addCell().addCheckBox("workflowID");
            remove.setLabel("selected");
            remove.addOption(workflowItemID);
           
            // The task description
            row.addCell().addXref(url,state);

            // The item description
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.wing.element.CheckBox

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.