org.apache.wicket.markup.repeater.RepeatingView Java Examples

The following examples show how to use org.apache.wicket.markup.repeater.RepeatingView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SchemaPageHeader.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
public SchemaPageHeader(String id, IModel<OClass> oClassModel) {
	super(id, oClassModel);
	add(new BookmarkablePageLink<Object>("schema", SchemaPage.class)
					.setBody(new ResourceModel("menu.list.schema")));
	
	add(new ListView<OClass>("classes", classPathModel) {

		@Override
		protected void populateItem(ListItem<OClass> item) {
			item.add(new OClassPageLink("link", item.getModel()).setClassNameAsBody(false));
		}
	});
	childRepeatingView = new RepeatingView("child");
	add(childRepeatingView);
	add(UpdateOnActionPerformedEventBehavior.INSTANCE_ALWAYS_FOR_CHANGING);
	add(new DefaultPageHeaderMenu("menu"));
}
 
Example #2
Source File: BeanEditor.java    From onedev with MIT License 6 votes vote down vote up
public ComponentContext newComponentContext() {
	return new ComponentContext(this) {

		@Override
		public ComponentContext getChildContext(String childName) {
			for (Component groupContainer: groupsView) {
				RepeatingView propertiesView = (RepeatingView) groupContainer.get("content").get("properties");
				for (Component item: propertiesView) {
					@SuppressWarnings("unchecked")
					PropertyContext<Serializable> propertyContext = (PropertyContext<Serializable>) item.getDefaultModelObject(); 
					if (propertyContext.getPropertyName().equals(childName))
						return new ComponentContext(item);
				}
			}
			return null;
		}
		
	};
}
 
Example #3
Source File: IssueActivitiesPanel.java    From onedev with MIT License 6 votes vote down vote up
@Override
protected void onBeforeRender() {
	activitiesView = new RepeatingView("activities");
	addOrReplace(activitiesView);
	Issue issue = getIssue();

	for (IssueActivity activity: getActivities()) {
		if (issue.isVisitedAfter(activity.getDate())) {
			activitiesView.add(newActivityRow(activitiesView.newChildId(), activity));
		} else {
			Component row = newActivityRow(activitiesView.newChildId(), activity);
			row.add(AttributeAppender.append("class", "new"));
			activitiesView.add(row);
		}
	}		
	
	super.onBeforeRender();
}
 
Example #4
Source File: EmailsPanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @see org.apache.wicket.Component#onInitialize()
 */
@Override
protected void onInitialize()
{
  super.onInitialize();
  if (emails == null) {
    emails = new ArrayList<EmailValue>();
  }
  newEmailValue = new EmailValue().setEmail(DEFAULT_EMAIL_VALUE).setContactType(ContactType.PRIVATE);
  emailChoiceRenderer = new LabelValueChoiceRenderer<ContactType>(this, ContactType.values());
  mainContainer = new WebMarkupContainer("main");
  add(mainContainer.setOutputMarkupId(true));
  emailsRepeater = new RepeatingView("liRepeater");
  mainContainer.add(emailsRepeater);

  rebuildEmails();
  addNewEMailContainer = new WebMarkupContainer("liAddNewEmail");
  mainContainer.add(addNewEMailContainer);

  init(addNewEMailContainer);
  emailsRepeater.setVisible(true);
}
 
Example #5
Source File: BeanListPropertyEditor.java    From onedev with MIT License 6 votes vote down vote up
@SuppressWarnings("unchecked")
private List<PropertyEditor<Serializable>> getPropertyEditorsAtRow(int index) {
	int currentIndex = 0;
	Iterator<Component> it = rows.iterator();
	Component row = it.next();
	while (currentIndex++ < index) {
		row = it.next();
	}
	
	List<PropertyEditor<Serializable>> propertyEditors = new ArrayList<>();
	RepeatingView columns = (RepeatingView) row.get("properties");
	for (Component column: columns) {
		propertyEditors.add((PropertyEditor<Serializable>) column.get("propertyEditor"));
	}
	
	return propertyEditors;
}
 
Example #6
Source File: TeamAttendeesPanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @see org.apache.wicket.Component#onInitialize()
 */
