| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,8 +24,8 @@ public void iconDemo() { | |||
| 24 | 24 | ||
| 25 | 25 | public void progressDemo() { | |
| 26 | 26 | // @start region = progress | |
| 27 | - Icon icon = icon(check).inProgress(); | ||
| 28 | - boolean finished = new Random().nextBoolean(); // @replace substring='new Random().nextBoolean();' replacement="..." | ||
| 27 | + Icon icon = icon(check).inProgress(true); | ||
| 28 | + boolean finished = new Random().nextBoolean(); // @replace substring = 'new Random().nextBoolean();' replacement = "..." | ||
| 29 | 29 | if (finished) { | |
| 30 | 30 | icon.inProgress(false); | |
| 31 | 31 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | import org.patternfly.component.menu.Menu; | |
| 2 | 2 | import org.patternfly.component.menu.MenuItem; | |
| 3 | 3 | ||
| 4 | - import static org.patternfly.component.Button.button; | ||
| 4 | + import static org.patternfly.component.button.Button.button; | ||
| 5 | 5 | import static org.patternfly.component.menu.Menu.menu; | |
| 6 | 6 | import static org.patternfly.component.menu.MenuContent.menuContent; | |
| 7 | 7 | import static org.patternfly.component.menu.MenuFooter.menuFooter; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,4 @@ | |||
| 1 | 1 | import static org.patternfly.component.brand.Brand.brand; | |
| 2 | - import static org.patternfly.component.Content.content; | ||
| 3 | 2 | import static org.patternfly.component.page.Masthead.pageMasthead; | |
| 4 | 3 | import static org.patternfly.component.page.MastheadToggle.mastheadToggle; | |
| 5 | 4 | import static org.patternfly.component.page.Page.page; | |
@@ -10,6 +9,7 @@ | |||
| 10 | 9 | import static org.patternfly.component.page.PageMainSection.pageMainSection; | |
| 11 | 10 | import static org.patternfly.component.page.PageSidebar.pageSidebar; | |
| 12 | 11 | import static org.patternfly.component.page.SkipToContent.skipToContent; | |
| 12 | + import static org.patternfly.component.text.TextContent.textContent; | ||
| 13 | 13 | import static org.patternfly.component.toolbar.Toolbar.toolbar; | |
| 14 | 14 | ||
| 15 | 15 | public class PageDemo { | |
@@ -41,13 +41,13 @@ public void pageMainBodyDemo() { | |||
| 41 | 41 | .addSection(pageMainBreadcrumb() | |
| 42 | 42 | .limitWidth() | |
| 43 | 43 | .addBody(pageMainBody() | |
| 44 | - .add(content()))) | ||
| 44 | + .add(textContent()))) | ||
| 45 | 45 | .addSection(pageMainSection() | |
| 46 | - .add(content())) | ||
| 46 | + .add(textContent())) | ||
| 47 | 47 | .addSection(pageMainSection() | |
| 48 | 48 | .limitWidth() | |
| 49 | 49 | .addBody(pageMainBody() | |
| 50 | - .add(content()))); | ||
| 50 | + .add(textContent()))); | ||
| 51 | 51 | // @end region = pageMainBody | |
| 52 | 52 | } | |
| 53 | 53 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,47 @@ | |||
| 1 | + /* | ||
| 2 | + * Copyright 2023 Red Hat | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + package org.patternfly.component; | ||
| 17 | + | ||
| 18 | + import org.jboss.elemento.Container; | ||
| 19 | + import org.jboss.elemento.Finder; | ||
| 20 | + import org.jboss.elemento.HasElement; | ||
| 21 | + import org.jboss.elemento.TypedBuilder; | ||
| 22 | + import org.jboss.elemento.svg.HasSVGElement; | ||
| 23 | + import org.jboss.elemento.svg.SVGElement; | ||
| 24 | + | ||
| 25 | + import static java.util.Objects.requireNonNull; | ||
| 26 | + | ||
| 27 | + public abstract class BaseComponentSVG<E extends SVGElement, B extends TypedBuilder<E, B>> | ||
| 28 | + implements Component, HasElement<E, B>, HasSVGElement<E, B>, Finder<E>, Container<E, B> { | ||
| 29 | + | ||
| 30 | + private final E element; | ||
| 31 | + private final ComponentType componentType; | ||
| 32 | + | ||
| 33 | + protected BaseComponentSVG(E element, ComponentType componentType) { | ||
| 34 | + this.element = requireNonNull(element, "element required"); | ||
| 35 | + this.componentType = requireNonNull(componentType, "component type required"); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + @Override | ||
| 39 | + public E element() { | ||
| 40 | + return element; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + @Override | ||
| 44 | + public ComponentType componentType() { | ||
| 45 | + return componentType; | ||
| 46 | + } | ||
| 47 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,7 +33,7 @@ public enum ComponentType { | |||
| 33 | 33 | ||
| 34 | 34 | Breadcrumb("bc", null), | |
| 35 | 35 | ||
| 36 | - Button("btn", null), | ||
| 36 | + Button("btn", "PF5/Button"), | ||
| 37 | 37 | ||
| 38 | 38 | Card("crd", null), | |
| 39 | 39 | ||
@@ -101,13 +101,13 @@ public enum ComponentType { | |||
| 101 | 101 | ||
| 102 | 102 | Slider("sld", null), | |
| 103 | 103 | ||
| 104 | - Spinner("sp", null), | ||
| 104 | + Spinner("sp", "PF5/Spinner"), | ||
| 105 | 105 | ||
| 106 | 106 | Switch("sw", null), | |
| 107 | 107 | ||
| 108 | 108 | Tabs("tbs", null), | |
| 109 | 109 | ||
| 110 | - TextContent("tc", null), | ||
| 110 | + TextContent("tc", "PF5/TextContent"), | ||
| 111 | 111 | ||
| 112 | 112 | TextInput("ti", "PF5/TextInput"), | |
| 113 | 113 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments