com.sun.hotspot.igv.filter.Filter Java Examples

The following examples show how to use com.sun.hotspot.igv.filter.Filter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FilterNode.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private FilterNode(Filter filter, InstanceContent content) {
    super(Children.LEAF, new AbstractLookup(content));
    content.add(filter);

    content.add(filter.getEditor());
    this.filter = filter;
    filter.getChangedEvent().addListener(new ChangedListener<Filter>() {

        public void changed(Filter source) {
            update();
        }
    });

    update();

    Lookup.Template<FilterChain> tpl = new Lookup.Template<FilterChain>(FilterChain.class);
    result = Utilities.actionsGlobalContext().lookup(tpl);
    result.addLookupListener(this);

    FilterTopComponent.findInstance().getFilterSettingsChangedEvent().addListener(this);
    resultChanged(null);
}
 
Example #2
Source File: RemoveFilterAction.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
protected void performAction(Node[] activatedNodes) {
    Object[] options = {"Yes",
        "No",
        "Cancel"
    };
    int n = JOptionPane.showOptionDialog(WindowManager.getDefault().getMainWindow(),
            "Do you really want to delete " + activatedNodes.length + " filter/s?", "Delete?",
            JOptionPane.YES_NO_CANCEL_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,
            options,
            options[2]);

    if (n == JOptionPane.YES_OPTION) {
        for (int i = 0; i < activatedNodes.length; i++) {
            FilterTopComponent.findInstance().removeFilter(activatedNodes[i].getLookup().lookup(Filter.class));
        }
    }
}
 
Example #3
Source File: FilterTopComponent.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void updateComboBoxSelection() {
    List<Filter> filters = this.getFilterChain().getFilters();
    boolean found = false;
    for (FilterSetting s : filterSettings) {
        if (s.getFilterCount() == filters.size()) {
            boolean ok = true;
            for (Filter f : filters) {
                if (!s.containsFilter(f)) {
                    ok = false;
                }
            }

            if (ok) {
                if (comboBox.getSelectedItem() != s) {
                    comboBox.setSelectedItem(s);
                }
                found = true;
                break;
            }
        }
    }

    if (!found && comboBox.getSelectedItem() != customFilterSetting) {
        comboBox.setSelectedItem(customFilterSetting);
    }
}
 
Example #4
Source File: FilterTopComponent.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void updateComboBoxSelection() {
    List<Filter> filters = this.getFilterChain().getFilters();
    boolean found = false;
    for (FilterSetting s : filterSettings) {
        if (s.getFilterCount() == filters.size()) {
            boolean ok = true;
            for (Filter f : filters) {
                if (!s.containsFilter(f)) {
                    ok = false;
                }
            }

            if (ok) {
                if (comboBox.getSelectedItem() != s) {
                    comboBox.setSelectedItem(s);
                }
                found = true;
                break;
            }
        }
    }

    if (!found && comboBox.getSelectedItem() != customFilterSetting) {
        comboBox.setSelectedItem(customFilterSetting);
    }
}
 
Example #5
Source File: FilterTopComponent.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void updateComboBoxSelection() {
    List<Filter> filters = this.getFilterChain().getFilters();
    boolean found = false;
    for (FilterSetting s : filterSettings) {
        if (s.getFilterCount() == filters.size()) {
            boolean ok = true;
            for (Filter f : filters) {
                if (!s.containsFilter(f)) {
                    ok = false;
                }
            }

            if (ok) {
                if (comboBox.getSelectedItem() != s) {
                    comboBox.setSelectedItem(s);
                }
                found = true;
                break;
            }
        }
    }

    if (!found && comboBox.getSelectedItem() != customFilterSetting) {
        comboBox.setSelectedItem(customFilterSetting);
    }
}
 
Example #6
Source File: RemoveFilterAction.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
protected void performAction(Node[] activatedNodes) {
    Object[] options = {"Yes",
        "No",
        "Cancel"
    };
    int n = JOptionPane.showOptionDialog(WindowManager.getDefault().getMainWindow(),
            "Do you really want to delete " + activatedNodes.length + " filter/s?", "Delete?",
            JOptionPane.YES_NO_CANCEL_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,
            options,
            options[2]);

    if (n == JOptionPane.YES_OPTION) {
        for (int i = 0; i < activatedNodes.length; i++) {
            FilterTopComponent.findInstance().removeFilter(activatedNodes[i].getLookup().lookup(Filter.class));
        }
    }
}
 
