class FilterPanelPanel extends JPanel implements ChangeListener {

    private final String settingsString;
    private Query selectedQuery;
    private FilterUIModel uiModel;

    public FilterPanelPanel() {
        super(new BorderLayout());
        settingsString = NbBundle.getMessage(FilterPanelPanel.class, "FilterPanelPanel.settings");
        if (UIUtils.isAquaLookAndFeel()) {
            setBackground(UIManager.getColor("NbExplorerView.background"));
        }
    }

    @Override
    public void stateChanged(ChangeEvent e) {
        refreshModel();
    }

    private void refreshModel() {
        if (uiModel != null) {
            if (uiModel.getSelectedQuery() != selectedQuery) {
                selectedQuery = uiModel.getSelectedQuery();
                setQuery(selectedQuery);
            }
        } else {
            setQuery(null);
        }
    }

    public void setup(FilterUIModel model) {
        uiModel = model;
        if (model != null) {
            model.addChangeListener(this);
        }
        refreshModel();
    }

    public void unsetup() {
        if (uiModel != null) {
            uiModel.removeChangeListener(this);
            uiModel = null;
            refreshModel();
        }
    }

    private void setQuery(final Query query) {<FILL_FUNCTION_BODY>}
}

        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                //UI update
                removeAll();
                setBorder(null);
                if (query != null) {
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                    FilterBuilder builder = filterController.getModel().getLibrary().getBuilder(query.getFilter());
                    try {
                        JPanel panel = builder.getPanel(query.getFilter());
                        if (panel != null) {
                            add(panel, BorderLayout.CENTER);
                            panel.setOpaque(false);
                            setBorder(javax.swing.BorderFactory
                                .createTitledBorder(query.getFilter().getName() + " " + settingsString));
                        }
                    } catch (Exception e) {
                        Logger.getLogger("").log(Level.SEVERE, "Error while setting query", e);
                    }
                }

                revalidate();
                repaint();
            }
        });

    
<methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void setUI(javax.swing.plaf.PanelUI) ,public void updateUI() <variables>private static final java.lang.String uiClassID