Beispiel #1
0
 @FXML
 private void resizeMessagePane() {
   // Connection tabs
   for (final ConnectionController controller : connectionManager.getConnectionControllers()) {
     controller.getResizeMessageContentMenu().setSelected(resizeMessagePaneMenu.isSelected());
   }
   // Offline (message log) tabs
   for (final ConnectionController controller :
       connectionManager.getOfflineConnectionControllers()) {
     controller.getResizeMessageContentMenu().setSelected(resizeMessagePaneMenu.isSelected());
   }
 }
Beispiel #2
0
  private void clear() {
    connectionManager.disconnectAndCloseAll();

    // Only re-initialise if it has been initialised already
    if (editConnectionsController != null) {
      initialiseEditConnectionsWindow();
    }
  }
Beispiel #3
0
  @FXML
  public void exit() {
    // This is triggered by the user
    connectionManager.disconnectAll();

    statisticsManager.saveStats();

    configurationManager.saveUiProperties(
        getLastWidth(),
        getLastHeight(),
        stage.isMaximized(),
        selectedPerspective,
        resizeMessagePaneMenu.isSelected());

    System.exit(0);
  }
Beispiel #4
0
  @FXML
  private void showPerspective() {
    if (spyPerspective.isSelected()) {
      selectedPerspective = MqttSpyPerspective.SPY;
    } else if (superSpyPerspective.isSelected()) {
      selectedPerspective = MqttSpyPerspective.SUPER_SPY;
    } else if (detailedPerspective.isSelected()) {
      selectedPerspective = MqttSpyPerspective.DETAILED;
    } else {
      selectedPerspective = MqttSpyPerspective.DEFAULT;
    }

    for (final ConnectionController connectionController :
        connectionManager.getConnectionControllers()) {
      showPerspective(connectionController);
    }

    logger.debug("Selected perspective = " + selectedPerspective.toString());
  }
Beispiel #5
0
  private void loadConfigurationFile(final File selectedFile) {
    logger.info("Loading configuration file from " + selectedFile.getAbsolutePath());

    if (configurationManager.loadConfiguration(selectedFile)) {
      clear();
      controlPanelPaneController.refreshConnectionsStatus();

      // Process the connection settings
      for (final ConfiguredConnectionDetails connection : configurationManager.getConnections()) {
        if (connection.isAutoOpen() != null && connection.isAutoOpen()) {
          try {
            connectionManager.openConnection(connection, this);
          } catch (ConfigurationException e) {
            // TODO: show warning dialog for invalid
            logger.error("Cannot open conection {}", connection.getName(), e);
          }
        }
      }
    }

    controlPanelPaneController.refreshConfigurationFileStatus();
  }