@Override protected void onInitialize() { super.onInitialize(); setFilterCriteria(manager, getFilterCriteriaType(), getModel()); }
@Override protected void onInitialize() { super.onInitialize(); Charset detectedCharset = ContentDetector.detectCharset(getModelObject()); Charset charset = detectedCharset!=null?detectedCharset:Charset.defaultCharset(); String source = new String(getModelObject(), charset); add(input = new TextArea<String>("input", Model.of(source)) { @Override protected boolean shouldTrimInput() { return false; } }); setOutputMarkupId(true); }
@Override protected void onInitialize() { super.onInitialize(); this.add(this.newInputFragment("model")); //cannot be in ctor as the model may not have been initialized before. this.add(JQueryWidget.newWidgetBehavior(this, this.label)); //cannot be in ctor as the markupId may be set manually afterward }
@Override protected void onInitialize() { super.onInitialize(); Date date = getModelObject(); Instant instant = date != null ? date.toInstant() : null; Date pickerDate = null; ZonedDateTime zonedDateTime = null; if (instant != null) { zonedDateTime = instant.atZone(clientZone); pickerDate = Date.from(zonedDateTime.toInstant()); } add(picker = new ODateField("datePanel", Model.of(pickerDate), clientZone)); addTimeComponents(zonedDateTime); add(AttributeModifier.append("class", "bootstrap-data-picker")); setOutputMarkupId(true); }
@Override protected void onInitialize() { super.onInitialize(); this.add(this.newInputFragment("model")); // cannot be in ctor as the model may not have been initialized before. this.add(JQueryWidget.newWidgetBehavior(this, this.label)); // cannot be in ctor as the markupId may be set manually afterward }
@Override protected void onInitialize() { super.onInitialize(); Charset detectedCharset = ContentDetector.detectCharset(getModelObject()); Charset charset = detectedCharset!=null?detectedCharset:Charset.defaultCharset(); add(input = new MarkdownEditor("input", Model.of(new String(getModelObject(), charset)), false, context) { @Override protected String getAutosaveKey() { return MarkdownBlobEditor.this.getAutosaveKey(); } @Override protected String renderMarkdown(String markdown) { MarkdownManager markdownManager = OneDev.getInstance(MarkdownManager.class); String html = markdownManager.render(markdown); return markdownManager.process(context.getProject(), html, context); } }); if (context.getMode() != Mode.EDIT) input.add(AttributeAppender.append("class", "no-autofocus")); input.setOutputMarkupId(true); }
@Override protected void onInitialize() { super.onInitialize(); add(localDateField = newDateField("date", new DateModel())); add(timeField = newTimeField("time", new TimeModel())); }
/** * {@inheritDoc} */ @Override protected void onInitialize() { super.onInitialize(); add(rootChoice = newRootChoice(ROOT_CHOICE_ID, getModel())); add(childChoice = newChildChoice(CHILD_CHOICE_ID, getModel())); }
@Override protected void onInitialize() { super.onInitialize(); this.textarea = new HiddenField<>("textarea", this.getModel()); this.textarea.setOutputMarkupId(true); this.textarea.setEscapeModelStrings(false); this.add(this.textarea); this.add(JQueryWidget.newWidgetBehavior(this, this.container)); }
@Override protected void onInitialize() { super.onInitialize(); this.datePicker = this.newDatePicker("datepicker", this.getModel(), this.getDatePattern()); this.timePicker = this.newTimePicker("timepicker", this.getModel(), this.getTimePattern()); this.add(this.datePicker); this.add(this.timePicker); } }
@Override protected void onInitialize() { super.onInitialize(); dateField = new TextField<>("date", getDateAsString(getModel())); dateField.setOutputMarkupId(true); add(dateField); setOutputMarkupId(true); add(AttributeModifier.append("class", "bootstrap-data-picker")); }
@Override protected void onInitialize() { super.onInitialize(); // Create and add the "hours" TextField add(hoursField = newHoursTextField("hours", new HoursModel(), Integer.class)); // Create and add the "minutes" TextField add(minutesField = newMinutesTextField("minutes", new MinutesModel(), Integer.class)); // Create and add the "AM/PM" choice add(amOrPmChoice = new DropDownChoice<AM_PM>("amOrPmChoice", new AmPmModel(), Arrays.asList(AM_PM.values())) { private static final long serialVersionUID = 1L; @Override protected boolean localizeDisplayValues() { return true; } }); }
@Override protected void onInitialize() { super.onInitialize(); setOutputMarkupPlaceholderTag(true); handle = new WebMarkupContainer("handle"); handle.setOutputMarkupId(true); WebMarkupContainer container = new WebMarkupContainer("container") { @Override public IMarkupFragment getMarkup(Component child) { if (child != null && child.getId().equals(handle.getId())) return super.getMarkup(child); return createMarkup(displayModel.getObject()); } }; container.add(handle); container.add(editorArea = createTextArea("editor")); add(container); }
@Override protected void onInitialize() { super.onInitialize(); this.input = new HiddenField<Integer>("value", this.newIndexModel(), Integer.class); this.add(this.input.setOutputMarkupId(true)); final WebMarkupContainer group = new WebMarkupContainer("group"); this.add(group); group.add(new ListView<T>("button", this.choices) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem<T> item) { item.add(ButtonGroup.this.newLabel("label", item.getModel())); } }); this.add(JQueryWidget.newWidgetBehavior(this, group)); }
@Override protected void onInitialize() { super.onInitialize(); this.input = new HiddenField<Integer>("value", this.newIndexModel(), Integer.class); this.add(this.input.setOutputMarkupId(true)); final WebMarkupContainer group = new WebMarkupContainer("group"); this.add(group); group.add(new ListView<T>("button", this.choices) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem<T> item) { item.add(ButtonGroup.this.newLabel("label", item.getModel())); } }); this.add(JQueryWidget.newWidgetBehavior(this, group)); }
@Override protected void onInitialize() { super.onInitialize(); this.datePicker = this.newDatePicker("datepicker", this.newDatePickerModel(), this.getLocale(), this.getDatePattern(), new Options()); this.timePicker = this.newTimePicker("timepicker", this.newTimePickerModel(), this.getLocale(), this.getTimePattern(), new Options()); this.add(this.datePicker); this.add(this.timePicker); }
@Override protected void onInitialize() { super.onInitialize(); this.datePicker = this.newDatePicker("datepicker", this.getModel(), this.getLocale(), this.getDatePattern(), new Options()); this.timePicker = this.newTimePicker("timepicker", this.getModel(), this.getLocale(), this.getTimePattern(), new Options()); this.add(this.datePicker); this.add(this.timePicker); }
@Override protected void onInitialize() { super.onInitialize(); this.datePicker = this.newDatePicker("datepicker", this.newDatePickerModel(), this.getLocale(), this.getDatePattern(), new Options()); this.timePicker = this.newTimePicker("timepicker", this.newTimePickerModel(), this.getLocale(), this.getTimePattern(), new Options()); this.add(this.datePicker); this.add(this.timePicker); }
@Override protected void onInitialize() { super.onInitialize(); this.datePicker = this.newDatePicker("datepicker", this.getModel(), this.getLocale(), this.getDatePattern(), new Options()); this.timePicker = this.newTimePicker("timepicker", this.getModel(), this.getLocale(), this.getTimePattern(), new Options()); this.add(this.datePicker); this.add(this.timePicker); }
@Override protected void onInitialize() { super.onInitialize(); getForm().add(new EqualPasswordInputValidator(password, confirmPassword)); IModel<String> labelModel = getLabel(); password.add(new AttributeModifier("placeholder", new StringResourceModel("password.placeholder.enter", labelModel))); password.setLabel(labelModel); confirmPassword.add(new AttributeModifier("placeholder", new StringResourceModel("password.placeholder.confirm", labelModel))); confirmPassword.setLabel(new StringResourceModel("password.confirm.label", labelModel)); }