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

jpaoletti.jpm.struts.MenuItemLocationExternal Maven / Gradle / Ivy

The newest version!
package jpaoletti.jpm.struts;

import jpaoletti.jpm.menu.MenuItem;
import jpaoletti.jpm.menu.MenuItemLocation;

/**
 * Location representing external links.
 * 
 * @author jpaoletti
 */
public class MenuItemLocationExternal implements MenuItemLocation {

    @Override
    public Object build(MenuItem item, Object... params) {
        MenuItemContext context = new MenuItemContext();
        StringBuilder sb = new StringBuilder("");
        context.setPrefix(sb.toString());
        context.setValue(item.getText());
        context.setSufix("");
        return context;
    }

    /**
     * Builds an external link
     * @param item The menu item
     * @param params Extra parameters
     * @return The string with the external link
     */
    protected String buildLink(MenuItem item, Object... params) {
        return item.getLocationValue();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy