Refreshes the GUI.
()
| 1273 | * Refreshes the GUI. |
| 1274 | */ |
| 1275 | protected void refreshGUI() { |
| 1276 | refreshMemoryButton(); |
| 1277 | // set tab properties |
| 1278 | LaunchPanel tab = getSelectedTab(); |
| 1279 | boolean rootDisabled = tab != null && !tab.getRootNode().enabled; |
| 1280 | if (tab != null) { |
| 1281 | tab.tree.setEnabled(tab.getRootNode().enabled); |
| 1282 | tabbedPane.setEnabled(tab.getRootNode().enabled); |
| 1283 | tab.splitPane.setDividerLocation(divider); |
| 1284 | } |
| 1285 | // update undo/redo buttons |
| 1286 | backButton.setEnabled(undoManager.canUndo()); |
| 1287 | forwardButton.setEnabled(undoManager.canRedo()); |
| 1288 | String name; |
| 1289 | if (frame != null) { |
| 1290 | // set frame title |
| 1291 | name = (title == null) ? tabSetName : title; |
| 1292 | if (name == null) { |
| 1293 | name = LaunchRes.getString("Frame.Title"); //$NON-NLS-1$ |
| 1294 | } else { |
| 1295 | name = LaunchRes.getString("Frame.Title") + ": " + name; //$NON-NLS-1$//$NON-NLS-2$ |
| 1296 | } |
| 1297 | if (rootDisabled) { |
| 1298 | name += " " + LaunchRes.getString("Launcher.Title.NeedsPassword"); //$NON-NLS-1$//$NON-NLS-2$ |
| 1299 | } |
| 1300 | frame.setTitle(name); |
| 1301 | // rebuild file menu |
| 1302 | fileMenu.removeAll(); |
| 1303 | if (undoManager.canReload()) { |
| 1304 | fileMenu.add(backItem); |
| 1305 | } |
| 1306 | if (!OSPRuntime.isApplet) { |
| 1307 | if (fileMenu.getItemCount() > 0) { |
| 1308 | fileMenu.addSeparator(); |
| 1309 | } |
| 1310 | fileMenu.add(openItem); |
| 1311 | } |
| 1312 | if (openFromJarMenu != null) { |
| 1313 | fileMenu.add(openFromJarMenu); |
| 1314 | } |
| 1315 | if (rootDisabled) { |
| 1316 | fileMenu.add(passwordItem); |
| 1317 | } |
| 1318 | if (OSPRuntime.isApplet) { // added by W. Christian |
| 1319 | fileMenu.add(hideItem); |
| 1320 | return; |
| 1321 | } |
| 1322 | if (tab != null) { |
| 1323 | if (fileMenu.getItemCount() > 0) { |
| 1324 | fileMenu.addSeparator(); |
| 1325 | } |
| 1326 | boolean showCloseTab = true; |
| 1327 | if (getClass() == Launcher.class) { |
| 1328 | if (tab.getRootNode().isButtonView()) { |
| 1329 | showCloseTab = false; |
| 1330 | name = LaunchRes.getString("Frame.Title") + ": " + //$NON-NLS-1$//$NON-NLS-2$ |
| 1331 | tab.getRootNode().name; |
| 1332 | } else if (tabbedPane.getTabCount() == 1) { |
no test coverage detected