@Override
protected void onInitialize()
{
  super.onInitialize();
  statusChoiceRenderer = new LabelValueChoiceRenderer<TeamAttendeeStatus>(this, TeamAttendeeStatus.values());
  mainContainer = new WebMarkupContainer("main");
  add(mainContainer.setOutputMarkupId(true));
  attendeesRepeater = new RepeatingView("liRepeater");
  mainContainer.add(attendeesRepeater);
  rebuildAttendees();
  final WebMarkupContainer item = new WebMarkupContainer("liAddNewAttendee");
  mainContainer.add(item);
  item.add(new AttendeeEditableLabel("editableLabel", Model.of(new TeamEventAttendeeDO()), true));
  item.add(new Label("status", "invisible").setVisible(false));
  attendeesRepeater.setVisible(true);
}
 
Example #7
Source File: DefaultTreeTablePanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
private WebMarkupContainer createTreeRow(final T node)
{
  final WebMarkupContainer row = new WebMarkupContainer(rowRepeater.newChildId(), new Model<TreeTableNode>(node));
  row.setOutputMarkupId(true);
  row.add(AttributeModifier.replace("class", "even"));
  if (clickRows == true) {
    WicketUtils.addRowClick(row);
  }
  rowRepeater.add(row);
  final RepeatingView colBodyRepeater = new RepeatingView("cols");
  row.add(colBodyRepeater);
  final String cssStyle = getCssStyle(node);

  // Column: browse icons
  final TreeIconsActionPanel< ? extends TreeTableNode> treeIconsActionPanel = createTreeIconsActionPanel(node);
  addColumn(row, treeIconsActionPanel, cssStyle);
  treeIconsActionPanel.init(this, node);
  treeIconsActionPanel.add(AttributeModifier.append("style", new Model<String>("white-space: nowrap;")));

  addColumns(colBodyRepeater, cssStyle, node);
  return row;
}
 
Example #8
Source File: DatevImportStoragePanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @see org.projectforge.web.core.importstorage.AbstractImportStoragePanel#addHeadColumns(org.apache.wicket.markup.repeater.RepeatingView)
 */
@Override
protected void addHeadColumns(final RepeatingView headColRepeater)
{
  if (getStorageType() == DatevImportDao.Type.KONTENPLAN) {
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.konto.nummer")));
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.konto.bezeichnung")));
  } else {
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.buchungssatz.satznr")));
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("date")));
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.common.betrag")));
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.buchungssatz.text")));
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.buchungssatz.konto")));
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.buchungssatz.gegenKonto")));
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.kost1")));
    headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.kost2")));
  }
}
 
Example #9
Source File: PaymentSchedulePanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @see org.apache.wicket.Component#onInitialize()
 */
@Override
protected void onInitialize()
{
  super.onInitialize();
  mainContainer = new WebMarkupContainer("main");
  add(mainContainer.setOutputMarkupId(true));
  mainContainer.add(new Label("dateLabel", getString("fibu.rechnung.datum.short")));
  mainContainer.add(new Label("amountLabel", getString("fibu.common.betrag")));
  mainContainer.add(new Label("commentLabel", getString("comment")));
  mainContainer.add(new Label("reachedLabel", getString("fibu.common.reached")));
  entrysRepeater = new RepeatingView("liRepeater");
  mainContainer.add(entrysRepeater);
  rebuildEntries();
  entrysRepeater.setVisible(true);
}
 
Example #10
Source File: RechnungCostEditTablePanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @param id
 */
@SuppressWarnings("serial")
public RechnungCostEditTablePanel(final String id)
{
  super(id);
  feedbackPanel = new FeedbackPanel("feedback");
  ajaxComponents.register(feedbackPanel);
  add(feedbackPanel);
  this.form = new Form<AbstractRechnungsPositionDO>("form") {
    @Override
    protected void onSubmit()
    {
      super.onSubmit();
      csrfTokenHandler.onSubmit();
    }
  };
  add(form);
  csrfTokenHandler = new CsrfTokenHandler(form);
  rows = new RepeatingView("rows");
  form.add(rows);
}
 
