@@ -63,12 +63,13 @@ public final class AdministrationTopComponent extends TopComponent {
6363
6464 private JPanel topMenu ;
6565 private Refreshable currentView ;
66+ private boolean enabled ;
6667
6768 public AdministrationTopComponent () {
6869 setupGUI ();
6970 setName (Bundle .CTL_AdministrationTopComponent ());
7071 setToolTipText (Bundle .HINT_AdministrationTopComponent ());
71- boolean enabled = AccessManager .getAccessManager ().isAdmin ();
72+ enabled = AccessManager .getAccessManager ().isAdmin ();
7273 setEnabled (enabled );
7374 }
7475
@@ -92,6 +93,7 @@ private void setupGUI() {
9293 listUsersButton .setVerticalTextPosition (SwingConstants .BOTTOM );
9394 listUsersButton .setHorizontalTextPosition (SwingConstants .CENTER );
9495 listUsersButton .addActionListener (event -> viewUserList ());
96+ listUsersButton .setEnabled (enabled );
9597 row1 .add (listUsersButton );
9698
9799 row1 .add (Box .createHorizontalStrut (20 )); // Add space between buttons
@@ -103,6 +105,7 @@ private void setupGUI() {
103105 listGroupsButton .setVerticalTextPosition (SwingConstants .BOTTOM );
104106 listGroupsButton .setHorizontalTextPosition (SwingConstants .CENTER );
105107 listGroupsButton .addActionListener (event -> viewGroupList ());
108+ listGroupsButton .setEnabled (enabled );
106109 row1 .add (listGroupsButton );
107110
108111 row1 .add (Box .createHorizontalStrut (20 ));
@@ -112,6 +115,7 @@ private void setupGUI() {
112115 getLogsButton .addActionListener (event -> getLogs ());
113116 getLogsButton .setVerticalTextPosition (SwingConstants .BOTTOM );
114117 getLogsButton .setHorizontalTextPosition (SwingConstants .CENTER );
118+ getLogsButton .setEnabled (enabled );
115119 row1 .add (getLogsButton );
116120
117121 row1 .add (Box .createHorizontalStrut (20 ));
@@ -122,6 +126,7 @@ private void setupGUI() {
122126 workspaceCleanupButton .setVerticalTextPosition (SwingConstants .BOTTOM );
123127 workspaceCleanupButton .setHorizontalTextPosition (SwingConstants .CENTER );
124128 workspaceCleanupButton .addActionListener (event -> databaseCleanup ());
129+ workspaceCleanupButton .setEnabled (enabled );
125130 row1 .add (workspaceCleanupButton );
126131
127132 // Add both rows to the main menu
0 commit comments