FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Button, icon, spinner and text content component · patternfly-java/patternfly-java@b5602c5 · GitHub

Commit b5602c5

Browse files
committed
Button, icon, spinner and text content component
1 parent 90f89ac commit b5602c5

42 files changed

Lines changed: 816 additions & 610 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎src/demo/java/IconDemo.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public void iconDemo() {
2424

2525
public void progressDemo() {
2626
// @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 = "..."
2929
if (finished) {
3030
icon.inProgress(false);
3131
}

‎src/demo/java/MenuDemo.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.patternfly.component.menu.Menu;
22
import org.patternfly.component.menu.MenuItem;
33

4-
import static org.patternfly.component.Button.button;
4+
import static org.patternfly.component.button.Button.button;
55
import static org.patternfly.component.menu.Menu.menu;
66
import static org.patternfly.component.menu.MenuContent.menuContent;
77
import static org.patternfly.component.menu.MenuFooter.menuFooter;

‎src/demo/java/PageDemo.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import static org.patternfly.component.brand.Brand.brand;
2-
import static org.patternfly.component.Content.content;
32
import static org.patternfly.component.page.Masthead.pageMasthead;
43
import static org.patternfly.component.page.MastheadToggle.mastheadToggle;
54
import static org.patternfly.component.page.Page.page;
@@ -10,6 +9,7 @@
109
import static org.patternfly.component.page.PageMainSection.pageMainSection;
1110
import static org.patternfly.component.page.PageSidebar.pageSidebar;
1211
import static org.patternfly.component.page.SkipToContent.skipToContent;
12+
import static org.patternfly.component.text.TextContent.textContent;
1313
import static org.patternfly.component.toolbar.Toolbar.toolbar;
1414

1515
public class PageDemo {
@@ -41,13 +41,13 @@ public void pageMainBodyDemo() {
4141
.addSection(pageMainBreadcrumb()
4242
.limitWidth()
4343
.addBody(pageMainBody()
44-
.add(content())))
44+
.add(textContent())))
4545
.addSection(pageMainSection()
46-
.add(content()))
46+
.add(textContent()))
4747
.addSection(pageMainSection()
4848
.limitWidth()
4949
.addBody(pageMainBody()
50-
.add(content())));
50+
.add(textContent())));
5151
// @end region = pageMainBody
5252
}
5353

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

‎src/main/java/org/patternfly/component/Button.java‎

Lines changed: 0 additions & 273 deletions
This file was deleted.

‎src/main/java/org/patternfly/component/ComponentType.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public enum ComponentType {
3333

3434
Breadcrumb("bc", null),
3535

36-
Button("btn", null),
36+
Button("btn", "PF5/Button"),
3737

3838
Card("crd", null),
3939

@@ -101,13 +101,13 @@ public enum ComponentType {
101101

102102
Slider("sld", null),
103103

104-
Spinner("sp", null),
104+
Spinner("sp", "PF5/Spinner"),
105105

106106
Switch("sw", null),
107107

108108
Tabs("tbs", null),
109109

110-
TextContent("tc", null),
110+
TextContent("tc", "PF5/TextContent"),
111111

112112
TextInput("ti", "PF5/TextInput"),
113113

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL