Esempio n. 1
0
  private void messageFound(final FormattedMqttMessage message) {
    foundMessages.add(
        0,
        new MessageContentProperties<FormattedMqttMessage>(
            message, /*store.getFormatter(), */
            UiProperties.getSummaryMaxPayloadLength(configurationManager.getUiPropertyFile())));

    if (!uniqueContentOnlyFilter.filter(message, foundMessageStore.getMessageList(), true)) {
      // If an old message has been deleted from the store, remove it from the list as well
      if (foundMessageStore.storeMessage(message) != null) {
        foundMessages.remove(foundMessages.size() - 1);
      }
    }
  }
Esempio n. 2
0
 private void clearMessages() {
   seachedCount = 0;
   foundMessages.clear();
   foundMessageStore.clear();
   uniqueContentOnlyFilter.reset();
 }
Esempio n. 3
0
  public void init() {
    foundMessageStore =
        new FilteredMessageStore<FormattedMqttMessage>(
            store.getMessageList(),
            store.getMessageList().getPreferredSize(),
            store.getMessageList().getMaxSize(),
            "search-" + store.getName(),
            store.getFormatter(),
            formattingManager,
            UiProperties.getSummaryMaxPayloadLength(configurationManager.getUiPropertyFile()));

    uniqueContentOnlyFilter =
        new UniqueContentOnlyFilter<FormattedMqttMessage>(store, store.getUiEventQueue());
    uniqueContentOnlyFilter.setUniqueContentOnly(
        messageNavigationPaneController.getUniqueOnlyMenu().isSelected());
    foundMessageStore.addMessageFilter(uniqueContentOnlyFilter);
    messageNavigationPaneController
        .getUniqueOnlyMenu()
        .setOnAction(
            new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent event) {
                uniqueContentOnlyFilter.setUniqueContentOnly(
                    messageNavigationPaneController.getUniqueOnlyMenu().isSelected());
                // store.getFilteredMessageStore().runFilter(uniqueContentOnlyFilter);
                search();
                eventManager.navigateToFirst(foundMessageStore);
              }
            });

    messageListTablePaneController.setItems(foundMessages);
    messageListTablePaneController.setStore(foundMessageStore);
    messageListTablePaneController.setConnection(connection);
    messageListTablePaneController.setEventManager(eventManager);
    messageListTablePaneController.init();
    eventManager.registerChangeMessageIndexObserver(
        messageListTablePaneController, foundMessageStore);

    messagePaneController.setStore(foundMessageStore);
    messagePaneController.setConfingurationManager(configurationManager);
    messagePaneController.setFormattingManager(formattingManager);
    messagePaneController.setStyled(true);
    messagePaneController.init();
    // The search pane's message browser wants to know about changing indices and format
    eventManager.registerChangeMessageIndexObserver(messagePaneController, foundMessageStore);
    eventManager.registerFormatChangeObserver(messagePaneController, foundMessageStore);

    messageNavigationPaneController.setStore(foundMessageStore);
    messageNavigationPaneController.setEventManager(eventManager);
    messageNavigationPaneController.init();
    // The search pane's message browser wants to know about show first, index change and update
    // index events
    eventManager.registerChangeMessageIndexObserver(
        messageNavigationPaneController, foundMessageStore);
    eventManager.registerChangeMessageIndexFirstObserver(
        messageNavigationPaneController, foundMessageStore);
    eventManager.registerIncrementMessageIndexObserver(
        messageNavigationPaneController, foundMessageStore);

    scriptManager = new MqttScriptManager(null, null, connection);
    refreshList();

    eventManager.registerMessageAddedObserver(this, store.getMessageList());
    eventManager.registerFormatChangeObserver(this, store);
  }