Example #11
Source File: AbstractMobileViewPage.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
protected AbstractMobileViewPage(final PageParameters parameters)
{
  super(parameters);
  final Integer id = WicketUtils.getAsInteger(parameters, AbstractEditPage.PARAMETER_KEY_ID);
  data = null;
  if (NumberHelper.greaterZero(id) == true) {
    data = getBaseDao().getById(id);
  }
  if (data == null) {
    // Create empty address for avoiding NPE...
    data = getBaseDao().newInstance();
    getLogger().error("Oups, no object id given. Can't display object.");
    setResponsePage(getListPageClass());
    return;
  }
  final RepeatingView flowfields = new RepeatingView("flowfields");
  pageContainer.add(flowfields);
  gridBuilder = new MobileGridBuilder(flowfields);
}
 
Example #12
Source File: GanttChartEditTreeTablePanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void initializeColumnHeads()
{
  int col = 0;
  colHeadRepeater = new RepeatingView("cols");
  treeTableHead.add(colHeadRepeater);
  colHeadRepeater.add(createColHead("task"));
  colHeadRepeater.add(createEmtpyColumnHead(16)); // Column for edit icon.
  colHeadRepeater.add(SingleImagePanel
      .createTooltipImage(colHeadRepeater.newChildId(), WebConstants.IMAGE_EYE, getString("gantt.tooltip.isVisible"))
      .add(AttributeModifier.replace("style", "width: 16px;")).setRenderBodyOnly(false));
  addColumnHead(col++, "title");
  addColumnHead(col++, "gantt.startDate");
  addColumnHead(col++, "gantt.duration");
  addColumnHead(col++, "gantt.endDate");
  addColumnHead(col++, "task.progress");
  addColumnHead(col++, "gantt.predecessor");
  addColumnHead(col++, "gantt.predecessorOffset");
  addColumnHead(col++, "gantt.relationType.short");
  addColumnHead(col++, "gantt.objectType.short");
}
 
Example #13
Source File: PhonesPanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @see org.apache.wicket.Component#onInitialize()
 */
@Override
protected void onInitialize()
{
  super.onInitialize();

  if (phones == null) {
    phones = new ArrayList<PhoneValue>();
  }
  newPhoneValue = new PhoneValue().setNumber(DEFAULT_PHONE_VALUE).setPhoneType(PhoneType.PRIVATE);
  phoneChoiceRenderer = new LabelValueChoiceRenderer<PhoneType>(this, PhoneType.values());
  mainContainer = new WebMarkupContainer("main");
  add(mainContainer.setOutputMarkupId(true));
  phonesRepeater = new RepeatingView("liRepeater");
  mainContainer.add(phonesRepeater);

  rebuildPhones();
  addNewPhoneContainer = new WebMarkupContainer("liAddNewPhone");
  mainContainer.add(addNewPhoneContainer);

  init(addNewPhoneContainer);
  phonesRepeater.setVisible(true);
}
 
Example #14
Source File: AbstractSecuredPage.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @see org.apache.wicket.Component#onInitialize()
 */
@Override
protected void onInitialize()
{
  super.onInitialize();
  final WebMarkupContainer breadcrumbContainer = new WebMarkupContainer("breadcrumb");
  body.add(breadcrumbContainer);
  breadcrumbContainer.add(contentMenuBarPanel);
  if (isBreadCrumbVisible() == true) {
    final RepeatingView breadcrumbItems = new RepeatingView("li");
    breadcrumbContainer.add(breadcrumbItems);
    final WebPage returnTo = this.getReturnToPage();
    if (returnTo != null && returnTo instanceof AbstractSecuredPage) {
      addBreadCrumbs(breadcrumbItems, (AbstractSecuredPage) returnTo);
    } else {
      breadcrumbItems.setVisible(false);
    }
    breadcrumbContainer.add(new Label("active", getTitle()));
  } else {
    breadcrumbContainer.setVisible(false);
  }
}
 
Example #15
Source File: AbstractSecuredPage.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
@SuppressWarnings("serial")
private void addBreadCrumbs(final RepeatingView breadcrumbItems, final AbstractSecuredPage page)
{
  final WebPage returnTo = page.getReturnToPage();
  if (returnTo != null && returnTo instanceof AbstractSecuredPage) {
    addBreadCrumbs(breadcrumbItems, (AbstractSecuredPage) returnTo);
  }
  final WebMarkupContainer li = new WebMarkupContainer(breadcrumbItems.newChildId());
  breadcrumbItems.add(li);
  final Link<Void> pageLink = new Link<Void>("link") {

    @Override
    public void onClick()
    {
      setResponsePage(page);
    }
  };
  li.add(pageLink);
  pageLink.add(new Label("label", page.getTitle()));
}
 
