Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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 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.apache.marmotta.platform.core.model.template;
 import java.util.List;
 import java.util.Map;

Created with IntelliJ IDEA. User: tkurz Date: 18.01.13 Time: 13:43 To change this template use File | Settings | File Templates.
 public class MenuItem {
     private boolean initialized = false;
     public final static String DEFAULT_MENU_ICON = "icon-asterisk";
     private HashMap<String,Objectproperties;
     private List<MenuItemitems;
     private MenuItemType type;
     public MenuItem(String labelMenuItemType type) {
         this. = new HashMap<StringObject>();
         this. = type;
         this. = new ArrayList<MenuItem>();
     public HashMap<String,ObjectgetProperties() {
         if(.get("items") != null) {
             List<Objectos = new ArrayList<Object>();
             for(MenuItem item : ) {
         return ;
     public void set(String nameObject value) {
     public Object get(String name) {
         return .get(name);
     public void addItem(MenuItem item) {
     public boolean setActive(String path) {
         boolean isActive = false;
         switch() {
             case :
             case :
             case :
                 for(MenuItem item : ) {
                     if(item.setActive(path)) {
                         isActive = true;
             case :
                 isActive  = get("path").equals(path);
             case :
                 String s = (String).get("path");
                 isActive = (
                         path.startsWith(s.substring(0,s.lastIndexOf("/"))) &&
                 isActive = false;
        return isActive;
    public boolean isEmpty() {
        return .isEmpty();
New to GrepCode? Check out our FAQ X