Skip to content

Commit 515d392

Browse files
committed
HAL-2047: enhance table builder, add name/index columns
1 parent 840f6f7 commit 515d392

Some content is hidden

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

42 files changed

+76
-69
lines changed

app/src/main/java/org/jboss/hal/client/configuration/SocketBindingGroupView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void init() {
8686
table -> presenter.addSocketBinding(INBOUND)))
8787
.button(mbuiContext.tableButtonFactory().remove(inboundTemplate,
8888
table -> presenter.removeSocketBinding(INBOUND, table.selectedRow().getName())))
89-
.column(NAME, (cell, type, row, meta) -> row.getName())
89+
.nameColumn()
9090
.column(PORT, (cell, type, row, meta) -> row.get(PORT).asString())
9191
.column(new InlineAction<>(Names.CLIENT_MAPPINGS, row -> presenter.showClientMappings(row)))
9292
.build();

app/src/main/java/org/jboss/hal/client/configuration/SystemPropertiesView.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import static org.jboss.hal.ballroom.LayoutBuilder.row;
4343
import static org.jboss.hal.client.configuration.SystemPropertiesPresenter.ROOT_TEMPLATE;
4444
import static org.jboss.hal.dmr.ModelDescriptionConstants.BOOT_TIME;
45-
import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
4645
import static org.jboss.hal.dmr.ModelDescriptionConstants.VALUE;
4746