Example #7
Source File: FilterNode.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private FilterNode(Filter filter, InstanceContent content) {
    super(Children.LEAF, new AbstractLookup(content));
    content.add(filter);

    content.add(filter.getEditor());
    this.filter = filter;
    filter.getChangedEvent().addListener(new ChangedListener<Filter>() {

        public void changed(Filter source) {
            update();
        }
    });

    update();

    Lookup.Template<FilterChain> tpl = new Lookup.Template<FilterChain>(FilterChain.class);
    result = Utilities.actionsGlobalContext().lookup(tpl);
    result.addLookupListener(this);

    FilterTopComponent.findInstance().getFilterSettingsChangedEvent().addListener(this);
    resultChanged(null);
}
 
Example #8
Source File: FilterTopComponent.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void updateComboBoxSelection() {
    List<Filter> filters = this.getFilterChain().getFilters();
    boolean found = false;
    for (FilterSetting s : filterSettings) {
        if (s.getFilterCount() == filters.size()) {
            boolean ok = true;
            for (Filter f : filters) {
                if (!s.containsFilter(f)) {
                    ok = false;
                }
            }

            if (ok) {
                if (comboBox.getSelectedItem() != s) {
                    comboBox.setSelectedItem(s);
                }
                found = true;
                break;
            }
        }
    }

    if (!found && comboBox.getSelectedItem() != customFilterSetting) {
        comboBox.setSelectedItem(customFilterSetting);
    }
}
 
Example #9
Source File: FilterTopComponent.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void changed(CheckNode source) {
    FilterNode node = (FilterNode) source;
    Filter f = node.getFilter();
    FilterChain chain = getFilterChain();
    if (node.isSelected()) {
        if (!chain.containsFilter(f)) {
            chain.addFilter(f);
        }
    } else {
        if (chain.containsFilter(f)) {
            chain.removeFilter(f);
        }
    }
    view.revalidate();
    view.repaint();
    updateComboBoxSelection();
}
 
Example #10
Source File: FilterNode.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private FilterNode(Filter filter, InstanceContent content) {
    super(Children.LEAF, new AbstractLookup(content));
    content.add(filter);

    content.add(filter.getEditor());
    this.filter = filter;
    filter.getChangedEvent().addListener(new ChangedListener<Filter>() {

        public void changed(Filter source) {
            update();
        }
    });

    update();

    Lookup.Template<FilterChain> tpl = new Lookup.Template<FilterChain>(FilterChain.class);
    result = Utilities.actionsGlobalContext().lookup(tpl);
    result.addLookupListener(this);

    FilterTopComponent.findInstance().getFilterSettingsChangedEvent().addListener(this);
    resultChanged(null);
}
 
Example #11
Source File: FilterTopComponent.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void changed(CheckNode source) {
    FilterNode node = (FilterNode) source;
    Filter f = node.getFilter();
    FilterChain chain = getFilterChain();
    if (node.isSelected()) {
        if (!chain.containsFilter(f)) {
            chain.addFilter(f);
        }
    } else {
        if (chain.containsFilter(f)) {
            chain.removeFilter(f);
        }
    }
    view.revalidate();
    view.repaint();
    updateComboBoxSelection();
}
 
Example #12
Source File: FilterTopComponent.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void updateComboBoxSelection() {
    List<Filter> filters = this.getFilterChain().getFilters();
    boolean found = false;
    for (FilterSetting s : filterSettings) {
        if (s.getFilterCount() == filters.size()) {
            boolean ok = true;
            for (Filter f : filters) {
                if (!s.containsFilter(f)) {
                    ok = false;
                }
            }

            if (ok) {
                if (comboBox.getSelectedItem() != s) {
                    comboBox.setSelectedItem(s);
                }
                found = true;
                break;
            }
        }
    }

    if (!found && comboBox.getSelectedItem() != customFilterSetting) {
        comboBox.setSelectedItem(customFilterSetting);
    }
}
 
Example #13
Source File: FilterTopComponent.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void updateComboBoxSelection() {
    List<Filter> filters = this.getFilterChain().getFilters();
    boolean found = false;
    for (FilterSetting s : filterSettings) {
        if (s.getFilterCount() == filters.size()) {
            boolean ok = true;
            for (Filter f : filters) {
                if (!s.containsFilter(f)) {
                    ok = false;
                }
            }

            if (ok) {
                if (comboBox.getSelectedItem() != s) {
                    comboBox.setSelectedItem(s);
                }
                found = true;
                break;
            }
        }
    }

    if (!found && comboBox.getSelectedItem() != customFilterSetting) {
        comboBox.setSelectedItem(customFilterSetting);
    }
}
 
Example #14
Source File: FilterTopComponent.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void changed(CheckNode source) {
    FilterNode node = (FilterNode) source;
    Filter f = node.getFilter();
    FilterChain chain = getFilterChain();
    if (node.isSelected()) {
        if (!chain.containsFilter(f)) {
            chain.addFilter(f);
        }
    } else {
        if (chain.containsFilter(f)) {
            chain.removeFilter(f);
        }
    }
    view.revalidate();
    view.repaint();
    updateComboBoxSelection();
}
 
Example #15
Source File: FilterTopComponent.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void updateComboBoxSelection() {
    List<Filter> filters = this.getFilterChain().getFilters();
    boolean found = false;
    for (FilterSetting s : filterSettings) {
        if (s.getFilterCount() == filters.size()) {
            boolean ok = true;
            for (Filter f : filters) {
                if (!s.containsFilter(f)) {
                    ok = false;
                }
            }

            if (ok) {
                if (comboBox.getSelectedItem() != s) {
                    comboBox.setSelectedItem(s);
                }
                found = true;
                break;
            }
        }
    }

    if (!found && comboBox.getSelectedItem() != customFilterSetting) {
        comboBox.setSelectedItem(customFilterSetting);
    }
}
 
Example #16
Source File: RemoveFilterAction.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void performAction(Node[] activatedNodes) {
    Object[] options = {"Yes",
        "No",
        "Cancel"
    };
    int n = JOptionPane.showOptionDialog(WindowManager.getDefault().getMainWindow(),
            "Do you really want to delete " + activatedNodes.length + " filter(s)?", "Delete Filters",
            JOptionPane.YES_NO_CANCEL_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,
            options,
            options[2]);

    if (n == JOptionPane.YES_OPTION) {
        for (int i = 0; i < activatedNodes.length; i++) {
            FilterTopComponent.findInstance().removeFilter(activatedNodes[i].getLookup().lookup(Filter.class));
        }
    }
}
 
Example #17
Source File: FilterNode.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private FilterNode(Filter filter, InstanceContent content) {
    super(Children.LEAF, new AbstractLookup(content));
    content.add(filter);

    content.add(filter.getEditor());
    this.filter = filter;
    filter.getChangedEvent().addListener(new ChangedListener<Filter>() {

        @Override
        public void changed(Filter source) {
            update();
        }
    });

    update();

    Lookup.Template<FilterChain> tpl = new Lookup.Template<>(FilterChain.class);
    result = Utilities.actionsGlobalContext().lookup(tpl);
    result.addLookupListener(this);

    FilterTopComponent.findInstance().getFilterSettingsChangedEvent().addListener(this);
    resultChanged(null);

    setShortDescription("Double-click to open filter");
}
 
Example #18
Source File: FilterTopComponent.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void updateComboBoxSelection() {
    List<Filter> filters = this.getFilterChain().getFilters();
    boolean found = false;
    for (FilterSetting s : filterSettings) {
        if (s.getFilterCount() == filters.size()) {
            boolean ok = true;
            for (Filter f : filters) {
                if (!s.containsFilter(f)) {
                    ok = false;
                }
            }

            if (ok) {
                if (comboBox.getSelectedItem() != s) {
                    comboBox.setSelectedItem(s);
                }
                found = true;
                break;
            }
        }
    }

    if (!found && comboBox.getSelectedItem() != customFilterSetting) {
        comboBox.setSelectedItem(customFilterSetting);
    }
}
 
Example #19
Source File: RemoveFilterAction.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected void performAction(Node[] activatedNodes) {
    Object[] options = {"Yes",
        "No",
        "Cancel"
    };
    int n = JOptionPane.showOptionDialog(WindowManager.getDefault().getMainWindow(),
            "Do you really want to delete " + activatedNodes.length + " filter/s?", "Delete?",
            JOptionPane.YES_NO_CANCEL_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,
            options,
            options[2]);

    if (n == JOptionPane.YES_OPTION) {
        for (int i = 0; i < activatedNodes.length; i++) {
            FilterTopComponent.findInstance().removeFilter(activatedNodes[i].getLookup().lookup(Filter.class));
        }
    }
}
 
