當前位置: 首頁>>代碼示例>>Java>>正文


Java ListItem.add方法代碼示例

本文整理匯總了Java中org.apache.wicket.markup.html.list.ListItem.add方法的典型用法代碼示例。如果您正苦於以下問題:Java ListItem.add方法的具體用法?Java ListItem.add怎麽用?Java ListItem.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.wicket.markup.html.list.ListItem的用法示例。


在下文中一共展示了ListItem.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: DocumentationIndexPage

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
public DocumentationIndexPage() {
	Harvester harvester = new Harvester();
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	ListView listview = new ListView("listview", harvester.getWorkspaces()) {
	    /**
		 * 
		 */
		private static final long serialVersionUID = 2974513833506276491L;

		protected void populateItem(ListItem item) {
	    	WorkspaceDoc wi = (WorkspaceDoc) item.getModelObject();
			BookmarkablePageLink link = new BookmarkablePageLink("link", WorkspacePage.class);
			link.setParameter("workspaceName", wi.getName());
			link.add(new Label("workspaceName", wi.getName()));
	        item.add(link);
	    }
	};
	add(listview);

	ExtensionInfo info = new ExtensionInfo();
	add(new Label("documentorVersion", info.getVersion()));
	add(new Label("documentorGitVersion", info.getGitVersion()));
	add(new Label("readme", info.getReadme()));
}
 
開發者ID:geops,項目名稱:geoserver-documentor,代碼行數:26,代碼來源:DocumentationIndexPage.java

示例2: populateNode

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private void populateNode() throws ExternalServiceException, IOException, RemoteException {
    ListView<NodeDto> list = new ListView<NodeDto>("nodeList", this.model) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<NodeDto> item) {
            NodeDto node = item.getModelObject();
            BookmarkablePageLink<Void> link = NodePageUtil.createNodeLink("nodeLink", node);
            item.add(link);
        }
    };
    add(list);
    WebMarkupContainer container = new WebMarkupContainer("nodeBlock");
    add(container);
    container.setVisible(this.model.isVisible());
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:17,代碼來源:LocationViewPage.java

示例3: initCounters

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private void initCounters() {
   	
   	ListView<InternalCounters> countersTable = new ListView<InternalCounters>(ID_COUNTERS_TABLE, Arrays.asList(InternalCounters.values())) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void populateItem(ListItem<InternalCounters> item) {
			InternalCounters counter = item.getModelObject();
			Label label = new Label(ID_COUNTER_LABEL, createStringResource("InternalCounters."+counter.getKey()));
			item.add(label);
	    	
	    	Label valueLabel = new Label(ID_COUNTER_VALUE, new AbstractReadOnlyModel<String>() {
				private static final long serialVersionUID = 1L;

				@Override
				public String getObject() {
					long val = InternalMonitor.getCount(counter);
					return Long.toString(val);
				}
			});
	    	item.add(valueLabel);
		}
   		
   	};
   	add(countersTable);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:27,代碼來源:PageInternals.java

示例4: initLayout

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private void initLayout() {
    setOutputMarkupId(true);
    ListView<PrismObject<R>> list = new ListView<PrismObject<R>>(ID_LIST, availableRoles) {
        @Override
        protected void populateItem(ListItem<PrismObject<R>> item) {
            item.add(createRoleLink(ID_ITEM, item.getModel()));
        }
    };
    list.setOutputMarkupId(true);
    add(list);

    AjaxLink<String> buttonReset = new AjaxLink<String>(ID_BUTTON_RESET) {
        @Override
        public void onClick(AjaxRequestTarget target) {
            reset();
            target.add(SimpleRoleSelector.this);
        }
    };
    buttonReset.setBody(createStringResource("SimpleRoleSelector.reset"));
    add(buttonReset);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:22,代碼來源:SimpleRoleSelector.java

示例5: addOrReplaceProperties

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private void addOrReplaceProperties(IModel<ContainerWrapper> model, final Form form, boolean isToBeReplaced){
     ListView<ItemWrapper> properties = new ListView<ItemWrapper>("properties",
             new PropertyModel(model, "properties")) {
private static final long serialVersionUID = 1L;

@Override
         protected void populateItem(final ListItem<ItemWrapper> item) {
             item.add(new PrismPropertyPanel("property", item.getModel(), form, pageBase));
             item.add(new VisibleEnableBehaviour() {
             	private static final long serialVersionUID = 1L;
             	
             	@Override
             	public boolean isVisible() {
             		return item.getModel().getObject().isVisible();
             	}
             });
             item.add(AttributeModifier.append("class", createStyleClassModel(item.getModel())));
         }
     };
     properties.setReuseItems(true);
     if (isToBeReplaced) {
         replace(properties);
     } else {
         add(properties);
     }
 }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:27,代碼來源:PrismContainerPanel.java

示例6: initLayout

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private void initLayout() {
	Label titleLabel = new Label(ID_TITLE, new PropertyModel<>(getModel(), InformationType.F_TITLE.getLocalPart()));
	titleLabel.add(new VisibleBehaviour(() -> getModelObject().getTitle() != null));
	add(titleLabel);

	ListView<InformationPartType> list = new ListView<InformationPartType>(ID_PARTS,
			new PropertyModel<>(getModel(), InformationType.F_PART.getLocalPart())) {
		@Override
		protected void populateItem(ListItem<InformationPartType> item) {
			InformationPartType part = item.getModelObject();
			Label label = new Label(ID_PART, part.getText());
			if (Boolean.TRUE.equals(part.isHasMarkup())) {
				label.setEscapeModelStrings(false);
			}
			item.add(label);
		}
	};
	add(list);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:20,代碼來源:InformationPanel.java

示例7: addOtherTopicMapsSection

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private void addOtherTopicMapsSection() {
  // Alt. 2 Make a loadabledetachableModel for repository
  IModel<List<TopicMapReference>> eachNonOntopolyTopicMapModel = new LoadableDetachableModel<List<TopicMapReference>>() {
    @Override
    protected List<TopicMapReference> load() {
      OntopolyRepository repository = OntopolyContext.getOntopolyRepository();
      return repository.getNonOntopolyTopicMaps();
    }
  }; 

  ListView<TopicMapReference> eachTopicMap = new ListView<TopicMapReference>("eachNonOntopolyTopicMap", eachNonOntopolyTopicMapModel) {
    @Override
    protected void populateItem(ListItem<TopicMapReference> item) {
      final TopicMapReference ref = item.getModelObject();
      Map<String,String> pageParameterMap = new HashMap<String,String>();
      pageParameterMap.put("topicMapId",ref.getId());
      
      OntopolyBookmarkablePageLink link = new OntopolyBookmarkablePageLink(
          "nonOntTMLink", ConvertPage.class, new PageParameters(pageParameterMap), ref.getName());
      item.add(link);
    }
  };
  add(eachTopicMap);
}
 
開發者ID:ontopia,項目名稱:ontopia,代碼行數:25,代碼來源:StartPage.java

示例8: FunctionBoxesPanel

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
public FunctionBoxesPanel(String id) {
  super(id);
  
  Form<Object> form = new Form<Object>("functionBoxesForm");
  add(form);
  
  List<Component> list = getFunctionBoxesList("functionBox"); 
  ListView<Component> functionBoxes = new ListView<Component>("functionBoxesList", list) {
    @Override
    protected void populateItem(ListItem<Component> item) {
      item.add(item.getModelObject());
    }
  };
  functionBoxes.setVisible(!list.isEmpty());
  form.add(functionBoxes);
}
 
開發者ID:ontopia,項目名稱:ontopia,代碼行數:17,代碼來源:FunctionBoxesPanel.java

示例9: makeListView

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
/**
 * Helper to create a listview for what needs to be shown
 * 
 * @param markupId wicket markup id
 * @param itemList ist of stuff
 * @return
 */
private ListView<ProcessedGradeItem> makeListView(final String markupId, final List<ProcessedGradeItem> itemList) {

	final ListView<ProcessedGradeItem> rval = new ListView<ProcessedGradeItem>(markupId, itemList) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void populateItem(final ListItem<ProcessedGradeItem> item) {

			final ProcessedGradeItem gradeItem = item.getModelObject();

			String displayTitle = gradeItem.getItemTitle();
			if (gradeItem.getType() == Type.COMMENT) {
				displayTitle = MessageHelper.getString("importExport.confirmation.commentsdisplay", gradeItem.getItemTitle());
			}

			item.add(new Label("title", displayTitle));
			item.add(new Label("points", gradeItem.getItemPointValue()));
		}
	};

	return rval;
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:30,代碼來源:GradeImportConfirmationStep.java

示例10: populateItem

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
@Override
protected void populateItem(final ListItem<T> item) {
    super.populateItem(item);
    item.add(new AjaxEventBehavior("ondblclick") {
        @SuppressWarnings({"unchecked"})
        @Override
        protected void onEvent(AjaxRequestTarget target) {
            ModalHandler modalHandler = ModalHandler.getInstanceFor(RepoListPanel.this);
            T itemObject = (T) item.getDefaultModelObject();
            modalHandler.setModalPanel(newUpdateItemPanel(itemObject));
            modalHandler.show(target);
        }

        @Override
        protected IAjaxCallDecorator getAjaxCallDecorator() {
            return new CancelDefaultDecorator();
        }
    });
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:20,代碼來源:RepositoryConfigPage.java

示例11: populateItem

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
@Override
protected void populateItem(ListItem<Person> item) {
  Person person = item.getModelObject();
  item.add(new Label("firstname", person.getFirstName()));
  item.add(new Label("lastname", person.getLastName()));
  item.add(new Label("jobtitle", person.getJobTitle()));
}
 
開發者ID:sparsick,項目名稱:ansible-docker-talk,代碼行數:8,代碼來源:PersonListView.java

示例12: populateItem

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
@Override
protected void populateItem(ListItem<ChampionMasteryItem> item) {
    ChampionMasteryItem mastery = item.getModelObject();
    ChampionStatisticItem championStatistic = null;
    // create boolean to storing whether or not element should be shown
    // set to false if mastery or championStatistic is null
    boolean visible = true;
    // check if mastery is null

    if (mastery != null) {
        championStatistic = PageDataProvider.getChampionStatisticById(mastery.getChampionId());
    } else {
        // if mastery is null create a new one and fill it with default data
        mastery = new ChampionMasteryItem();
        mastery.setChampionPoints(42);
        mastery.setChampionLevel(1);
        visible = false;
    }
    if (championStatistic == null) {
        // if champion statistic is null use default champion for statistic
        championStatistic = PageDataProvider.championStatisticMap.get("bard");
        visible = false;
    }

    // create link to champion page
    PageParameters linkParameters = new PageParameters();
    linkParameters.set(0, championStatistic.getKeyName());
    BookmarkablePageLink<String> link = new BookmarkablePageLink<>("champion_link",
            SingleChampionPage.class, linkParameters);
    item.add(link);

    // add champion portrait, name and mastery score as well as champion level
    link.add(new ExternalImage("champion_portrait", championStatistic.getPortraitUrl()));
    link.add(new Label("champion_name", championStatistic.getChampionName()));
    link.add(new Label("champion_stats", String.format("%s - Level %d", NumberFormatter.formatLong(
            mastery.getChampionPoints()), mastery.getChampionLevel())));

    // hide link if necessary
    link.setVisible(visible);
}
 
開發者ID:LogicalOverflow,項目名稱:MasterStats,代碼行數:41,代碼來源:SingleSummonerPage.java

示例13: initMenuItem

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private void initMenuItem(ListItem<InlineMenuItem> menuItem) {
    final InlineMenuItem item = menuItem.getModelObject();

    WebMarkupContainer menuItemBody = new MenuLinkPanel(ID_MENU_ITEM_BODY, menuItem.getModel());
    menuItemBody.setRenderBodyOnly(true);
    menuItem.add(menuItemBody);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:8,代碼來源:DropdownButtonPanel.java

示例14: getPanels

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
public ListView<MyPasswordQuestionsPanel> getPanels(List<MyPasswordQuestionsPanel> p) {
	ListView lw = new ListView(ID_PASSWORD_QUESTIONS_PANEL, p) {
		private static final long serialVersionUID = 1L;
		
		@Override
		protected void populateItem(ListItem item) {

			item.add((MyPasswordQuestionsPanel) item.getModelObject());
		}
	};
	return lw;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:13,代碼來源:PageSecurityQuestions.java

示例15: initLayout

import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
protected void initLayout(boolean ignoreMandatoryAttributes) {
    Label attributeLabel = new Label(ID_ATTRIBUTE_LABEL, new PropertyModel(getModel(), ACAttributeDto.F_NAME));
    add(attributeLabel);

    WebMarkupContainer required = new WebMarkupContainer(ID_REQUIRED);
    required.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            ACAttributeDto dto = getModel().getObject();
            PrismPropertyDefinition def = dto.getDefinition();

            return def.isMandatory();
        }
    });
    add(required);

    WebMarkupContainer hasOutbound = new WebMarkupContainer(ID_HAS_OUTBOUND);
    hasOutbound.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return hasOutbound();
        }
    });
    add(hasOutbound);


    ListView<ACValueConstructionDto> values = new ListView<ACValueConstructionDto>(ID_VALUES,
            new PropertyModel<List<ACValueConstructionDto>>(getModel(), ACAttributeDto.F_VALUES)) {

        @Override
        protected void populateItem(ListItem<ACValueConstructionDto> listItem) {
            Form form = findParent(Form.class);
            listItem.add(new ACAttributeValuePanel(ID_VALUE, listItem.getModel(), ignoreMandatoryAttributes, form));
        }
    };
    add(values);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:40,代碼來源:ACAttributePanel.java


注:本文中的org.apache.wicket.markup.html.list.ListItem.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。