001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.console.widgets; 018 019import org.apache.juneau.commons.bean.*; 020 021/** 022 * A static contextual label widget in a {@link BarSlot}. 023 * 024 * @since 10.0.0 025 */ 026@BeanType(properties="id,text") 027public final class BarText implements BarWidget { 028 029 /** The stable widget id, unique within its {@link BarSlot}. Required, non-blank. */ 030 public String id; 031 032 /** The label text painted as {@code textContent}. Required, non-blank. */ 033 public String text; 034 035 /** 036 * Creates a bar text widget. 037 * 038 * @param id The stable widget id. Must not be <jk>null</jk> or blank. 039 * @param text The label text. Must not be <jk>null</jk> or blank. 040 * @return A new {@link BarText}. 041 */ 042 public static BarText of(String id, String text) { 043 var b = new BarText(); 044 b.id = id; 045 b.text = text; 046 return b; 047 } 048}