nosi.core.gui.components.IGRPToolsBar Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of igrp-core Show documentation
Show all versions of igrp-core Show documentation
IGRP Framework is a powerful and highly customizable platform developed by the Operational Nucleus for the Information Society (NOSi) to create web applications, it provides out of box, several modules to make easy to create stand-alone, production-grade web applications: authentication and access-control, business processes automation, reporting, page builder with automatic code generation and incorporation of the Once-Only-Principle, written in Java. IGRP Framework WAR - Contains some keys resources that give UI to IGRP Framework and others supports files.
package nosi.core.gui.components;
/**
* @author: Emanuel Pereira
*
* Apr 17, 2017
*
* Description: class to generate xml of tools-bar
*/
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import nosi.core.gui.fields.FieldProperties;
import nosi.core.xml.XMLWritter;
public class IGRPToolsBar {
protected String tag_name;
protected List buttons;
protected Object class_name = this;
protected XMLWritter xml;
protected String type = "toolsbar";
protected FieldProperties properties;
private boolean isVisible = true;
public IGRPToolsBar(String tag_name) {
this.tag_name = tag_name;
this.buttons = new ArrayList<>();
this.xml = new XMLWritter();
this.properties = new FieldProperties();
this.properties.add("type", this.type);
this.properties.add("xml-type", this.type);
}
public void setClassName(Object class_name){
this.class_name = class_name;
}
public String getClassName(){
return this.class_name.getClass().getSimpleName();
}
public FieldProperties getProperties() {
return properties;
}
public void setProperties(FieldProperties properties) {
this.properties = properties;
}
public boolean isVisible() {
return isVisible;
}
public void setVisible(boolean isVisible) {
this.isVisible = isVisible;
}
public String toString(){
return this.toXmlTools();
}
/*Generate xml item
* -
Button
_blank
fa-dot-circle-o
default|fa-dot-circle-o|www
*/
public String toXmlTools(){
if(this.buttons!=null && !this.buttons.isEmpty()){
xml.startElement(this.tag_name);
if(this.getClassName().compareTo("IGRPToolsBar") == 0){
for(Entry