Example #16
Source File: JiraIssuesPanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
public JiraIssuesPanel(final String id, final IModel<String> model)
{
  super(id);
  setRenderBodyOnly(true);
  if (WicketUtils.isJIRAConfigured() == false) {
    final WebMarkupContainer dummy = new WebMarkupContainer("issues");
    setVisible(false);
    dummy.add(new ExternalLink("jiraLink", "dummy"));
    add(dummy);
    return;
  }
  final RepeatingView jiraIssuesRepeater = new RepeatingView("issues");
  add(jiraIssuesRepeater);
  final String[] jiraIssues = JiraUtils.checkForJiraIssues(model.getObject());
  if (jiraIssues == null) {
    jiraIssuesRepeater.setVisible(false);
  } else {
    for (final String issue : jiraIssues) {
      final WebMarkupContainer item = new WebMarkupContainer(jiraIssuesRepeater.newChildId());
      item.setRenderBodyOnly(true);
      jiraIssuesRepeater.add(item);
      item.add(new ExternalLink("jiraLink", JiraUtils.buildJiraIssueBrowseLinkUrl(issue), issue));
    }
  }
}
 
Example #17
Source File: AccordionPanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
public AccordionPanel(final String id)
{
  super(id);
  add(this.ul = new WebMarkupContainer("ul"));
  this.ul.add(AttributeModifier.append("class", "no_rearrange"));
  ul.add(liRepeater = new RepeatingView("li"));
}
 
Example #18
Source File: AbstractImportStoragePanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
protected Component addCell(final RepeatingView cellRepeater, final Integer value, final String style)
{
  if (value == null) {
    return addCell(cellRepeater, "", style);
  } else {
    return addCell(cellRepeater, String.valueOf(value), style);
  }
}
 
Example #19
Source File: DivPanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @param id
 */
public DivPanel(final String id)
{
  super(id);
  div = new WebMarkupContainer("div");
  super.add(div);
  repeater = new RepeatingView("child");
  div.add(repeater);
}
 
Example #20
Source File: ButtonGroupPanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
public ButtonGroupPanel(final String id)
{
  super(id);
  container = new WebMarkupContainer("container");
  add(container);
  repeater = new RepeatingView("repeater");
  container.add(repeater);
}
 
Example #21
Source File: CollapsiblePanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
public CollapsiblePanel(final String id, final String heading)
{
  super(id);
  mainContainer = new WebMarkupContainer("mainContainer");
  super.add(mainContainer);
  if (heading != null) {
    headingLabel = new Label("heading", heading);
  }
  repeater = new RepeatingView("contentRepeater");
  mainContainer.add(repeater);
}
 
Example #22
Source File: AccessEditTablePanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
private void addAccessRow(final RepeatingView rowRepeater, final AccessEntryDO accessEntry)
{
  final WebMarkupContainer row = new WebMarkupContainer(rowRepeater.newChildId());
  rowRepeater.add(row);
  row.add(new Label("area", getString(accessEntry.getAccessType().getI18nKey())));
  final ButtonGroupPanel groupPanel = new ButtonGroupPanel("checkboxes").setToggleButtons();
  row.add(groupPanel);
  groupPanel.addButton(new CheckBoxButton(groupPanel.newChildId(), new PropertyModel<Boolean>(accessEntry, "accessSelect"), getString("access.type.select")));
  groupPanel.addButton(new CheckBoxButton(groupPanel.newChildId(), new PropertyModel<Boolean>(accessEntry, "accessInsert"), getString("access.type.insert")));
  groupPanel.addButton(new CheckBoxButton(groupPanel.newChildId(), new PropertyModel<Boolean>(accessEntry, "accessUpdate"), getString("access.type.update")));
  groupPanel.addButton(new CheckBoxButton(groupPanel.newChildId(), new PropertyModel<Boolean>(accessEntry, "accessDelete"), getString("access.type.delete")));
}
 
