From 515d392d5207f418a844a5338b7bc6c8394e979d Mon Sep 17 00:00:00 2001 From: Michal Petrov Date: Fri, 9 Jan 2026 17:52:14 +0100 Subject: [PATCH] HAL-2047: enhance table builder, add name/index columns --- .../configuration/SocketBindingGroupView.java | 2 +- .../configuration/SystemPropertiesView.java | 3 +-- .../DistributableWebView.java | 4 ++-- .../configuration/subsystem/ee/EEView.java | 2 +- .../configuration/subsystem/ejb/EjbView.java | 9 ++++----- .../HttpAuthenticationFactoryElement.java | 2 +- .../subsystem/elytron/JdbcRealmElement.java | 2 +- .../elytron/LdapKeyStoreElement.java | 2 +- .../subsystem/elytron/LdapRealmElement.java | 2 +- .../subsystem/elytron/MapperDecoderView.java | 5 ++--- .../SaslAuthenticationFactoryElement.java | 2 +- .../SimplePermissionMapperElement.java | 2 +- .../subsystem/infinispan/CacheViewImpl.java | 2 +- .../infinispan/RemoteCacheContainerView.java | 2 +- .../subsystem/jca/ThreadPoolsEditor.java | 2 +- .../subsystem/jgroups/ChannelElement.java | 3 +-- .../subsystem/jgroups/ForkElement.java | 3 +-- .../subsystem/jgroups/GenericElement.java | 3 +-- .../subsystem/jgroups/ProtocolElement.java | 4 ++-- .../subsystem/jgroups/RelayElement.java | 3 +-- .../subsystem/jgroups/StackElement.java | 3 +-- .../subsystem/logging/LoggingProfileView.java | 4 ++-- .../subsystem/logging/LoggingView.java | 4 ++-- .../subsystem/messaging/ClusteringView.java | 2 +- .../subsystem/messaging/ConnectionView.java | 2 +- .../messaging/RemoteActiveMQView.java | 2 +- .../undertow/HttpsListenerElement.java | 3 +-- .../subsystem/undertow/ListenerElement.java | 3 +-- .../subsystem/undertow/ServerView.java | 3 +-- .../subsystem/webservice/ConfigElement.java | 3 +-- .../webservice/HandlerChainElement.java | 3 +-- .../subsystem/webservice/HandlerElement.java | 3 +-- .../elytron/ElytronRealmWithIdentity.java | 2 +- .../subsystem/elytron/KeyStoreElement.java | 2 +- .../runtime/subsystem/elytron/RealmsView.java | 4 ++-- .../runtime/subsystem/elytron/SSLView.java | 9 ++++----- .../subsystem/elytron/StoreElement.java | 3 +-- .../client/runtime/subsystem/jpa/JpaView.java | 3 +-- .../health/MicroProfileHealthView.java | 2 +- .../CoreManagementView.mbui.xml | 1 + .../jboss/hal/core/mbui/ResourceElement.java | 5 +++++ .../hal/core/mbui/table/ModelNodeTable.java | 20 ++++++++++++++++++- 42 files changed, 76 insertions(+), 69 deletions(-) diff --git a/app/src/main/java/org/jboss/hal/client/configuration/SocketBindingGroupView.java b/app/src/main/java/org/jboss/hal/client/configuration/SocketBindingGroupView.java index fe31524089..a0380f6143 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/SocketBindingGroupView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/SocketBindingGroupView.java @@ -86,7 +86,7 @@ void init() { table -> presenter.addSocketBinding(INBOUND))) .button(mbuiContext.tableButtonFactory().remove(inboundTemplate, table -> presenter.removeSocketBinding(INBOUND, table.selectedRow().getName()))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(PORT, (cell, type, row, meta) -> row.get(PORT).asString()) .column(new InlineAction<>(Names.CLIENT_MAPPINGS, row -> presenter.showClientMappings(row))) .build(); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/SystemPropertiesView.java b/app/src/main/java/org/jboss/hal/client/configuration/SystemPropertiesView.java index 64d7d9fb36..78915c7b5b 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/SystemPropertiesView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/SystemPropertiesView.java @@ -42,7 +42,6 @@ import static org.jboss.hal.ballroom.LayoutBuilder.row; import static org.jboss.hal.client.configuration.SystemPropertiesPresenter.ROOT_TEMPLATE; import static org.jboss.hal.dmr.ModelDescriptionConstants.BOOT_TIME; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.dmr.ModelDescriptionConstants.VALUE; public class SystemPropertiesView extends HalViewImpl implements SystemPropertiesPresenter.MyView { @@ -74,7 +73,7 @@ public SystemPropertiesView(Environment environment, MetadataRegistry metadataRe .button(tableButtonFactory.remove(Names.SYSTEM_PROPERTY, ROOT_TEMPLATE, table -> table.selectedRow().getName(), () -> presenter.reload())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(VALUE); if (!environment.isStandalone()) { tb.column("boot-time"); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/distributableweb/DistributableWebView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/distributableweb/DistributableWebView.java index d2fa31f2b7..a65142fc99 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/distributableweb/DistributableWebView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/distributableweb/DistributableWebView.java @@ -165,7 +165,7 @@ void init() { SessionManagement.HOTROD.template, table -> table.selectedRow().getName(), () -> presenter.reload())) - .column("name", (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); hotRodSessionManagementAffinityElement = new AffinityElement(SessionManagement.HOTROD, mbuiContext.metadataRegistry(), mbuiContext.resources()); @@ -197,7 +197,7 @@ void init() { SessionManagement.INFINISPAN.template, table -> table.selectedRow().getName(), () -> presenter.reload())) - .column("name", (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); infinispanSessionManagementAffinityElement = new AffinityElement(SessionManagement.INFINISPAN, mbuiContext.metadataRegistry(), mbuiContext.resources()); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/ee/EEView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/ee/EEView.java index fd53190c38..0d62e281bb 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/ee/EEView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/ee/EEView.java @@ -290,7 +290,7 @@ private HTMLElement buildServicePanel(String baseId, AddressTemplate template, S Table table = new ModelNodeTable.Builder(Ids.build(baseId, Ids.TABLE), metadata) - .column(NAME, (cell, t, row, meta) -> row.getName()) + .nameColumn() .button(tableButtonFactory.add(Ids.build(baseId, Ids.ADD), type, template, (name, address) -> presenter.reload())) .button(tableButtonFactory.remove(type, template, (api) -> api.selectedRow().getName(), diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/ejb/EjbView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/ejb/EjbView.java index 38d8d10dfc..7e58a6adbb 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/ejb/EjbView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/ejb/EjbView.java @@ -69,7 +69,6 @@ import static org.jboss.hal.dmr.ModelDescriptionConstants.DEFAULT_SFSB_CACHE; import static org.jboss.hal.dmr.ModelDescriptionConstants.DEFAULT_SFSB_PASSIVATION_DISABLED_CACHE; import static org.jboss.hal.dmr.ModelDescriptionConstants.DEFAULT_SLSB_INSTANCE_POOL; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.dmr.ModelDescriptionConstants.PASSIVATION_STORE; import static org.jboss.hal.dmr.ModelDescriptionConstants.SERVICE; import static org.jboss.hal.dmr.ModelDescriptionConstants.TYPE; @@ -153,7 +152,7 @@ void init() { (name, address) -> presenter.reload())) .button(mbuiContext.tableButtonFactory().remove(Names.APPLICATION_SECURITY_DOMAIN, template, (api) -> api.selectedRow().getName(), () -> presenter.reload())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); appSecurityDomainForm = new ModelNodeForm.Builder(Ids.EJB3_APPLICATION_SECURITY_DOMAIN_FORM, @@ -209,7 +208,7 @@ void init() { .button(mbuiContext.tableButtonFactory().remove(rpTypeLabel, REMOTING_PROFILE_TEMPLATE, table -> table.selectedRow().getName(), () -> presenter.reload())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(ejbReceiverPage.makeInlineAction(), "20em") .column(httpConnectionPage.makeInlineAction(), "20em") .build(); @@ -261,7 +260,7 @@ void init() { .button(mbuiContext.tableButtonFactory().remove(RER_CHANNEL_CREATION_OPTIONS_TEMPLATE, table -> presenter.removeRerChannelCreationOptions(ccoTypeLabel, table.selectedRow().getName(), selectedRemotingProfile, selectedEjbReceiver))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .columns(TYPE, VALUE) .build(); @@ -426,7 +425,7 @@ public RemotingProfileSubpage(AddressTemplate template) { .button(mbuiContext.tableButtonFactory().remove(template, table -> presenter.removeRemotingProfileChild(label, table.selectedRow().getName(), selectedRemotingProfile, childType, template))) - .column(NAME, (cell, t, row, meta) -> row.getName()) + .nameColumn() .columns(columnNames); if (childType.equals(ER_TYPE)) { diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/HttpAuthenticationFactoryElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/HttpAuthenticationFactoryElement.java index e5a7b081e0..7af8aff28f 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/HttpAuthenticationFactoryElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/HttpAuthenticationFactoryElement.java @@ -68,7 +68,7 @@ class HttpAuthenticationFactoryElement implements IsElement, Attach metadata.getTemplate(), (n, a) -> presenter.reloadHttpAuthenticationFactories())) .button(tableButtonFactory.remove(Names.HTTP_AUTHENTICATION_FACTORY, metadata.getTemplate(), (table) -> table.selectedRow().getName(), () -> presenter.reloadHttpAuthenticationFactories())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(Names.MECHANISM_CONFIGURATIONS, this::showMechanismConfiguration), "15em") .build(); factoryForm = new ModelNodeForm.Builder(id(FORM), metadata) diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/JdbcRealmElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/JdbcRealmElement.java index e853c35c5e..bf17dfe229 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/JdbcRealmElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/JdbcRealmElement.java @@ -67,7 +67,7 @@ class JdbcRealmElement implements IsElement, Attachable, HasPresent .button(tableButtonFactory.add(metadata.getTemplate(), table -> presenter.addJdbcRealm())) .button(tableButtonFactory.remove(Names.JDBC_REALM, metadata.getTemplate(), (table) -> table.selectedRow().getName(), () -> presenter.reloadJdbcRealms())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(Names.PRINCIPAL_QUERY, this::showPrincipalQuery)) .build(); HTMLElement jdbcRealmSection = section() diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapKeyStoreElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapKeyStoreElement.java index cd4656678f..4c99f77669 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapKeyStoreElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapKeyStoreElement.java @@ -61,7 +61,7 @@ class LdapKeyStoreElement implements IsElement, Attachable, HasPres asList(DIR_CONTEXT, SEARCH_PATH), (n, a) -> presenter.reloadLdapKeyStores())) .button(tableButtonFactory.remove(Names.LDAP_KEY_STORE, metadata.getTemplate(), (table) -> table.selectedRow().getName(), () -> presenter.reloadLdapKeyStores())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); attributes = new ModelNodeForm.Builder(id(FORM), metadata) diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapRealmElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapRealmElement.java index 2ecb49e444..a55b726440 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapRealmElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/LdapRealmElement.java @@ -68,7 +68,7 @@ public class LdapRealmElement implements IsElement, Attachable, Has .button(tableButtonFactory.add(metadata.getTemplate(), table -> presenter.addLdapRealm())) .button(tableButtonFactory.remove(Names.LDAP_REALM, metadata.getTemplate(), (table) -> table.selectedRow().getName(), () -> presenter.reloadLdapRealms())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(Names.IDENTITY_ATTRIBUTE_MAPPING, this::showIdentityAttributeMapping), "15em") .build(); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/MapperDecoderView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/MapperDecoderView.java index bf857d9452..9dc7868e84 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/MapperDecoderView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/MapperDecoderView.java @@ -50,7 +50,6 @@ import static org.jboss.hal.dmr.ModelDescriptionConstants.FROM; import static org.jboss.hal.dmr.ModelDescriptionConstants.MAPPED_ROLE_MAPPER; import static org.jboss.hal.dmr.ModelDescriptionConstants.MODULE; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.dmr.ModelDescriptionConstants.PERMISSIONS; import static org.jboss.hal.dmr.ModelDescriptionConstants.ROLE_MAP; import static org.jboss.hal.dmr.ModelDescriptionConstants.TABLE; @@ -123,7 +122,7 @@ void init() { Metadata metadata = mbuiContext.metadataRegistry().lookup(CONSTANT_PERMISSION_MAPPER_TEMPLATE); constantPermissionMapperElement = new ResourceElement.Builder(Ids.ELYTRON_CONSTANT_PERMISSION_MAPPER, CONSTANT_PERMISSION_MAPPER, metadata, mbuiContext) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .setComplexListAttribute(PERMISSIONS, asList(CLASS_NAME, MODULE), asList(CLASS_NAME, MODULE), modelNode -> build(modelNode.get(CLASS_NAME).asString(), modelNode.get(MODULE).asString())) .onCrud(() -> presenter.reload(CONSTANT_PERMISSION_MAPPER, this::updateConstantPermissionMapper)) @@ -148,7 +147,7 @@ void init() { .button(mbuiContext.tableButtonFactory().remove(title, MAPPED_ROLE_MAPPER_TEMPLATE, table -> table.selectedRow().getName(), () -> presenter.reload())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); mappedRoleMapperForm = new ModelNodeForm.Builder(build(mappedId, FORM), mappedMetadata) diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/SaslAuthenticationFactoryElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/SaslAuthenticationFactoryElement.java index c14a78040b..a928d79c92 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/SaslAuthenticationFactoryElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/SaslAuthenticationFactoryElement.java @@ -68,7 +68,7 @@ class SaslAuthenticationFactoryElement implements IsElement, Attach metadata.getTemplate(), (n, a) -> presenter.reloadSaslAuthenticationFactories())) .button(tableButtonFactory.remove(Names.SASL_AUTHENTICATION_FACTORY, metadata.getTemplate(), (table) -> table.selectedRow().getName(), () -> presenter.reloadSaslAuthenticationFactories())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(Names.MECHANISM_CONFIGURATIONS, this::showMechanismConfiguration), "15em") .build(); factoryForm = new ModelNodeForm.Builder(id(FORM), metadata) diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/SimplePermissionMapperElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/SimplePermissionMapperElement.java index ef949f65f1..2fe1e41409 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/SimplePermissionMapperElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/elytron/SimplePermissionMapperElement.java @@ -75,7 +75,7 @@ public class SimplePermissionMapperElement SIMPLE_PERMISSION_MAPPER_TEMPLATE, (name, address) -> presenter.reloadSimplePermissionMapper())) .button(tableButtonFactory.remove(Names.SIMPLE_PERMISSION_MAPPER, metadata.getTemplate(), (table) -> table.selectedRow().getName(), () -> presenter.reloadSimplePermissionMapper())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(Names.PERMISSION_MAPPINGS, this::showPermissionMappings), "15em") .build(); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/infinispan/CacheViewImpl.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/infinispan/CacheViewImpl.java index c246108cdd..31effc7003 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/infinispan/CacheViewImpl.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/infinispan/CacheViewImpl.java @@ -141,7 +141,7 @@ private void initBackups(CacheType cacheType, MetadataRegistry metadataRegistry, .button(tableButtonFactory.add(backupTemplate, table -> presenter.addBackup())) .button(tableButtonFactory.remove(backupTemplate, table -> presenter.removeBackup(table.selectedRow().getName()))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); backupForm = new ModelNodeForm.Builder(Ids.build(cacheType.baseId, BACKUPS, Ids.FORM), diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/infinispan/RemoteCacheContainerView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/infinispan/RemoteCacheContainerView.java index 12519aed39..482f18054d 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/infinispan/RemoteCacheContainerView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/infinispan/RemoteCacheContainerView.java @@ -85,7 +85,7 @@ public RemoteCacheContainerView(MetadataRegistry metadataRegistry, TableButtonFa .button(tableButtonFactory.add(REMOTE_CLUSTER_TEMPLATE, table -> presenter.addRemoteCluster())) .button(tableButtonFactory.remove(REMOTE_CLUSTER_TEMPLATE, table -> presenter.removeRemoteCluster(table.selectedRow().getName()))) - .column(resources.constants().name(), (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(Names.SOCKET_BINDINGS, (cell, type, row, meta) -> { ModelNode socketBindings = row.get(SOCKET_BINDINGS); if (socketBindings.isDefined()) { diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jca/ThreadPoolsEditor.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jca/ThreadPoolsEditor.java index ab87d0fec6..ea2beb35c3 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jca/ThreadPoolsEditor.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jca/ThreadPoolsEditor.java @@ -79,7 +79,7 @@ class ThreadPoolsEditor implements IsElement, Attachable, HasPresen .button(tableButtonFactory.remove(WORKMANAGER_LRT_TEMPLATE, table -> presenter.removeThreadPool(workmanagerTemplate, workmanager, table.selectedRow()))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(resources.constants().type(), (cell, type, row, meta) -> row.getRunningMode()) .column(MAX_THREADS) .build(); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ChannelElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ChannelElement.java index 16e16e6cf0..cb1bed8cc2 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ChannelElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ChannelElement.java @@ -42,7 +42,6 @@ import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.CHANNEL_FORK_PROTOCOL_TEMPLATE; import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.CHANNEL_TEMPLATE; import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.SELECTED_CHANNEL_FORK_PROTOCOL_TEMPLATE; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; /** Element to configure the fork resource */ class ChannelElement implements IsElement, Attachable, HasPresenter { @@ -72,7 +71,7 @@ class ChannelElement implements IsElement, Attachable, HasPresenter .button(tableButtonFactory.remove(CHANNEL_TEMPLATE, table -> presenter.removeResource(CHANNEL_TEMPLATE, table.selectedRow().getName(), Names.CHANNEL))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(Names.FORK, row -> { selectedChannel = row.getName(); presenter.showForks(row); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ForkElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ForkElement.java index 374292f3a4..d288f34a97 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ForkElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ForkElement.java @@ -39,7 +39,6 @@ import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.CHANNEL_FORK_TEMPLATE; import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.SELECTED_CHANNEL_FORK_TEMPLATE; import static org.jboss.hal.client.configuration.subsystem.jgroups.ChannelElement.PROTOCOL_ID; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; public class ForkElement implements IsElement, Attachable, HasPresenter { @@ -66,7 +65,7 @@ public class ForkElement implements IsElement, Attachable, HasPrese .button(tableButtonFactory.remove(CHANNEL_FORK_TEMPLATE, table -> presenter.removeResource(SELECTED_CHANNEL_FORK_TEMPLATE, table.selectedRow().getName(), Names.FORK))) - .column(NAME, (cell, t, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(Names.PROTOCOL, row -> { presenter.showChannelProtocol(row); presenter.showChannelInnerPage(PROTOCOL_ID); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/GenericElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/GenericElement.java index 04d1ab0791..0f7092769f 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/GenericElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/GenericElement.java @@ -36,7 +36,6 @@ import static org.jboss.elemento.Elements.h; import static org.jboss.elemento.Elements.p; import static org.jboss.elemento.Elements.section; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; public class GenericElement implements IsElement, Attachable, HasPresenter { @@ -57,7 +56,7 @@ public class GenericElement implements IsElement, Attachable, HasPr Ids.build(resourceId, Ids.ADD, Ids.FORM), name))) .button(tableButtonFactory.remove(template, table -> presenter.removeResource(template, table.selectedRow().getName(), name))) - .column(NAME, (cell, t, row, meta) -> row.getName()) + .nameColumn() .build(); form = new ModelNodeForm.Builder(Ids.build(resourceId, Ids.FORM), metadata) .onSave((form, changedValues) -> presenter diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ProtocolElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ProtocolElement.java index 13c4f3a895..05d517a9a3 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ProtocolElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/ProtocolElement.java @@ -50,7 +50,6 @@ import static org.jboss.elemento.Elements.p; import static org.jboss.elemento.Elements.section; import static org.jboss.hal.client.configuration.subsystem.jgroups.JGroupsPresenter.AUTH; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.dmr.ModelDescriptionConstants.TOKEN; public class ProtocolElement implements IsElement, Attachable, HasPresenter { @@ -86,7 +85,8 @@ public class ProtocolElement implements IsElement, Attachable, HasP .button(tableButtonFactory.add(template, launchWizard)) .button(tableButtonFactory.remove(template, table -> presenter.removeResource(template, table.selectedRow().getName(), resourceName))) - .column(NAME, (cell, t, row, meta) -> row.getName()) + .indexColumn() + .nameColumn() .build(); form = createForm(metadata); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/RelayElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/RelayElement.java index 7316c1eb23..56f7295a89 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/RelayElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/RelayElement.java @@ -41,7 +41,6 @@ import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.RELAY_TEMPLATE; import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.SELECTED_RELAY_TEMPLATE; import static org.jboss.hal.client.configuration.subsystem.jgroups.StackElement.REMOTE_SITE_ID; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; public class RelayElement implements IsElement, Attachable, HasPresenter { @@ -61,7 +60,7 @@ public class RelayElement implements IsElement, Attachable, HasPres .button(tableButtonFactory.remove(RELAY_TEMPLATE, table -> presenter.removeResource(SELECTED_RELAY_TEMPLATE, table.selectedRow().getName(), Names.RELAY))) - .column(NAME, (cell, t, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(Names.REMOTE_SITE, row -> { presenter.showRemoteSites(row); presenter.showStackInnerPage(REMOTE_SITE_ID); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/StackElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/StackElement.java index de1910a06e..207d98cb17 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/StackElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/jgroups/StackElement.java @@ -41,7 +41,6 @@ import static org.jboss.elemento.Elements.p; import static org.jboss.elemento.Elements.section; import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.*; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; /** Element to configure the stack resource */ class StackElement implements IsElement, Attachable, HasPresenter { @@ -90,7 +89,7 @@ class StackElement implements IsElement, Attachable, HasPresenter presenter.removeResource(STACK_TEMPLATE, table.selectedRow().getName(), Names.STACK))) - .column(NAME, (cell, t, row, meta) -> row.getName()) + .nameColumn() .column(inlineActions) .build(); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/logging/LoggingProfileView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/logging/LoggingProfileView.java index 8e38177ca2..f7ba635050 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/logging/LoggingProfileView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/logging/LoggingProfileView.java @@ -221,7 +221,7 @@ void init() { .button(constants.remove(), table -> crud().remove(Names.JSON_FORMATTER, table.selectedRow().getName(), jsonTemplate.replaceWildcards(presenter.getLoggingProfile()), () -> presenter.reload()), Constraint.executable(jsonTemplate, REMOVE)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); jsonFormatterForm = new ModelNodeForm.Builder(Ids.build(LOGGING_PROFILE, JSON, FORMATTER, FORM), @@ -293,7 +293,7 @@ void init() { .button(constants.remove(), table -> crud().remove(Names.XML_FORMATTER, table.selectedRow().getName(), xmlTemplate.replaceWildcards(presenter.getLoggingProfile()), () -> presenter.reload()), Constraint.executable(xmlTemplate, REMOVE)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); xmlFormatterForm = new ModelNodeForm.Builder(Ids.build(LOGGING_PROFILE, XML, FORMATTER, FORM), diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/logging/LoggingView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/logging/LoggingView.java index 7f97d38130..8dd7852d99 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/logging/LoggingView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/logging/LoggingView.java @@ -138,7 +138,7 @@ void init() { JSON_FORMATTER_TEMPLATE, (name, address) -> presenter.reload())) .button(mbuiContext.tableButtonFactory().remove(jsonLabel, JSON_FORMATTER_TEMPLATE, table -> table.selectedRow().getName(), () -> presenter.reload())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); jsonFormatterForm = new ModelNodeForm.Builder(Ids.build(LOGGING, JSON, FORMATTER, FORM), @@ -200,7 +200,7 @@ void init() { XML_FORMATTER_TEMPLATE, (name, address) -> presenter.reload())) .button(mbuiContext.tableButtonFactory().remove(xmlLabel, XML_FORMATTER_TEMPLATE, table -> table.selectedRow().getName(), () -> presenter.reload())) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); xmlFormatterForm = new ModelNodeForm.Builder(Ids.build(LOGGING, XML, FORMATTER, FORM), xmlMetadata) diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/ClusteringView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/ClusteringView.java index a075786aa4..d7d24fc5e9 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/ClusteringView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/ClusteringView.java @@ -103,7 +103,7 @@ void init() { .button(mbuiContext.resources().constants().remove(), table -> presenter.remove(ServerSubResource.BRIDGE, table.selectedRow()), Scope.SELECTED, Constraint.executable(BRIDGE_TEMPLATE, REMOVE)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); bridgeForm = new ModelNodeForm.Builder(Ids.build(Ids.MESSAGING_BRIDGE, Ids.FORM), metadata) diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/ConnectionView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/ConnectionView.java index a897946fcb..ed61c59212 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/ConnectionView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/ConnectionView.java @@ -115,7 +115,7 @@ void init() { table -> presenter.remove(ServerSubResource.POOLED_CONNECTION_FACTORY, table.selectedRow()), Scope.SELECTED, Constraint.executable(POOLED_CONNECTION_FACTORY_TEMPLATE, REMOVE)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); pooledConnectionFactoryForm = new ModelNodeForm.Builder( diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/RemoteActiveMQView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/RemoteActiveMQView.java index 5b23507aea..424d84a980 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/RemoteActiveMQView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/messaging/RemoteActiveMQView.java @@ -111,7 +111,7 @@ void init() { table.selectedRow()), Scope.SELECTED, Constraint.executable(POOLED_CONNECTION_FACTORY_TEMPLATE, REMOVE)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); pooledConnectionFactoryForm = new ModelNodeForm.Builder( diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/HttpsListenerElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/HttpsListenerElement.java index d34432d438..56bda5b05a 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/HttpsListenerElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/HttpsListenerElement.java @@ -40,7 +40,6 @@ import static org.jboss.elemento.EventType.click; import static org.jboss.hal.client.configuration.subsystem.undertow.AddressTemplates.SERVER_TEMPLATE; import static org.jboss.hal.client.configuration.subsystem.undertow.Listener.HTTPS; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.dmr.ModelDescriptionConstants.SSL_CONTEXT; import static org.jboss.hal.resources.CSS.halTableButtons; import static org.jboss.hal.resources.Ids.ENABLE_SSL; @@ -67,7 +66,7 @@ class HttpsListenerElement extends ListenerElement { .button(tableButtonFactory.add(template, table -> presenter.addListener(HTTPS))) .button(tableButtonFactory.remove(template, table -> presenter.removeListener(HTTPS, table.selectedRow().getName()))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); form = new ModelNodeForm.Builder(Ids.build(HTTPS.baseId, Ids.FORM), metadata) diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/ListenerElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/ListenerElement.java index 64283385cb..47a9360412 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/ListenerElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/ListenerElement.java @@ -37,7 +37,6 @@ import static org.jboss.elemento.Elements.p; import static org.jboss.elemento.Elements.section; import static org.jboss.hal.client.configuration.subsystem.undertow.AddressTemplates.SERVER_TEMPLATE; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; class ListenerElement implements IsElement, Attachable, HasPresenter { @@ -58,7 +57,7 @@ class ListenerElement implements IsElement, Attachable, HasPresente .button(tableButtonFactory.add(template, table -> presenter.addListener(listenerType))) .button(tableButtonFactory.remove(template, table -> presenter.removeListener(listenerType, table.selectedRow().getName()))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); form = new ModelNodeForm.Builder(Ids.build(listenerType.baseId, Ids.FORM), metadata) diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/ServerView.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/ServerView.java index 30b67f3e46..395bcd97a8 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/ServerView.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/undertow/ServerView.java @@ -65,7 +65,6 @@ import static org.jboss.hal.dmr.ModelDescriptionConstants.HANDLER; import static org.jboss.hal.dmr.ModelDescriptionConstants.HOST; import static org.jboss.hal.dmr.ModelDescriptionConstants.LOCATION; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.dmr.ModelDescriptionConstants.PRIORITY; import static org.jboss.hal.dmr.ModelDescriptionConstants.SERVLET_CONTAINER; import static org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes; @@ -124,7 +123,7 @@ public ServerView(Dispatcher dispatcher, MetadataRegistry metadataRegistry, .button(tableButtonFactory.add(HOST_TEMPLATE, table -> presenter.addHost())) .button(tableButtonFactory.remove(HOST_TEMPLATE, table -> presenter.removeHost(table.selectedRow().getName()))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(inlineActions, "15em") .build(); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/ConfigElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/ConfigElement.java index bb92aae2b1..039c7d405e 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/ConfigElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/ConfigElement.java @@ -48,7 +48,6 @@ import static org.jboss.elemento.Elements.section; import static org.jboss.hal.client.configuration.subsystem.webservice.HandlerChain.POST_HANDLER_CHAIN; import static org.jboss.hal.client.configuration.subsystem.webservice.HandlerChain.PRE_HANDLER_CHAIN; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.dmr.ModelDescriptionConstants.PROPERTY; import static org.jboss.hal.dmr.ModelDescriptionConstants.VALUE; import static org.jboss.hal.dmr.ModelNodeHelper.failSafePropertyList; @@ -77,7 +76,7 @@ class ConfigElement implements IsElement, Attachable, HasPresenter< .button(tableButtonFactory.add(configType.template, table -> presenter.addConfig())) .button(tableButtonFactory.remove(configType.template, table -> presenter.removeConfig(table.selectedRow().getName()))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(inlineActions) .build(); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/HandlerChainElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/HandlerChainElement.java index 1eece8f10f..737c01ea8b 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/HandlerChainElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/HandlerChainElement.java @@ -37,7 +37,6 @@ import static org.jboss.elemento.Elements.h; import static org.jboss.elemento.Elements.section; import static org.jboss.hal.client.configuration.subsystem.webservice.AddressTemplates.HANDLER_CHAIN_TEMPLATE; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; /** Element to configure handler chains of a client or endpoint configuration. */ class HandlerChainElement implements IsElement, Attachable, HasPresenter { @@ -58,7 +57,7 @@ class HandlerChainElement implements IsElement, Attachable, HasPres .button(tableButtonFactory.add(HANDLER_CHAIN_TEMPLATE, table -> presenter.addHandlerChain())) .button(tableButtonFactory.remove(HANDLER_CHAIN_TEMPLATE, table -> presenter.removeHandlerChain(table.selectedRow().getName()))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(Names.HANDLER, row -> presenter.showHandlers(row))) .build(); diff --git a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/HandlerElement.java b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/HandlerElement.java index 216d188e73..9859b495da 100644 --- a/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/HandlerElement.java +++ b/app/src/main/java/org/jboss/hal/client/configuration/subsystem/webservice/HandlerElement.java @@ -37,7 +37,6 @@ import static org.jboss.elemento.Elements.p; import static org.jboss.elemento.Elements.section; import static org.jboss.hal.client.configuration.subsystem.webservice.AddressTemplates.HANDLER_TEMPLATE; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; /** Element to configure handlers of a handler chain. */ class HandlerElement implements IsElement, Attachable, HasPresenter { @@ -57,7 +56,7 @@ class HandlerElement implements IsElement, Attachable, HasPresenter .button(tableButtonFactory.add(HANDLER_TEMPLATE, table -> presenter.addHandler())) .button(tableButtonFactory.remove(HANDLER_TEMPLATE, table -> presenter.removeHandler(table.selectedRow().getName()))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); String formId = Ids.build(configType.baseId, "handler", Ids.FORM); diff --git a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/ElytronRealmWithIdentity.java b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/ElytronRealmWithIdentity.java index d9e27e81bc..dc8fa375a6 100644 --- a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/ElytronRealmWithIdentity.java +++ b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/ElytronRealmWithIdentity.java @@ -77,7 +77,7 @@ public class ElytronRealmWithIdentity implements IsElement, Attacha .button(resources.constants().addIdentity(), table -> presenter.addIdentity(template, metadata, table.selectedRow().getName()), Constraint.executable(template, ADD_IDENTITY)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(resources.constants().editIdentity(), this::showIdentityPage)) .build(); diff --git a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/KeyStoreElement.java b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/KeyStoreElement.java index 202f9198cc..7fc6bd3863 100644 --- a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/KeyStoreElement.java +++ b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/KeyStoreElement.java @@ -83,7 +83,7 @@ public class KeyStoreElement implements IsElement, Attachable { .button(new Button<>(cons.obtain(), cons.obtainCertificate(), table -> presenter.obtainCertificate(metadata, table.selectedRow().getName()), Constraint.executable(KEY_STORE_TEMPLATE, OBTAIN_CERTIFICATE))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(cons.aliases(), row -> { selectedKeystore = row.getName(); diff --git a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/RealmsView.java b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/RealmsView.java index e7d8256161..1d77d3a0e3 100644 --- a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/RealmsView.java +++ b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/RealmsView.java @@ -72,7 +72,7 @@ public RealmsView(MetadataRegistry metadataRegistry, Resources resources) { .button(resources.constants().clearCache(), table -> presenter.clearCache(table.selectedRow().getName()), Constraint.executable(CACHING_REALM_TEMPLATE, CLEAR_CACHE)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); cachingRealmForm = new ModelNodeForm.Builder(Ids.build(Ids.ELYTRON, CACHING_REALM, FORM), @@ -117,7 +117,7 @@ public RealmsView(MetadataRegistry metadataRegistry, Resources resources) { Ids.build(ELYTRON_PROPERTIES_REALM, TABLE), propertiesRealmMetadata) .button(resources.constants().load(), table -> presenter.loadProperties(table.selectedRow().getName()), Constraint.executable(PROPERTIES_REALM_TEMPLATE, LOAD)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); propertiesRealmForm = new ModelNodeForm.Builder( diff --git a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/SSLView.java b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/SSLView.java index 6ba783ddde..633e5817d9 100644 --- a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/SSLView.java +++ b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/SSLView.java @@ -60,7 +60,6 @@ import static org.jboss.hal.dmr.ModelDescriptionConstants.INIT; import static org.jboss.hal.dmr.ModelDescriptionConstants.KEY_MANAGER; import static org.jboss.hal.dmr.ModelDescriptionConstants.METADATA; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.dmr.ModelDescriptionConstants.READ_IDENTITY; import static org.jboss.hal.dmr.ModelDescriptionConstants.RELOAD_CERTIFICATE_REVOCATION_LIST; import static org.jboss.hal.dmr.ModelDescriptionConstants.SECURITY_DOMAIN; @@ -121,7 +120,7 @@ public SSLView(MetadataRegistry metadataRegistry, Resources resources) { table -> presenter.changeAccountKey(table.selectedRow().getName()), Constraint.executable(CERTIFICATE_AUTHORITY_ACCOUNT_TEMPLATE, CHANGE_ACCOUNT_KEY))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); caaMetadata = new PreTextItem(METADATA); @@ -147,7 +146,7 @@ public SSLView(MetadataRegistry metadataRegistry, Resources resources) { .button(resources.constants().initialize(), table -> presenter.initKeyManager(table.selectedRow().getName()), Constraint.executable(KEY_MANAGER_TEMPLATE, INIT)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); keyManagerForm = new ModelNodeForm.Builder(Ids.build(KEY_MANAGER, FORM), keyManagerMeta) @@ -169,7 +168,7 @@ public SSLView(MetadataRegistry metadataRegistry, Resources resources) { .button(resources.constants().readIdentity(), table -> presenter.readIdentity(secDomainMeta, table.selectedRow().getName()), Constraint.executable(SECURITY_DOMAIN_TEMPLATE, READ_IDENTITY)) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); securityDomainForm = new ModelNodeForm.Builder(Ids.build(SECURITY_DOMAIN, FORM), secDomainMeta) @@ -195,7 +194,7 @@ public SSLView(MetadataRegistry metadataRegistry, Resources resources) { .button(new Button<>(resources.constants().reloadCRL(), labelBuilder.label(RELOAD_CERTIFICATE_REVOCATION_LIST), table -> presenter.reloadCRL(table.selectedRow().getName()), Constraint.executable(TRUST_MANAGER_TEMPLATE, RELOAD_CERTIFICATE_REVOCATION_LIST))) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); trustManagerForm = new ModelNodeForm.Builder(Ids.build(TRUST_MANAGER, FORM), trustMeta) diff --git a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/StoreElement.java b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/StoreElement.java index 3cbf5b0141..c494b376e0 100644 --- a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/StoreElement.java +++ b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/elytron/StoreElement.java @@ -44,7 +44,6 @@ import static org.jboss.elemento.Elements.section; import static org.jboss.hal.dmr.ModelDescriptionConstants.ALIAS; import static org.jboss.hal.dmr.ModelDescriptionConstants.CERTIFICATE_DETAILS; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.resources.Ids.FORM; import static org.jboss.hal.resources.Ids.PAGE; import static org.jboss.hal.resources.Ids.PAGES; @@ -71,7 +70,7 @@ private StoreElement(Builder builder) { builder.buttonsHandler.forEach(tableBuilder::button); table = tableBuilder - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .column(new InlineAction<>(builder.resources.constants().aliases(), row -> { selectedResource = row.getName(); diff --git a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/jpa/JpaView.java b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/jpa/JpaView.java index 6d984a0b30..979dc519fa 100644 --- a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/jpa/JpaView.java +++ b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/jpa/JpaView.java @@ -49,7 +49,6 @@ import static org.jboss.elemento.EventType.click; import static org.jboss.hal.ballroom.LayoutBuilder.column; import static org.jboss.hal.ballroom.LayoutBuilder.row; -import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes; import static org.jboss.hal.resources.CSS.*; @@ -179,7 +178,7 @@ private HTMLElement buildChildPanel(String baseId, AddressTemplate template, Str Table table = new ModelNodeTable.Builder( Ids.build(baseId, resource, Ids.TABLE), metadata) - .column(NAME, (cell, type, row, meta) -> row.getName()) + .nameColumn() .build(); Form form = new ModelNodeForm.Builder(Ids.build(baseId, resource, Ids.FORM), diff --git a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/microprofile/health/MicroProfileHealthView.java b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/microprofile/health/MicroProfileHealthView.java index faddbbe6da..30198328d5 100644 --- a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/microprofile/health/MicroProfileHealthView.java +++ b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/microprofile/health/MicroProfileHealthView.java @@ -61,7 +61,7 @@ public MicroProfileHealthView(Resources resources, MicroProfileHealthCheckResour checkTable = new ModelNodeTable.Builder<>(Ids.build(MICRO_PROFILE_HEALTH, TABLE), metadata) .button(resources.constants().refresh(), table -> presenter.reload()) - .column(resources.constants().name(), (cell, type, row, meta) -> row.get(NAME).asString()) + .nameColumn() .column(Names.STATUS, (cell, type, row, meta) -> row.get(STATUS).asString()) .build(); diff --git a/app/src/main/resources/org/jboss/hal/client/configuration/subsystem/coremanagement/CoreManagementView.mbui.xml b/app/src/main/resources/org/jboss/hal/client/configuration/subsystem/coremanagement/CoreManagementView.mbui.xml index e0226227db..8f449fec8e 100644 --- a/app/src/main/resources/org/jboss/hal/client/configuration/subsystem/coremanagement/CoreManagementView.mbui.xml +++ b/app/src/main/resources/org/jboss/hal/client/configuration/subsystem/coremanagement/CoreManagementView.mbui.xml @@ -40,6 +40,7 @@ name-resolver="${table.selectedRow().getName()}"/> + diff --git a/core/src/main/java/org/jboss/hal/core/mbui/ResourceElement.java b/core/src/main/java/org/jboss/hal/core/mbui/ResourceElement.java index 2f35f1c360..477ae804e3 100644 --- a/core/src/main/java/org/jboss/hal/core/mbui/ResourceElement.java +++ b/core/src/main/java/org/jboss/hal/core/mbui/ResourceElement.java @@ -446,6 +446,11 @@ public Builder column(String name, Column.RenderCallback rend return this; } + public Builder nameColumn() { + tableBuilder.nameColumn(); + return this; + } + /** * Adds a complex attribute of type {@code OBJECT}. The operation checks whether the resource contains the complex * attribute. diff --git a/core/src/main/java/org/jboss/hal/core/mbui/table/ModelNodeTable.java b/core/src/main/java/org/jboss/hal/core/mbui/table/ModelNodeTable.java index 014a7a54a9..3ac7c9611f 100644 --- a/core/src/main/java/org/jboss/hal/core/mbui/table/ModelNodeTable.java +++ b/core/src/main/java/org/jboss/hal/core/mbui/table/ModelNodeTable.java @@ -18,7 +18,9 @@ import java.util.List; import java.util.function.Function; +import org.jboss.hal.ballroom.LabelBuilder; import org.jboss.hal.ballroom.table.Column; +import org.jboss.hal.ballroom.table.ColumnBuilder; import org.jboss.hal.ballroom.table.DataTable; import org.jboss.hal.ballroom.table.GenericOptionsBuilder; import org.jboss.hal.ballroom.table.Options; @@ -38,6 +40,7 @@ import com.google.common.collect.Lists; import static org.jboss.hal.ballroom.table.RefreshMode.RESET; +import static org.jboss.hal.dmr.ModelDescriptionConstants.INDEX; import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME; import static org.jboss.hal.resources.UIConstants.HASH; import static org.jboss.hal.resources.UIConstants.data; @@ -105,7 +108,9 @@ public void update(Iterable data, RefreshMode mode, Function ident private void checkIdentifier(T data) { if (data != null) { - if (data.hasDefined(NAME)) { + if (data.hasDefined(INDEX)) { + identifier = model -> model.get(INDEX).asString(); + } else if (data.hasDefined(NAME)) { identifier = model -> model.get(NAME).asString(); } identifierChecked = true; @@ -165,6 +170,19 @@ public Builder column(String attribute) { } } + public Builder indexColumn() { + column(new ColumnBuilder(INDEX, new LabelBuilder().label(INDEX), + (c, t, r, meta) -> String.valueOf(meta.row)) + .width("8rem") + .build()); + return that(); + } + + public Builder nameColumn() { + column(NAME, (c, t, row, m) -> row.get(NAME).asString()); + return that(); + } + @Override protected Builder that() { return this;