Search in sources :

Example 1 with GeoPlatformAction

use of org.geosdi.geoplatform.gui.configuration.action.GeoPlatformAction in project geo-platform by geosdi.

the class ManageRolesWidget method createGuiComponentDetail.

private GuiComponentDetail createGuiComponentDetail(String componentId) {
    GuiComponentDetail gc = new GuiComponentDetail();
    gc.setComponentId(componentId);
    // gc.setDescription(action.get....()); // TODO Manage description
    // TODO Manage icon
    MenuActionRegistar menuRegistar = BasicGinInjector.MainInjector.getInstance().getMenuActionRegistar();
    GeoPlatformAction action = menuRegistar.get(componentId);
    if (action != null) {
        if (action instanceof MenuBaseAction) {
            AbstractImagePrototype image = ((MenuBaseAction) action).getImage();
            if (image != null) {
                gc.setImage(image);
            }
        // }else{
        // action = ToolbarActionRegistar.get(entry.getKey(), null)
        }
    }
    if (gc.getImage() == null) {
        gc.setImage(defaultImage);
    }
    return gc;
}
Also used : AbstractImagePrototype(com.google.gwt.user.client.ui.AbstractImagePrototype) GuiComponentDetail(org.geosdi.geoplatform.gui.client.model.GuiComponentDetail) MenuActionRegistar(org.geosdi.geoplatform.gui.action.menu.MenuActionRegistar) MenuBaseAction(org.geosdi.geoplatform.gui.action.menu.MenuBaseAction) GeoPlatformAction(org.geosdi.geoplatform.gui.configuration.action.GeoPlatformAction)

Aggregations

AbstractImagePrototype (com.google.gwt.user.client.ui.AbstractImagePrototype)1 MenuActionRegistar (org.geosdi.geoplatform.gui.action.menu.MenuActionRegistar)1 MenuBaseAction (org.geosdi.geoplatform.gui.action.menu.MenuBaseAction)1 GuiComponentDetail (org.geosdi.geoplatform.gui.client.model.GuiComponentDetail)1 GeoPlatformAction (org.geosdi.geoplatform.gui.configuration.action.GeoPlatformAction)1