Example #23
Source File: AccessEditTablePanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
public AccessEditTablePanel init()
{
  final RepeatingView rowRepeater = new RepeatingView("accessRows");
  add(rowRepeater);
  addAccessRow(rowRepeater, data.ensureAndGetAccessEntry(AccessType.TASK_ACCESS_MANAGEMENT));
  addAccessRow(rowRepeater, data.ensureAndGetAccessEntry(AccessType.TASKS));
  addAccessRow(rowRepeater, data.ensureAndGetAccessEntry(AccessType.TIMESHEETS));
  addAccessRow(rowRepeater, data.ensureAndGetAccessEntry(AccessType.OWN_TIMESHEETS));
  return this;
}
 
Example #24
Source File: FieldListViewPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	
	RepeatingView fieldsView = new RepeatingView("fields");
	for (FieldSupply field: fields) {
		WebMarkupContainer container = new WebMarkupContainer(fieldsView.newChildId());
		container.add(new Label("name", field.getName()));
		
		if (field.getValueProvider() instanceof SpecifiedValue) {
			if (field.isSecret())
				container.add(new Label("valueProvider", SpecifiedValue.SECRET_DISPLAY_NAME));
			else
				container.add(new Label("valueProvider", SpecifiedValue.DISPLAY_NAME));
			List<String> value = field.getValueProvider().getValue();
			if (value.size() == 0) 
				container.add(new Label("value", "<i>Empty</i>").setEscapeModelStrings(false));
			else if (value.size() == 1)
				container.add(new Label("value", value.iterator().next()));
			else 
				container.add(new Label("value", value.toString()));
		} else if (field.getValueProvider() instanceof ScriptingValue) {
			if (field.isSecret())
				container.add(new Label("valueProvider", ScriptingValue.SECRET_DISPLAY_NAME));
			else
				container.add(new Label("valueProvider", ScriptingValue.DISPLAY_NAME));
			container.add(PropertyContext.view("value", field.getValueProvider(), "scriptName"));
		} else {
			container.add(new WebMarkupContainer("value"));
		}
		fieldsView.add(container);
	}
	add(fieldsView);
}
 
Example #25
Source File: DatevImportStoragePanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @see org.projectforge.web.core.importstorage.AbstractImportStoragePanel#addColumns(org.apache.wicket.markup.repeater.RepeatingView,
 *      org.projectforge.common.ImportedElement)
 */
@Override
protected void addColumns(final RepeatingView cellRepeater, final ImportedElement< ? > element, final String style)
{
  if (getStorageType() == DatevImportDao.Type.KONTENPLAN) {
    final KontoDO konto = (KontoDO) element.getValue();
    addCell(cellRepeater, konto.getNummer(), style + " white-space: nowrap; text-align: right;");
    addCell(cellRepeater, konto.getBezeichnung(), style);
  } else {
    final BuchungssatzDO satz = (BuchungssatzDO) element.getValue();
    addCell(cellRepeater, satz.getSatznr(), style + " white-space: nowrap; text-align: right;");
    addCell(cellRepeater, DateTimeFormatter.instance().getFormattedDate(satz.getDatum()), style + " white-space: nowrap;");
    addCell(cellRepeater, CurrencyFormatter.format(satz.getBetrag()), style + " white-space: nowrap; text-align: right;");
    addCell(cellRepeater, satz.getText(), style);
    addCell(cellRepeater, satz.getKonto() != null ? satz.getKonto().getNummer() : null, style);
    addCell(cellRepeater, satz.getGegenKonto() != null ? satz.getGegenKonto().getNummer() : null, style);
    final Kost1DO kost1 = satz.getKost1();
    Component comp = addCell(cellRepeater, kost1 != null ? kost1.getShortDisplayName() : null, style);
    if (kost1 != null) {
      WicketUtils.addTooltip(comp, KostFormatter.formatToolTip(kost1));
    }
    final Kost2DO kost2 = satz.getKost2();
    comp = addCell(cellRepeater, kost2 != null ? kost2.getShortDisplayName() : null, style);
    if (kost2 != null) {
      WicketUtils.addTooltip(comp, KostFormatter.formatToolTip(kost2));
    }
  }
}
 
