Search in sources :

Example 11 with FiltersVector

use of com.cosylab.logging.engine.FiltersVector in project ACS by ACS-Community.

the class LoggingClient method showEngineFiltersDialog.

/**
	 * Shows the dialog to set filters in the engine
	 */
private void showEngineFiltersDialog() {
    class EngineFilterable implements Filterable {

        /* (non-Javadoc)
			 * @see com.cosylab.logging.engine.Filterable#getFilters()
			 */
        @Override
        public FiltersVector getFilters() {
            return engine.getFilters();
        }

        /* (non-Javadoc)
			 * @see com.cosylab.logging.engine.Filterable#setFilters(com.cosylab.logging.engine.FiltersVector, boolean)
			 */
        @Override
        public void setFilters(FiltersVector newFilters, boolean append) {
            engine.setFilters(newFilters, append);
            setEngineFilterLbl();
        }
    }
    if (engineFiltersDlg == null) {
        engineFiltersDlg = new FilterChooserDialog("Engine filters", this, new EngineFilterable());
    }
    FiltersVector engineFilters = engine.getFilters();
    if (engineFilters == null) {
        engineFilters = new FiltersVector();
    }
    engineFiltersDlg.setFilters(engineFilters);
    engineFiltersDlg.setVisible(true);
}
Also used : Filterable(com.cosylab.logging.engine.Filterable) FiltersVector(com.cosylab.logging.engine.FiltersVector) FilterChooserDialog(com.cosylab.logging.settings.FilterChooserDialog)

Example 12 with FiltersVector

use of com.cosylab.logging.engine.FiltersVector in project ACS by ACS-Community.

the class ViewCoordinator method setFilter.

/**
	 * The table will show only logs that pass this filter.
	 * Previously installed jlog filters will get removed.
	 * <p>
	 * If the given filter is null, all filters will be removed.
	 * 
	 * @param filter
	 */
public void setFilter(Filter filter) {
    // Normally we'd leave existing filters intact, using
    // FiltersVector filters = getLogEntryTable().getFilters();
    // but here we simply overwrite any previously applied filters
    // including another AntennaNameFilter
    FiltersVector filters = new FiltersVector();
    if (filter != null) {
        filters.add(filter);
        filters.activateFilter(filter, true);
    }
    boolean shouldAppend = false;
    // The following call would need to be sync'd if we had not disabled the user filter menu / button.
    logEntryTable.setFilters(filters, shouldAppend);
    client.setTableFilterLbl();
}
Also used : FiltersVector(com.cosylab.logging.engine.FiltersVector)

Aggregations

FiltersVector (com.cosylab.logging.engine.FiltersVector)12 CheckListTableEntry (alma.acs.gui.widgets.CheckList.CheckListTableEntry)2 ExactFilter (com.cosylab.logging.engine.ExactFilter)2 Filter (com.cosylab.logging.engine.Filter)2 Filterable (com.cosylab.logging.engine.Filterable)2 FilterChooserDialog (com.cosylab.logging.settings.FilterChooserDialog)2 File (java.io.File)2 InvalidFilterConstraintException (com.cosylab.logging.engine.InvalidFilterConstraintException)1 MinMaxFilter (com.cosylab.logging.engine.MinMaxFilter)1 LogEntry (com.cosylab.logging.engine.log.LogEntry)1 BufferedReader (java.io.BufferedReader)1 FileReader (java.io.FileReader)1 IOException (java.io.IOException)1 JFileChooser (javax.swing.JFileChooser)1