Example #20
Source File: FilterTopComponent.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void changed(CheckNode source) {
    FilterNode node = (FilterNode) source;
    Filter f = node.getFilter();
    FilterChain chain = getFilterChain();
    if (node.isSelected()) {
        if (!chain.containsFilter(f)) {
            chain.addFilter(f);
        }
    } else {
        if (chain.containsFilter(f)) {
            chain.removeFilter(f);
        }
    }
    view.revalidate();
    view.repaint();
    updateComboBoxSelection();
}
 
Example #21
Source File: RemoveFilterAction.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected void performAction(Node[] activatedNodes) {
    Object[] options = {"Yes",
        "No",
        "Cancel"
    };
    int n = JOptionPane.showOptionDialog(WindowManager.getDefault().getMainWindow(),
            "Do you really want to delete " + activatedNodes.length + " filter/s?", "Delete?",
            JOptionPane.YES_NO_CANCEL_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,
            options,
            options[2]);

    if (n == JOptionPane.YES_OPTION) {
        for (int i = 0; i < activatedNodes.length; i++) {
            FilterTopComponent.findInstance().removeFilter(activatedNodes[i].getLookup().lookup(Filter.class));
        }
    }
}
 
Example #22
Source File: FilterTopComponent.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public CustomFilter findFilter(String name) {
    for (Filter f : sequence.getFilters()) {

        CustomFilter cf = (CustomFilter) f;
        if (cf.getName().equals(name)) {
            return cf;
        }
    }

    return null;
}
 
Example #23
Source File: MoveFilterUpAction.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void performAction(Node[] activatedNodes) {
    for (Node n : activatedNodes) {
        Filter c = n.getLookup().lookup(Filter.class);
        FilterTopComponent.findInstance().getSequence().moveFilterUp(c);
    }
}
 
Example #24
Source File: FilterTopComponent.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private FilterSetting createFilterSetting(String name) {
    FilterSetting s = new FilterSetting(name);
    FilterChain chain = this.getFilterChain();
    for (Filter f : chain.getFilters()) {
        s.addFilter(f);
    }
    return s;
}
 
Example #25
Source File: MoveFilterDownAction.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void performAction(Node[] activatedNodes) {
    for (Node n : activatedNodes) {
        Filter c = n.getLookup().lookup(Filter.class);
        FilterTopComponent.findInstance().getSequence().moveFilterDown(c);
    }
}
 
Example #26
Source File: FilterTopComponent.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private FilterSetting createFilterSetting(String name) {
    FilterSetting s = new FilterSetting(name);
    FilterChain chain = this.getFilterChain();
    for (Filter f : chain.getFilters()) {
        s.addFilter(f);
    }
    return s;
}
 
Example #27
Source File: FilterTopComponent.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected Node[] createNodes(Filter filter) {
    if (nodeHash.containsKey(filter)) {
        return new Node[]{nodeHash.get(filter)};
    }

    FilterNode node = new FilterNode(filter);
    node.getSelectionChangedEvent().addListener(this);
    nodeHash.put(filter, node);
    return new Node[]{node};
}
 
Example #28
Source File: FilterTopComponent.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public CustomFilter findFilter(String name) {
    for (Filter f : sequence.getFilters()) {

        CustomFilter cf = (CustomFilter) f;
        if (cf.getName().equals(name)) {
            return cf;
        }
    }

    return null;
}
 
Example #29
Source File: FilterTopComponent.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void removeFilter(Filter f) {
    com.sun.hotspot.igv.filter.CustomFilter cf = (com.sun.hotspot.igv.filter.CustomFilter) f;

    sequence.removeFilter(cf);
    try {
        getFileObject(cf).delete();
    } catch (IOException ex) {
        Exceptions.printStackTrace(ex);
    }

}
 
Example #30
Source File: FilterTopComponent.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private FilterSetting createFilterSetting(String name) {
    FilterSetting s = new FilterSetting(name);
    FilterChain chain = this.getFilterChain();
    for (Filter f : chain.getFilters()) {
        s.addFilter(f);
    }
    return s;
}