4847
public class SystemPropertiesView extends HalViewImpl implements SystemPropertiesPresenter.MyView {
@@ -74,7 +73,7 @@ public SystemPropertiesView(Environment environment, MetadataRegistry metadataRe
7473
.button(tableButtonFactory.remove(Names.SYSTEM_PROPERTY, ROOT_TEMPLATE,
7574
table -> table.selectedRow().getName(),
7675
() -> presenter.reload()))
77-
.column(NAME, (cell, type, row, meta) -> row.getName())
76+
.nameColumn()
7877
.column(VALUE);
7978
if (!environment.isStandalone()) {
8079
tb.column("boot-time");

app/src/main/java/org/jboss/hal/client/configuration/subsystem/distributableweb/DistributableWebView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void init() {
165165
SessionManagement.HOTROD.template,
166166
table -> table.selectedRow().getName(),
167167
() -> presenter.reload()))
168-
.column("name", (cell, type, row, meta) -> row.getName())
168+
.nameColumn()
169169
.build();
170170
hotRodSessionManagementAffinityElement = new AffinityElement(SessionManagement.HOTROD, mbuiContext.metadataRegistry(),
171171
mbuiContext.resources());
@@ -197,7 +197,7 @@ void init() {
197197
SessionManagement.INFINISPAN.template,
198198
table -> table.selectedRow().getName(),
199199
() -> presenter.reload()))
200-
.column("name", (cell, type, row, meta) -> row.getName())
200+
.nameColumn()
201201
.build();
202202
infinispanSessionManagementAffinityElement = new AffinityElement(SessionManagement.INFINISPAN,
203203
mbuiContext.metadataRegistry(), mbuiContext.resources());

app/src/main/java/org/jboss/hal/client/configuration/subsystem/ee/EEView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ private HTMLElement buildServicePanel(String baseId, AddressTemplate template, S
290290

291291
Table<NamedNode> table = new ModelNodeTable.Builder<NamedNode>(Ids.build(baseId, Ids.TABLE),
292292
metadata)
293-
.column(NAME, (cell, t, row, meta) -> row.getName())
293+
.nameColumn()
294294
.button(tableButtonFactory.add(Ids.build(baseId, Ids.ADD), type, template,
295295
(name, address) -> presenter.reload()))
296296
.button(tableButtonFactory.remove(type, template, (api) -> api.selectedRow().getName(),

app/src/main/java/org/jboss/hal/client/configuration/subsystem/ejb/EjbView.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
import static org.jboss.hal.dmr.ModelDescriptionConstants.DEFAULT_SFSB_CACHE;
7070
import static org.jboss.hal.dmr.ModelDescriptionConstants.DEFAULT_SFSB_PASSIVATION_DISABLED_CACHE;
7171
import static org.jboss.hal.dmr.ModelDescriptionConstants.DEFAULT_SLSB_INSTANCE_POOL;
72-
import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
7372
import static org.jboss.hal.dmr.ModelDescriptionConstants.PASSIVATION_STORE;
7473
import static org.jboss.hal.dmr.ModelDescriptionConstants.SERVICE;
7574
import static org.jboss.hal.dmr.ModelDescriptionConstants.TYPE;
@@ -153,7 +152,7 @@ void init() {
153152
(name, address) -> presenter.reload()))
154153
.button(mbuiContext.tableButtonFactory().remove(Names.APPLICATION_SECURITY_DOMAIN, template,
155154
(api) -> api.selectedRow().getName(), () -> presenter.reload()))
156-
.column(NAME, (cell, type, row, meta) -> row.getName())
155+
.nameColumn()
157156
.build();
158157

159158
appSecurityDomainForm = new ModelNodeForm.Builder<NamedNode>(Ids.EJB3_APPLICATION_SECURITY_DOMAIN_FORM,
@@ -209,7 +208,7 @@ void init() {
209208
.button(mbuiContext.tableButtonFactory().remove(rpTypeLabel, REMOTING_PROFILE_TEMPLATE,
210209
table -> table.selectedRow().getName(),
211210
() -> presenter.reload()))
212-
.column(NAME, (cell, type, row, meta) -> row.getName())
211+
.nameColumn()
213212
.column(ejbReceiverPage.makeInlineAction(), "20em")
214213
.column(httpConnectionPage.makeInlineAction(), "20em")
215214
.build();
@@ -261,7 +260,7 @@ void init() {
261260
.button(mbuiContext.tableButtonFactory().remove(RER_CHANNEL_CREATION_OPTIONS_TEMPLATE,
262261
table -> presenter.removeRerChannelCreationOptions(ccoTypeLabel, table.selectedRow().getName(),
263262
selectedRemotingProfile, selectedEjbReceiver)))
264-
.column(NAME, (cell, type, row, meta) -> row.getName())
263+
.nameColumn()
265264
.columns(TYPE, VALUE)
266265
.build();
267266

@@ -426,7 +425,7 @@ public RemotingProfileSubpage(AddressTemplate template) {
426425
.button(mbuiContext.tableButtonFactory().remove(template,
427426
table -> presenter.removeRemotingProfileChild(label, table.selectedRow().getName(),
428427
selectedRemotingProfile, childType, template)))
429-
.column(NAME, (cell, t, row, meta) -> row.getName())
428+
.nameColumn()
430429
.columns(columnNames);
431430

432431
if (childType.equals(ER_TYPE)) {

app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/HttpAuthenticationFactoryElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class HttpAuthenticationFactoryElement implements IsElement<HTMLElement>, Attach
6868
metadata.getTemplate(), (n, a) -> presenter.reloadHttpAuthenticationFactories()))
6969
.button(tableButtonFactory.remove(Names.HTTP_AUTHENTICATION_FACTORY, metadata.getTemplate(),
7070
(table) -> table.selectedRow().getName(), () -> presenter.reloadHttpAuthenticationFactories()))
71-
.column(NAME, (cell, type, row, meta) -> row.getName())
71+
.nameColumn()
7272
.column(new InlineAction<>(Names.MECHANISM_CONFIGURATIONS, this::showMechanismConfiguration), "15em")
7373
.build();
7474
factoryForm = new ModelNodeForm.Builder<NamedNode>(id(FORM), metadata)

app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/JdbcRealmElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class JdbcRealmElement implements IsElement<HTMLElement>, Attachable, HasPresent
6767
.button(tableButtonFactory.add(metadata.getTemplate(), table -> presenter.addJdbcRealm()))
6868
.button(tableButtonFactory.remove(Names.JDBC_REALM, metadata.getTemplate(),
6969
(table) -> table.selectedRow().getName(), () -> presenter.reloadJdbcRealms()))
70-
.column(NAME, (cell, type, row, meta) -> row.getName())
70+
.nameColumn()
7171
.column(new InlineAction<>(Names.PRINCIPAL_QUERY, this::showPrincipalQuery))
7272
.build();
7373
HTMLElement jdbcRealmSection = section()

app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapKeyStoreElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class LdapKeyStoreElement implements IsElement<HTMLElement>, Attachable, HasPres
6161
asList(DIR_CONTEXT, SEARCH_PATH), (n, a) -> presenter.reloadLdapKeyStores()))
6262
.button(tableButtonFactory.remove(Names.LDAP_KEY_STORE, metadata.getTemplate(),
6363
(table) -> table.selectedRow().getName(), () -> presenter.reloadLdapKeyStores()))
64-
.column(NAME, (cell, type, row, meta) -> row.getName())
64+
.nameColumn()
6565
.build();
6666

6767
attributes = new ModelNodeForm.Builder<NamedNode>(id(FORM), metadata)

app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapRealmElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class LdapRealmElement implements IsElement<HTMLElement>, Attachable, Has
6868
.button(tableButtonFactory.add(metadata.getTemplate(), table -> presenter.addLdapRealm()))
6969
.button(tableButtonFactory.remove(Names.LDAP_REALM, metadata.getTemplate(),
7070
(table) -> table.selectedRow().getName(), () -> presenter.reloadLdapRealms()))
71-
.column(NAME, (cell, type, row, meta) -> row.getName())
71+
.nameColumn()
7272
.column(new InlineAction<>(Names.IDENTITY_ATTRIBUTE_MAPPING, this::showIdentityAttributeMapping),
7373
"15em")
7474
.build();

app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/MapperDecoderView.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import static org.jboss.hal.dmr.ModelDescriptionConstants.FROM;
5151
import static org.jboss.hal.dmr.ModelDescriptionConstants.MAPPED_ROLE_MAPPER;
5252
import static org.jboss.hal.dmr.ModelDescriptionConstants.MODULE;
53-
import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
5453
import static org.jboss.hal.dmr.ModelDescriptionConstants.PERMISSIONS;
5554
import static org.jboss.hal.dmr.ModelDescriptionConstants.ROLE_MAP;
5655
import static org.jboss.hal.dmr.ModelDescriptionConstants.TABLE;
@@ -123,7 +122,7 @@ void init() {
123122
Metadata metadata = mbuiContext.metadataRegistry().lookup(CONSTANT_PERMISSION_MAPPER_TEMPLATE);
124123
constantPermissionMapperElement = new ResourceElement.Builder(Ids.ELYTRON_CONSTANT_PERMISSION_MAPPER,
125124
CONSTANT_PERMISSION_MAPPER, metadata, mbuiContext)
126-
.column(NAME, (cell, type, row, meta) -> row.getName())
125+
.nameColumn()
127126
.setComplexListAttribute(PERMISSIONS, asList(CLASS_NAME, MODULE), asList(CLASS_NAME, MODULE),
128127
modelNode -> build(modelNode.get(CLASS_NAME).asString(), modelNode.get(MODULE).asString()))
129128
.onCrud(() -> presenter.reload(CONSTANT_PERMISSION_MAPPER, this::updateConstantPermissionMapper))
@@ -148,7 +147,7 @@ void init() {
148147
.button(mbuiContext.tableButtonFactory().remove(title, MAPPED_ROLE_MAPPER_TEMPLATE,
149148
table -> table.selectedRow().getName(),
150149
() -> presenter.reload()))
151-
.column(NAME, (cell, type, row, meta) -> row.getName())
150+
.nameColumn()
152151
.build();
153152

154153
mappedRoleMapperForm = new ModelNodeForm.Builder<NamedNode>(build(mappedId, FORM), mappedMetadata)

0 commit comments

Comments
 (0)