All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nasdanika.html.app.impl.ContentAction Maven / Gradle / Ivy

package org.nasdanika.html.app.impl;

import java.util.Map;

import org.nasdanika.common.ProgressMonitor;
import org.nasdanika.html.app.ViewGenerator;

/**
 * Action with navigation activator and generate() which returns content value. 
 * @author Pavel Vlasov
 *
 */
public class ContentAction extends ActionImpl {
	
	private String content;
	
	public ContentAction() {
		
	}
	
//	public ContentAction(Map data) {
//		super(data);
//		content = (String) data.get("content");
//	}
	
	public void setContent(String content) {
		this.content = content;
	}
	
	public String getContent() {
		return content;
	}
	
	@Override
	public Map toMap() {
		Map map = super.toMap();
		if (getContent() != null) {
			map.put("content", getContent());
		}
		return map;
	}

	@Override
	public Object generate(ViewGenerator viewGenerator, ProgressMonitor progressMonitor) {
		return getContent();
	}

//	@Override
//	protected Action createAction(Map cd) {
//		ContentAction ret = new ContentAction(cd);
//		ret.setParent(this);
//		return ret;
//	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy