Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.cdlflex.ui.markup.html.button;
 
 import java.util.List;
 
 
 public class ButtonList extends ListView<AbstractLink> {
 
     private static final long serialVersionUID = 1L;
 
     public static final String BUTTON_MARKUP_ID = "button";

    
Construct.

Parameters:
markupId the component' id
list list of all buttons inside this button list
 
     public ButtonList(final String markupIdfinal List<? extends AbstractLinklist) {
         super(markupIdlist);
 
         setOutputMarkupId(true);
     }

    
Construct.

Parameters:
id the component' id
model list model of all buttons inside this button list
 
     public ButtonList(final String idfinal IModel<List<? extends AbstractLink>> model) {
         super(idmodel);
 
         setOutputMarkupId(true);
     }

    
checks whether there is a button that is active or not.

Parameters:
activeButton the current active button
Returns:
true, if at least one button of button list is active
 
     public final boolean hasActiveButton(final Component activeButton) {
         final Class<? extends PagepageClass = activeButton.getPage().getPageClass();
 
         for (final AbstractLink link : getList()) {
             if (link instanceof IActivatable) {
                 if (((IActivatablelink).isActive(activeButton)) {
                     return true;
                 }
             } else if (link instanceof BookmarkablePageLink) {
                 if (((BookmarkablePageLink<?>) link).getPageClass().equals(pageClass)) {
                     return true;
                 }
             }
         }
 
         return false;
     }
 
     @Override
     protected void populateItem(ListItem<AbstractLinkitem) {
         final AbstractLink link = item.getModelObject();
 
         Args.isTrue(getButtonMarkupId().equals(link.getId()),
                 "component id is invalid, please use ButtonList.getButtonMarkupId()");
 
         item.add(link);
     }

    
Returns the markup id used for button list elements.

Returns:
the markup id that is used for buttons in the list
 
     public static String getButtonMarkupId() {
        return ;
    }
New to GrepCode? Check out our FAQ X