From commits-return-68785-archive-asf-public=cust-asf.ponee.io@myfaces.apache.org Wed Apr 25 13:48:45 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C773C18067E for ; Wed, 25 Apr 2018 13:48:42 +0200 (CEST) Received: (qmail 24961 invoked by uid 500); 25 Apr 2018 11:48:41 -0000 Mailing-List: contact commits-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list commits@myfaces.apache.org Received: (qmail 24820 invoked by uid 99); 25 Apr 2018 11:48:41 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2018 11:48:41 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 98F7B3A0598 for ; Wed, 25 Apr 2018 11:48:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1830065 [4/5] - in /myfaces/site/publish/tobago: tobago-core/tlddoc/tc/ tobago-core/xref/org/apache/myfaces/tobago/component/ tobago-core/xref/org/apache/myfaces/tobago/internal/component/ tobago-core/xref/org/apache/myfaces/tobago/interna... Date: Wed, 25 Apr 2018 11:48:39 -0000 To: commits@myfaces.apache.org From: lofwyr@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20180425114840.98F7B3A0598@svn01-us-west.apache.org> Added: myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/BoxController.html URL: http://svn.apache.org/viewvc/myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/BoxController.html?rev=1830065&view=auto ============================================================================== --- myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/BoxController.html (added) +++ myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/BoxController.html Wed Apr 25 11:48:38 2018 @@ -0,0 +1,69 @@ + + + +BoxController xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  
+20  package org.apache.myfaces.tobago.example.demo;
+21  
+22  import javax.enterprise.context.SessionScoped;
+23  import javax.inject.Named;
+24  import java.io.Serializable;
+25  
+26  @Named
+27  @SessionScoped
+28  public class BoxController implements Serializable {
+29    private boolean box1collapsed = true;
+30    private boolean box2collapsed = true;
+31    private boolean box3collapsed = true;
+32  
+33    public boolean isBox1collapsed() {
+34      return box1collapsed;
+35    }
+36  
+37    public void setBox1collapsed(boolean box1collapsed) {
+38      this.box1collapsed = box1collapsed;
+39    }
+40  
+41    public boolean isBox2collapsed() {
+42      return box2collapsed;
+43    }
+44  
+45    public void setBox2collapsed(boolean box2collapsed) {
+46      this.box2collapsed = box2collapsed;
+47    }
+48  
+49    public boolean isBox3collapsed() {
+50      return box3collapsed;
+51    }
+52  
+53    public void setBox3collapsed(boolean box3collapsed) {
+54      this.box3collapsed = box3collapsed;
+55    }
+56  }
+
+
+ + + Added: myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/LoginController.html URL: http://svn.apache.org/viewvc/myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/LoginController.html?rev=1830065&view=auto ============================================================================== --- myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/LoginController.html (added) +++ myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/LoginController.html Wed Apr 25 11:48:38 2018 @@ -0,0 +1,113 @@ + + + +LoginController xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  
+20  package org.apache.myfaces.tobago.example.demo;
+21  
+22  import org.slf4j.Logger;
+23  import org.slf4j.LoggerFactory;
+24  
+25  import javax.enterprise.context.RequestScoped;
+26  import javax.faces.context.ExternalContext;
+27  import javax.faces.context.FacesContext;
+28  import javax.inject.Named;
+29  import javax.servlet.ServletException;
+30  import javax.servlet.http.HttpServletRequest;
+31  import javax.servlet.http.HttpServletResponse;
+32  import javax.servlet.http.HttpSession;
+33  import java.io.IOException;
+34  
+35  @Named
+36  @RequestScoped
+37  public class LoginController {
+38  
+39    private static final Logger LOG = LoggerFactory.getLogger(LoginController.class);
+40  
+41    private String username;
+42    private String password;
+43  
+44    public String login() throws ServletException, IOException {
+45      final FacesContext facesContext = FacesContext.getCurrentInstance();
+46      final ExternalContext externalContext = facesContext.getExternalContext();
+47      final HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
+48      final HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();
+49  
+50      LOG.info("Try to login user: '{}'", username);
+51      request.login(username, password);
+52      LOG.info("Successful login user: '{}'", username);
+53  
+54      return "/content/30-concept/80-security/20-roles/x-login.xhtml?faces-redirect=true";
+55    }
+56  
+57    public String logout() throws ServletException, IOException {
+58      final FacesContext facesContext = FacesContext.getCurrentInstance();
+59      final ExternalContext externalContext = facesContext.getExternalContext();
+60      final HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
+61  
+62      request.logout();
+63  
+64      return facesContext.getViewRoot().getViewId();
+65    }
+66  
+67    public String resetSession() throws IOException {
+68      LOG.info("Resetting the session.");
+69      final FacesContext facesContext = FacesContext.getCurrentInstance();
+70      final HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false);
+71      if (session != null) {
+72        session.invalidate();
+73      }
+74      final ExternalContext externalContext = facesContext.getExternalContext();
+75  /* XXX reset theme doesn't work
+76      CookieUtils.removeThemeNameCookie(
+77          (HttpServletRequest)externalContext.getRequest(),
+78          (HttpServletResponse) externalContext.getResponse());
+79  */
+80      externalContext.redirect(externalContext.getRequestContextPath() + "/");
+81      facesContext.responseComplete();
+82      return null;
+83    }
+84  
+85    public String getUsername() {
+86      return username;
+87    }
+88  
+89    public void setUsername(final String username) {
+90      this.username = username;
+91    }
+92  
+93    public String getPassword() {
+94      return password;
+95    }
+96  
+97    public void setPassword(final String password) {
+98      this.password = password;
+99    }
+100 }
+
+
+ + + Added: myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/Release.html URL: http://svn.apache.org/viewvc/myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/Release.html?rev=1830065&view=auto ============================================================================== --- myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/Release.html (added) +++ myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/Release.html Wed Apr 25 11:48:38 2018 @@ -0,0 +1,189 @@ + + + +Release xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  
+20  package org.apache.myfaces.tobago.example.demo;
+21  
+22  public enum Release {
+23  
+24    v1_0_7("12310824"),
+25    v1_0_8("12310900"),
+26    v1_0_9("12312042"),
+27    v1_0_10("12312204"),
+28    v1_0_11("12312376"),
+29    v1_0_12("12312498"),
+30    v1_0_13("12312766"),
+31    v1_0_14("12312878"),
+32    v1_0_15("12312929"),
+33    v1_0_16("12312966"),
+34    v1_0_17("12313084"),
+35    v1_0_18("12313150"),
+36    v1_0_19("12313372"),
+37    v1_0_20("12313447"),
+38    v1_0_21("12313470"),
+39    v1_0_22("12314027"),
+40    v1_0_23("12314159"),
+41    v1_0_24("12314193"),
+42    v1_0_25("12314527"),
+43    v1_0_26("12314961"),
+44    v1_0_27("12315099"),
+45    v1_0_28("12315109"),
+46    v1_0_29("12315262"),
+47    v1_0_30("12315336"),
+48    v1_0_31("12315383"),
+49    v1_0_32("12315489"),
+50    v1_0_33("12315586"),
+51    v1_0_34("12316162"),
+52    v1_0_35("12316183"),
+53    v1_0_36("12316297"),
+54    v1_0_37("12316458"),
+55    v1_0_38("12317350"),
+56    v1_0_39("12319455"),
+57    v1_0_40("12319866"),
+58    v1_0_41("12324116"),
+59    v1_0_42("12326705"),
+60    v1_0_43("12333048", false, true),
+61  
+62    v1_5_0_alpha_2("12314340"),
+63    v1_5_0_beta_1("12316222"),
+64    v1_5_0_beta_2("12317052"),
+65    v1_5_0("12312205"),
+66    v1_5_1("12319154"),
+67    v1_5_2("12319248"),
+68    v1_5_3("12319499"),
+69    v1_5_4("12319864"),
+70    v1_5_5("12319865"),
+71    v1_5_6("12321251"),
+72    v1_5_7("12321444"),
+73    v1_5_8("12322450"),
+74    v1_5_9("12323506"),
+75    v1_5_10("12324008"),
+76    v1_5_11("12324453"),
+77    v1_5_12("12325597"),
+78    v1_5_13("12325858"),
+79    v1_5_14("12326706", false, true),
+80  
+81    v1_6_0_beta_1("12321691"),
+82    v1_6_0_beta_2("12321701"),
+83  
+84    v2_0_0_alpha_1("12321874"),
+85    v2_0_0_alpha_2("12324818"),
+86    v2_0_0_alpha_3("12325247"),
+87    v2_0_0_beta_1("12325856"),
+88    v2_0_0_beta_2("12326662"),
+89    v2_0_0_beta_3("12326693"),
+90    v2_0_0_beta_4("12326809"),
+91    v2_0_0("12321253"),
+92    v2_0_1("12327455"),
+93    v2_0_2("12327500"),
+94    v2_0_3("12328040"),
+95    v2_0_4("12328041"),
+96    v2_0_5("12329025"),
+97    v2_0_6("12329161"),
+98    v2_0_7("12329376"),
+99    v2_0_8("12329723"),
+100   v2_0_9("12332146"),
+101   v2_0_10("12334742"),
+102   v2_1_0("12338208"),
+103   v2_1_1("12341246", true),
+104   v2_1_2("12342740", false, true),
+105 
+106   v3_0_0_alpha_1("12325880"),
+107   v3_0_0_alpha_2("12333887"),
+108   v3_0_0_alpha_3("12334363"),
+109   v3_0_0_alpha_4("12337842"),
+110   v3_0_0_alpha_5("12338164"),
+111   v3_0_0_alpha_6("12338231"),
+112   v3_0_0_alpha_7("12338278"),
+113   v3_0_0_beta_1("12333888"),
+114   v3_0_0("12325880"),
+115   v3_0_1("12338730"),
+116   v3_0_2("12339171"),
+117   v3_0_3("12339442"),
+118   v3_0_4("12340258"),
+119   v3_0_5("12340325"),
+120   v3_0_6("12341574", true),
+121   v3_0_7("12342388", false, true),
+122 
+123   v4_0_0("12338728"),
+124   v4_1_0("12339443"),
+125   v4_2_0("12342739"),
+126   v4_2_1("12342849", true),
+127   v4_3_0("12342850", false, true),
+128 
+129   v5_0_0("12338729", false, true);
+130 
+131   private String jira;
+132   private String version;
+133   private boolean tx;
+134   private boolean current;
+135   private boolean unreleased;
+136 
+137   Release(final String jira) {
+138     this(jira, false, false);
+139   }
+140 
+141   Release(final String jira, final boolean current) {
+142     this(jira, current, false);
+143   }
+144 
+145   Release(final String jira, final boolean current, final boolean unreleased) {
+146     this.current = current;
+147     this.jira = jira;
+148     this.unreleased = unreleased;
+149     version = name()
+150         .substring(1)
+151         .replaceAll("_alpha_", "-alpha-")
+152         .replaceAll("_beta_", "-beta-")
+153         .replace('_', '.');
+154     tx = version.startsWith("1.5") || version.startsWith("1.6");
+155   }
+156 
+157   public String getVersion() {
+158     return version;
+159   }
+160 
+161   public boolean isTx() {
+162     return tx;
+163   }
+164 
+165   public boolean isCurrent() {
+166     return current;
+167   }
+168 
+169   public boolean isUnreleased() {
+170     return unreleased;
+171   }
+172 
+173   public String getJira() {
+174     return jira;
+175   }
+176 }
+
+
+ + + Added: myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/SuggestQuotMarkController.html URL: http://svn.apache.org/viewvc/myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/SuggestQuotMarkController.html?rev=1830065&view=auto ============================================================================== --- myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/SuggestQuotMarkController.html (added) +++ myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/example/demo/SuggestQuotMarkController.html Wed Apr 25 11:48:38 2018 @@ -0,0 +1,77 @@ + + + +SuggestQuotMarkController xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  
+20  package org.apache.myfaces.tobago.example.demo;
+21  
+22  import org.apache.commons.lang3.StringUtils;
+23  import org.slf4j.Logger;
+24  import org.slf4j.LoggerFactory;
+25  
+26  import javax.enterprise.context.SessionScoped;
+27  import javax.inject.Named;
+28  import java.io.Serializable;
+29  import java.util.ArrayList;
+30  import java.util.List;
+31  import java.util.stream.Collectors;
+32  
+33  @SessionScoped
+34  @Named
+35  public class SuggestQuotMarkController implements Serializable {
+36    private static final Logger LOG = LoggerFactory.getLogger(SuggestController.class);
+37    private List<String> suggestions = new ArrayList<>(8);
+38    private String query;
+39  
+40    public SuggestQuotMarkController() {
+41      suggestions.add("Mercury");
+42      suggestions.add("Venus");
+43      suggestions.add("Earth");
+44      suggestions.add("Mars");
+45      suggestions.add("Jupiter");
+46      suggestions.add("Saturn");
+47      suggestions.add("Uranus");
+48      suggestions.add("Quotation\"Mark");
+49    }
+50  
+51    public String getQuery() {
+52      return query;
+53    }
+54  
+55    public void setQuery(final String query) {
+56      this.query = query;
+57    }
+58  
+59    public List<String> getSuggestions() {
+60      final String substring = query != null ? query : "";
+61      LOG.info("Creating items for substring: '" + substring + "'");
+62      return suggestions.stream().filter(s -> StringUtils.containsIgnoreCase(s, substring)).collect(Collectors.toList());
+63    }
+64  }
+
+
+ + + Added: myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/component/AbstractUIBadge.html URL: http://svn.apache.org/viewvc/myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/component/AbstractUIBadge.html?rev=1830065&view=auto ============================================================================== --- myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/component/AbstractUIBadge.html (added) +++ myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/component/AbstractUIBadge.html Wed Apr 25 11:48:38 2018 @@ -0,0 +1,41 @@ + + + +AbstractUIBadge xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  
+20  package org.apache.myfaces.tobago.internal.component;
+21  
+22  import org.apache.myfaces.tobago.component.Visual;
+23  
+24  import javax.faces.component.UIOutput;
+25  
+26  public abstract class AbstractUIBadge extends UIOutput implements Visual {
+27  
+28  }
+
+
+ + + Added: myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/component/AbstractUISelectReference.html URL: http://svn.apache.org/viewvc/myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/component/AbstractUISelectReference.html?rev=1830065&view=auto ============================================================================== --- myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/component/AbstractUISelectReference.html (added) +++ myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/component/AbstractUISelectReference.html Wed Apr 25 11:48:38 2018 @@ -0,0 +1,40 @@ + + + +AbstractUISelectReference xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  
+20  package org.apache.myfaces.tobago.internal.component;
+21  
+22  import javax.faces.component.UIOutput;
+23  
+24  public abstract class AbstractUISelectReference extends UIOutput {
+25    public abstract String getFor();
+26    public abstract String getRenderRange();
+27  }
+
+
+ + + Added: myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeInsideButtonsRenderer.html URL: http://svn.apache.org/viewvc/myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeInsideButtonsRenderer.html?rev=1830065&view=auto ============================================================================== --- myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeInsideButtonsRenderer.html (added) +++ myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeInsideButtonsRenderer.html Wed Apr 25 11:48:38 2018 @@ -0,0 +1,44 @@ + + + +BadgeInsideButtonsRenderer xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  
+20  package org.apache.myfaces.tobago.internal.renderkit.renderer;
+21  
+22  import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+23  import org.apache.myfaces.tobago.renderkit.css.CssItem;
+24  
+25  public class BadgeInsideButtonsRenderer extends BadgeRenderer {
+26  
+27    @Override
+28    protected CssItem getAdditionalCssItem() {
+29      return BootstrapClass.BTN;
+30    }
+31  }
+
+
+ + + Added: myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeRenderer.html URL: http://svn.apache.org/viewvc/myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeRenderer.html?rev=1830065&view=auto ============================================================================== --- myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeRenderer.html (added) +++ myfaces/site/publish/tobago/xref/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeRenderer.html Wed Apr 25 11:48:38 2018 @@ -0,0 +1,107 @@ + + + +BadgeRenderer xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  
+20  package org.apache.myfaces.tobago.internal.renderkit.renderer;
+21  
+22  import org.apache.myfaces.tobago.context.Markup;
+23  import org.apache.myfaces.tobago.internal.component.AbstractUIBadge;
+24  import org.apache.myfaces.tobago.internal.util.RenderUtils;
+25  import org.apache.myfaces.tobago.renderkit.RendererBase;
+26  import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+27  import org.apache.myfaces.tobago.renderkit.css.CssItem;
+28  import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
+29  import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
+30  import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+31  
+32  import javax.faces.component.UIComponent;
+33  import javax.faces.context.FacesContext;
+34  import java.io.IOException;
+35  
+36  public class BadgeRenderer extends RendererBase {
+37  
+38    @Override
+39    public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
+40      final TobagoResponseWriter writer = getResponseWriter(facesContext);
+41      final AbstractUIBadge badge = (AbstractUIBadge) component;
+42      final Markup markup = badge.getMarkup() != null ? badge.getMarkup() : Markup.NULL;
+43      final String value = RenderUtils.currentValue(badge);
+44  
+45      writer.startElement(HtmlElements.SPAN);
+46      writer.writeIdAttribute(badge.getClientId(facesContext));
+47      writer.writeClassAttribute(
+48          TobagoClass.BADGE,
+49          TobagoClass.BADGE.createMarkup(markup),
+50          BootstrapClass.BADGE,
+51          getBadgeColor(markup),
+52          markup.contains(Markup.PILL) ? BootstrapClass.BADGE_PILL : null,
+53          getAdditionalCssItem(),
+54          badge.getCustomClass());
+55  
+56      if (value != null) {
+57        writer.writeText(value);
+58      }
+59    }
+60  
+61    @Override
+62    public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+63      final TobagoResponseWriter writer = getResponseWriter(facesContext);
+64      writer.endElement(HtmlElements.SPAN);
+65    }
+66  
+67    protected CssItem getAdditionalCssItem() {
+68      return null;
+69    }
+70  
+71    private BootstrapClass getBadgeColor(final Markup markup) {
+72      if (markup.contains(Markup.NONE)) {
+73        return null;
+74      } else if (markup.contains(Markup.PRIMARY)) {
+75        return BootstrapClass.BADGE_PRIMARY;
+76      } else if (markup.contains(Markup.SECONDARY)) {
+77        return BootstrapClass.BADGE_SECONDARY;
+78      } else if (markup.contains(Markup.SUCCESS)) {
+79        return BootstrapClass.BADGE_SUCCESS;
+80      } else if (markup.contains(Markup.DANGER)) {
+81        return BootstrapClass.BADGE_DANGER;
+82      } else if (markup.contains(Markup.WARNING)) {
+83        return BootstrapClass.BADGE_WARNING;
+84      } else if (markup.contains(Markup.INFO)) {
+85        return BootstrapClass.BADGE_INFO;
+86      } else if (markup.contains(Markup.LIGHT)) {
+87        return BootstrapClass.BADGE_LIGHT;
+88      } else if (markup.contains(Markup.DARK)) {
+89        return BootstrapClass.BADGE_DARK;
+90      } else {
+91        return BootstrapClass.BADGE_SECONDARY;
+92      }
+93    }
+94  }
+
+
+ + +