Example #26
Source File: StateStatsBar.java    From onedev with MIT License 5 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();

	int totalCount = getModelObject().values().stream().collect(Collectors.summingInt(it->it));
	if (totalCount != 0) {
		RepeatingView statesView = new RepeatingView("states");
		for (StateSpec state: OneDev.getInstance(SettingManager.class).getIssueSetting().getStateSpecs()) {
			Integer count = getModelObject().get(state.getName());
			if (count != null) { 
				Link<Void> link = newStateLink(statesView.newChildId(), state.getName());
				link.add(AttributeAppender.append("title", count + " " + state.getName().toLowerCase() + " issues"));
				link.add(AttributeAppender.append("data-percent", count*1.0/totalCount));
				link.add(AttributeAppender.append("style", "background-color: " + state.getColor()));
				statesView.add(link);
			}
		}
		add(statesView);
	} else {
		add(new Label("states", "&nbsp;") {

			@Override
			protected void onComponentTag(ComponentTag tag) {
				super.onComponentTag(tag);
				tag.setName("span");
			}
			
		}.setEscapeModelStrings(false));
		add(AttributeAppender.append("title", "No issues in milestone"));
	}
	
	setOutputMarkupId(true);
}
 
Example #27
Source File: CommitListPanel.java    From onedev with MIT License 5 votes vote down vote up
private RepeatingView newCommitsView() {
	RepeatingView commitsView = new RepeatingView("commits");
	commitsView.setOutputMarkupId(true);
	
	int commitIndex = 0;
	List<RevCommit> commits = commitsModel.getObject().current;
	for (int i=0; i<commits.size(); i++) {
		Component item = newCommitItem(commitsView.newChildId(), i);
		if (commits.get(i) != null)
			addCommitClass(item, commitIndex++);
		commitsView.add(item);
	}
	getProject().cacheCommitStatus(getBuildManager().queryStatus(getProject(), getCommitIdsToQueryStatus()));
	return commitsView;
}
 
Example #28
Source File: SetupImportForm.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("serial")
protected void init()
{
  add(createFeedbackPanel());
  final GridBuilder gridBuilder = newGridBuilder(this, "flowform");
  gridBuilder.newFormHeading(getString("import"));
  {
    // Upload dump file
    final FieldsetPanel fs = gridBuilder.newFieldset(getString("administration.setup.dumpFile"));
    fileUploadField = new FileUploadField(FileUploadPanel.WICKET_ID);
    fs.add(new FileUploadPanel(fs.newChildId(), fileUploadField));
  }
  final RepeatingView actionButtons = new RepeatingView("buttons");
  add(actionButtons);
  {
    final Button importButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("import")) {
      @Override
      public final void onSubmit()
      {
        parentPage.upload();
      }
    };
    final SingleButtonPanel importButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), importButton, getString("import"),
        SingleButtonPanel.DEFAULT_SUBMIT);
    actionButtons.add(importButtonPanel);
  }
}
 
Example #29
Source File: StructureTable.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor
 * 
 * @param id
 */
private ToolbarsContainer(final String id)
{
	super(id);
	toolbars = new RepeatingView("toolbars");
	add(toolbars);
}
 
Example #30
Source File: ParamListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	
	add(newParamsView(getDefaultParamBean().getClass()));
	
	add(new INullAcceptingValidator<List<Serializable>>() {

		@SuppressWarnings("deprecation")
		@Override
		public void validate(IValidatable<List<Serializable>> validatable) {
			int index = 0;
			for (Serializable each: validatable.getValue()) {
				ParamSupply param = (ParamSupply) each;
				if (param.getValuesProvider() instanceof SpecifiedValues) {
					SpecifiedValues specifiedValues = (SpecifiedValues) param.getValuesProvider();
					try {
						ParamSupply.validateParamValues(specifiedValues.getValues());
					} catch (ValidationException e) {
						if (!getFlag(FLAG_RENDERING)) {
							RepeatingView paramsView = (RepeatingView) get("params");
							paramsView.get(index).get("values").error(e.getMessage());
						}
					}
				}
				index++;
			}
		}
		
	});
	
	setOutputMarkupId(true);
}