@Override
	protected void onInitialize()
	{
		super.onInitialize();
		add(this.swapPanel = new SwapComponentsFragmentPanel<T>("swapPanel", getModel())
		{
			/** The serialVersionUID. */
			private static final long serialVersionUID = 1L;

			/**
			 * {@inheritDoc}
			 */
			@Override
			protected Component newEditComponent(final String id, final IModel<T> model)
			{
				return new LabeledTextFieldPanel<String, T>(id, model, getLabelModel())
				{
					/** The serialVersionUID. */
					private static final long serialVersionUID = 1L;

					/**
					 * Factory method for creating the TextField. This method is invoked in the
					 * constructor from the derived classes and can be overridden so users can
					 * provide their own version of a TextField.
					 *
					 * @param id
					 *            the id
					 * @param model
					 *            the model
					 * @return the text field
					 */
					@Override
					protected TextField<String> newTextField(final String id, final IModel<T> model)
					{
						return ComponentFactory.newTextField(id, new PropertyModel<String>(
							model.getObject(), EditableTextField.this.getId()));
					}
				};
			}

			/**
			 * {@inheritDoc}
			 */
			@Override
			protected Component newViewComponent(final String id, final IModel<T> model)
			{
				return new LabeledLabelPanel<T>(id, model, getLabelModel())
				{
					/** The serialVersionUID. */
					private static final long serialVersionUID = 1L;

					/**
					 * {@inheritDoc}
					 */
					@Override
					protected Label newViewableLabel(final String id, final IModel<T> model)
					{
						final PropertyModel<T> viewableLabelModel = new PropertyModel<>(model,
							EditableTextField.this.getId());
						return ComponentFactory.newLabel(id, viewableLabelModel);
					}
				};
			}
		});
	}
@ Override protected void onInitialize ( ) { super . onInitialize ( ) ; add ( this . swapPanel = new SwapComponentsFragmentPanel < T > ( "swapPanel" , getModel ( ) ) { private static final long serialVersionUID = 1L ; @ Override protected Component newEditComponent ( final String id , final IModel < T > model ) { return new LabeledTextFieldPanel < String , T > ( id , model , getLabelModel ( ) ) { private static final long serialVersionUID = 1L ; @ Override protected TextField < String > newTextField ( final String id , final IModel < T > model ) { return ComponentFactory . newTextField ( id , new PropertyModel < String > ( model . getObject ( ) , EditableTextField . this . getId ( ) ) ) ; } } ; } @ Override protected Component newViewComponent ( final String id , final IModel < T > model ) { return new LabeledLabelPanel < T > ( id , model , getLabelModel ( ) ) { private static final long serialVersionUID = 1L ; @ Override protected Label newViewableLabel ( final String id , final IModel < T > model ) { final PropertyModel < T > viewableLabelModel = new PropertyModel < > ( model , EditableTextField . this . getId ( ) ) ; return ComponentFactory . newLabel ( id , viewableLabelModel ) ; } } ; } } ) ; }
{@inheritDoc}