4444)
4545@ TopComponent .Registration (mode = "editor" , openAtStartup = false )
4646@ ActionID (category = "Window" , id = "org.janelia.workstation.admin.AdministrationTopComponent" )
47- @ ActionReference (path = "Menu/Window/Core" , position = 10 )
48- @ TopComponent .OpenActionRegistration (
49- displayName = "#CTL_AdministrationTopComponentAction" ,
50- preferredID = AdministrationTopComponent .PREFERRED_ID
51- )
5247@ Messages ({
5348 "CTL_AdministrationTopComponentAction=Administration Tool" ,
5449 "CTL_AdministrationTopComponent=" + AdministrationTopComponent .LABEL_TEXT ,
@@ -63,13 +58,12 @@ public final class AdministrationTopComponent extends TopComponent {
6358
6459 private JPanel topMenu ;
6560 private Refreshable currentView ;
66- private boolean enabled ;
6761
6862 public AdministrationTopComponent () {
6963 setupGUI ();
7064 setName (Bundle .CTL_AdministrationTopComponent ());
7165 setToolTipText (Bundle .HINT_AdministrationTopComponent ());
72- enabled = AccessManager .getAccessManager ().isAdmin ();
66+ boolean enabled = AccessManager .getAccessManager ().isAdmin ();
7367 setEnabled (enabled );
7468 }
7569
@@ -93,7 +87,6 @@ private void setupGUI() {
9387 listUsersButton .setVerticalTextPosition (SwingConstants .BOTTOM );
9488 listUsersButton .setHorizontalTextPosition (SwingConstants .CENTER );
9589 listUsersButton .addActionListener (event -> viewUserList ());
96- listUsersButton .setEnabled (enabled );
9790 row1 .add (listUsersButton );
9891
9992 row1 .add (Box .createHorizontalStrut (20 )); // Add space between buttons
@@ -105,7 +98,6 @@ private void setupGUI() {
10598 listGroupsButton .setVerticalTextPosition (SwingConstants .BOTTOM );
10699 listGroupsButton .setHorizontalTextPosition (SwingConstants .CENTER );
107100 listGroupsButton .addActionListener (event -> viewGroupList ());
108- listGroupsButton .setEnabled (enabled );
109101 row1 .add (listGroupsButton );
110102
111103 row1 .add (Box .createHorizontalStrut (20 ));
@@ -115,7 +107,6 @@ private void setupGUI() {
115107 getLogsButton .addActionListener (event -> getLogs ());
116108 getLogsButton .setVerticalTextPosition (SwingConstants .BOTTOM );
117109 getLogsButton .setHorizontalTextPosition (SwingConstants .CENTER );
118- getLogsButton .setEnabled (enabled );
119110 row1 .add (getLogsButton );
120111
121112 row1 .add (Box .createHorizontalStrut (20 ));
@@ -126,7 +117,6 @@ private void setupGUI() {
126117 workspaceCleanupButton .setVerticalTextPosition (SwingConstants .BOTTOM );
127118 workspaceCleanupButton .setHorizontalTextPosition (SwingConstants .CENTER );
128119 workspaceCleanupButton .addActionListener (event -> databaseCleanup ());
129- workspaceCleanupButton .setEnabled (enabled );
130120 row1 .add (workspaceCleanupButton );
131121
132122 // Add both rows to the main menu
0 commit comments