Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   *
   * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
   *
   * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   * Other names may be trademarks of their respective owners.
   *
   * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common
  * Development and Distribution License("CDDL") (collectively, the
  * "License"). You may not use this file except in compliance with the
  * License. You can obtain a copy of the License at
  * http://www.netbeans.org/cddl-gplv2.html
  * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  * specific language governing permissions and limitations under the
  * License.  When distributing the software, include this License Header
  * Notice in each file and include the License file at
  * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  * particular file as subject to the "Classpath" exception as provided
  * by Oracle in the GPL Version 2 section of the License file that
  * accompanied this code. If applicable, add the following below the
  * License Header, with the fields enclosed by brackets [] replaced by
  * your own identifying information:
  * "Portions Copyrighted [year] [name of copyright owner]"
  *
  * Contributor(s):
  * The Original Software is NetBeans. The Initial Developer of the Original
  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  * Microsystems, Inc. All Rights Reserved.
  *
  * If you wish your version of this file to be governed by only the CDDL
  * or only the GPL Version 2, indicate your decision by adding
  * "[Contributor] elects to include this software in this distribution
  * under the [CDDL or GPL Version 2] license." If you do not indicate a
  * single choice of license, a recipient has the option to distribute
  * your version of this file under either the CDDL, the GPL Version 2 or
  * to extend the choice of license to its licensees as provided above.
  * However, if you add GPL Version 2 code and therefore, elected the GPL
  * Version 2 license, then the option applies only if the new code is
  * made subject to such option by the copyright holder.
  */
 
 package org.netbeans.modules.profiler.ppoints.ui;
 
 import java.awt.Font;
 import java.util.List;
 import javax.swing.*;

Author(s):
Jiri Sedlacek
 
     "ProfilingPointsWindowUI_AllProjectsString=All Projects",
     "ProfilingPointsWindowUI_ProjectLabelText=Pr&oject:",
     "ProfilingPointsWindowUI_InclSubprojCheckboxText=in&clude open subprojects",
    "ProfilingPointsWindowUI_AddButtonToolTip=Add Profiling Point",
    "ProfilingPointsWindowUI_RemoveButtonToolTip=Delete Profiling Point(s)",
    "ProfilingPointsWindowUI_EditButtonToolTip=Edit Profiling Point",
    "ProfilingPointsWindowUI_DisableButtonToolTip=Enable/Disable Profiling Point(s)",
    "ProfilingPointsWindowUI_ShowSourceItemText=Show in Source",
    "ProfilingPointsWindowUI_ShowStartItemText=Show Start in Source",
    "ProfilingPointsWindowUI_ShowEndItemText=Show End in Source",
    "ProfilingPointsWindowUI_ShowReportItemText=Show Report",
    "ProfilingPointsWindowUI_EnableItemText=Enable",
    "ProfilingPointsWindowUI_DisableItemText=Disable",
    "ProfilingPointsWindowUI_EnableDisableItemText=Enable/Disable",
    "ProfilingPointsWindowUI_EditItemText=Edit",
    "ProfilingPointsWindowUI_RemoveItemText=Delete",
    "ProfilingPointsWindowUI_ScopeColumnName=Scope",
    "ProfilingPointsWindowUI_ProjectColumnName=Project",
    "ProfilingPointsWindowUI_PpColumnName=Profiling Point",
    "ProfilingPointsWindowUI_ResultsColumnName=Results",
    "ProfilingPointsWindowUI_ScopeColumnToolTip=Profiling Point scope",
    "ProfilingPointsWindowUI_ProjectColumnToolTip=Project for which the Profiling Point is defined",
    "ProfilingPointsWindowUI_PpColumnToolTip=Profiling Point",
    "ProfilingPointsWindowUI_ResultsColumnToolTip=Data or current state of the Profiling Point",
    "ProfilingPointsWindowUI_NoStartDefinedMsg=No start point defined for this Profiling Point",
    "ProfilingPointsWindowUI_NoEndDefinedMsg=No end point defined for this Profiling Point"
})
                                                               MouseListenerMouseMotionListenerKeyListener {
    //~ Static fields/initializers -----------------------------------------------------------------------------------------------
    private static final Icon PPOINT_ADD_ICON = Icons.getIcon(.);
    private static final Icon PPOINT_REMOVE_ICON = Icons.getIcon(.);
    private static final Icon PPOINT_EDIT_ICON = Icons.getIcon(.);
    //~ Instance fields ----------------------------------------------------------------------------------------------------------
    protected String[] columnNames;
    protected TableCellRenderer[] columnRenderers;
    protected String[] columnToolTips;
    protected Class[] columnTypes;
    protected int[] columnWidths;
    protected boolean sortOrder// Defines the sorting order (ascending or descending)
    protected int sortBy// Defines sorting criteria (concrete values provided in subclasses)
    private JButton addButton;
    private JButton disableButton;
    private JButton editButton;
    private JButton removeButton;
    private JComboBox projectsCombo;
    private JLabel projectLabel;
    private JMenuItem disableItem;
    private JMenuItem editItem;
    private JMenuItem enableDisableItem;
    private JMenuItem enableItem;
    private JMenuItem removeItem;
    private JMenuItem showInSourceItem;
    private JMenuItem showReportItem;
    private ProfilingPoint[] profilingPoints = new ProfilingPoint[0];
    private boolean profilingInProgress = false;
    private int initialSortingColumn;
    private int minProfilingPointColumnWidth// minimal width of Profiling Point column
    private boolean internalComboChange;
    //~ Constructors -------------------------------------------------------------------------------------------------------------
    public ProfilingPointsWindowUI() {
        setDefaultSorting();
        initColumnsData();
        initComponents();
        updateProjectsCombo();
        updateButtons();
        ProfilingPointsManager.getDefault().addPropertyChangeListener(this);
    }
    //~ Methods ------------------------------------------------------------------------------------------------------------------
    // NOTE: this method only sets sortBy and sortOrder, it doesn't refresh UI!
    public void setDefaultSorting() {
    }
    public Lookup.Provider getSelectedProject() {
        return (.getSelectedItem() instanceof Lookup.Provider) ? (Lookup.Provider.getSelectedItem() : null;
    }
    // NOTE: this method only sets sortBy and sortOrder, it doesn't refresh UI!
    public void setSorting(int sColumnboolean sOrder) {
        if (sColumn == .) {
            setDefaultSorting();
        } else {
             = sColumn;
             = getSortBy();
             = sOrder;
        }
    }
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == ) {
            if (!refreshProfilingPoints();
        } else if (e.getSource() == ) {
            SystemAction.get(InsertProfilingPointAction.class).performAction(getSelectedProject());
        } else if (e.getSource() == ) {
            int[] selectedRows = .getSelectedRows();
            ProfilingPoint[] selectedProfilingPoints = new ProfilingPoint[selectedRows.length];
            for (int i = 0; i < selectedRows.lengthi++) {
                selectedProfilingPoints[i] = getProfilingPointAt(selectedRows[i]);
            }
            ProfilingPointsManager.getDefault().removeProfilingPoints(selectedProfilingPoints);
        } else if (e.getSource() == ) {
            ProfilingPoint selectedProfilingPoint = getProfilingPointAt(.getSelectedRow());
            selectedProfilingPoint.customize(falsefalse);
        } else if (e.getSource() == ) {
            int[] selectedRows = .getSelectedRows();
            for (int i : selectedRows) {
                ProfilingPoint selectedProfilingPoint = getProfilingPointAt(i);
                selectedProfilingPoint.setEnabled(!selectedProfilingPoint.isEnabled());
                repaint();
            }
        } else if (e.getSource() == ) {
            CodeProfilingPoint selectedProfilingPoint = (CodeProfilingPointgetProfilingPointAt(
                                                                                                                                                                                                                                                                       .getSelectedRow());
            Utils.openLocation(selectedProfilingPoint.getLocation());
        } else if (e.getSource() == ) {
            CodeProfilingPoint.Paired selectedProfilingPoint = (CodeProfilingPoint.PairedgetProfilingPointAt(
                                                                                                               .getSelectedRow());
            CodeProfilingPoint.Location location = selectedProfilingPoint.getStartLocation();
            if (location == null) {
                ProfilerDialogs.displayWarning(
                        Bundle.ProfilingPointsWindowUI_NoStartDefinedMsg());
            } else {
                Utils.openLocation(location);
            }
        } else if (e.getSource() == ) {
            CodeProfilingPoint.Paired selectedProfilingPoint = (CodeProfilingPoint.PairedgetProfilingPointAt(
                                                                                                               .getSelectedRow());
            CodeProfilingPoint.Location location = selectedProfilingPoint.getEndLocation();
            if (location == null) {
                ProfilerDialogs.displayWarning(
                        Bundle.ProfilingPointsWindowUI_NoEndDefinedMsg());
            } else {
                Utils.openLocation(location);
            }
        } else if (e.getSource() == ) {
            int[] selectedRows = .getSelectedRows();
            if (selectedRows.length == 0) {
                return;
            }
            for (int selectedRow : selectedRows) {
                ProfilingPoint selectedProfilingPoint = getProfilingPointAt(selectedRow);
                selectedProfilingPoint.showResults(null);
            }
        } else if (e.getSource() == ) {
            int selectedRow = .getSelectedRow();
            if (selectedRow == -1) {
                return;
            }
            ProfilingPoint selectedProfilingPoint = getProfilingPointAt(selectedRow);
            selectedProfilingPoint.setEnabled(true);
        } else if (e.getSource() == ) {
            int selectedRow = .getSelectedRow();
            if (selectedRow == -1) {
                return;
            }
            ProfilingPoint selectedProfilingPoint = getProfilingPointAt(selectedRow);
            selectedProfilingPoint.setEnabled(false);
        } else if (e.getSource() == ) {
            int[] selectedRows = .getSelectedRows();
            if (selectedRows.length == 0) {
                return;
            }
            for (int selectedRow : selectedRows) {
                ProfilingPoint selectedProfilingPoint = getProfilingPointAt(selectedRow);
                selectedProfilingPoint.setEnabled(!selectedProfilingPoint.isEnabled());
            }
        } else if (e.getSource() == ) {
            int selectedRow = .getSelectedRow();
            if (selectedRow == -1) {
                return;
            }
            ProfilingPoint selectedProfilingPoint = getProfilingPointAt(selectedRow);
            selectedProfilingPoint.customize(falsefalse);
        } else if (e.getSource() == ) {
            deletePPs();
        }
    }
    public void keyPressed(KeyEvent e) {
        if ((e.getKeyCode() == .)
                || ((e.getKeyCode() == .) && (e.getModifiers() == .))) {
            int[] selectedRows = .getSelectedRows();
            if (selectedRows.length != 0) {
                Rectangle rowBounds = .getCellRect(selectedRows[0], 1, true);
                showProfilingPointsPopup(e.getComponent(), rowBounds.x + 20,
                                         rowBounds.y + (.getRowHeight() / 2));
            }
        } else if (e.getKeyCode() == .) {
            deletePPs();
        }
    }
    public void keyReleased(KeyEvent e) {
    }
    public void keyTyped(KeyEvent e) {
    }
    public void mouseClicked(MouseEvent e) {
        if (e.getModifiers() == .) {
            int clickedRow = .rowAtPoint(e.getPoint());
            if ((clickedRow != -1) && (e.getClickCount() == 2)) {
                ProfilingPoint profilingPoint = getProfilingPointAt(clickedRow);
                if (profilingPoint instanceof CodeProfilingPoint) {
                    Utils.openLocation(((CodeProfilingPointprofilingPoint).getLocation());
                }
            }
        } else if (e.getModifiers() == .) {
            int clickedRow = .rowAtPoint(e.getPoint());
            int selectedRowCount = .getSelectedRowCount();
            if ((clickedRow != -1) && (selectedRowCount != 0)) {
                if (selectedRowCount == 1)
                    .setRowSelectionInterval(clickedRowclickedRow);
                showProfilingPointsPopup(e.getComponent(), e.getX(), e.getY());
                return;
            }
        }
    }
    public void mouseDragged(MouseEvent e) {
    }
    public void mouseEntered(MouseEvent e) {
    }
    public void mouseExited(MouseEvent e) {
    }
    public void mouseMoved(MouseEvent e) {
    }
    public void mousePressed(MouseEvent e) {
        if (e.getModifiers() == .) {
            int clickedRow = .rowAtPoint(e.getPoint());
            if (clickedRow != -1) {
                int[] selectedRows = .getSelectedRows();
                if (selectedRows.length == 0) {
                    .setRowSelectionInterval(clickedRowclickedRow);
                } else {
                    boolean changeSelection = true;
                    for (int selectedRow : selectedRows) {
                        if (selectedRow == clickedRow) {
                            changeSelection = false;
                        }
                    }
                    if (changeSelection) {
                        .setRowSelectionInterval(clickedRowclickedRow);
                    }
                }
            }
        }
    }
    public void mouseReleased(MouseEvent e) {
    }
    public void notifyProfilingStateChanged() {
         = ProfilingPointsManager.getDefault().isProfilingSessionInProgress();
        updateButtons();
    }
    public void propertyChange(PropertyChangeEvent evt) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() { updateProjectsCombo(); } // also refreshes profiling points
            });
            refreshProfilingPoints();
        }
    }
    public void valueChanged(ListSelectionEvent e) {
        updateButtons();
    }
    protected void initColumnsData() {
         = getFontMetrics(getFont()).charWidth('W') * 30; // NOI18N
        EnhancedTableCellRenderer scopeRenderer = Utils.getScopeRenderer();
        EnhancedTableCellRenderer projectRenderer = Utils.getProjectRenderer();
        EnhancedTableCellRenderer profilingPointRenderer = Utils.getPresenterRenderer();
         = new String[] { 
            Bundle.ProfilingPointsWindowUI_ScopeColumnName(), 
            Bundle.ProfilingPointsWindowUI_ProjectColumnName(), 
            Bundle.ProfilingPointsWindowUI_PpColumnName(), 
            Bundle.ProfilingPointsWindowUI_ResultsColumnName() 
        };
         = new String[] { 
            Bundle.ProfilingPointsWindowUI_ScopeColumnToolTip(), 
            Bundle.ProfilingPointsWindowUI_ProjectColumnToolTip(), 
            Bundle.ProfilingPointsWindowUI_PpColumnToolTip(), 
            Bundle.ProfilingPointsWindowUI_ResultsColumnToolTip()
        };
         = new Class[] { Integer.classLookup.Provider.classProfilingPoint.classProfilingPoint.ResultsRenderer.class };
         = new TableCellRenderer[] { scopeRendererprojectRendererprofilingPointRenderernull // dynamic
                          };
         = new int[] { 50, 165, -1, // dynamic
            200 };
    }
    private void setColumnsData() {
        //    colModel.getColumn(1).setPreferredWidth(minProfilingPointColumnWidth); // TODO: revert use column 2 once Scope is enabled
        int index;
        for (int i = 0; i < colModel.getColumnCount(); i++) {
            index = .getRealColumn(i);
            colModel.getColumn(i).setPreferredWidth((index == 2) ?  : [index]);
            //      colModel.getColumn(i).setPreferredWidth(index == 1 ? minProfilingPointColumnWidth : columnWidths[index]); // TODO: revert use column 2 once Scope is enabled
            colModel.getColumn(i).setCellRenderer([index]);
        }
    }
    private ProfilingPoint getProfilingPointAt(int row) {
        return (ProfilingPoint.getValueAt(row, 0);
    }
    private int getSortBy(int column) {
        switch (column) {
            case 0:
                return .;
            case 1:
                return .;
            case 2:
                return .// TODO: revert use column 2 once Scope is enabled
            case 3:
                return .// TODO: revert use column 3 once Scope is enabled
            default:
                return .;
        }
    }
    private void createProfilingPointsTable() {
                public String getColumnName(int col) {
                    return [col];
                }
                public int getRowCount() {
                    return .;
                }
                public int getColumnCount() {
                    return .;
                }
                public Class getColumnClass(int col) {
                    return [col];
                }
                public Object getValueAt(int rowint col) {
                    return [row];
                }
                public String getColumnToolTipText(int col) {
                    return [col];
                }
                public void sortByColumn(int columnboolean order) {
                     = getSortBy(column);
                     = order;
                    refreshProfilingPoints();
                }

                

Parameters:
column The table column index
Returns:
Initial sorting for the specified column - if true, ascending, if false descending
                public boolean getInitialSorting(int column) {
                    return true;
                }
            });
                public TableCellRenderer getCellRenderer(int rowint column) {
                    if (getColumnClass(column) == ProfilingPoint.ResultsRenderer.class) {
                        return getProfilingPointAt(row).getResultsRenderer();
                    } else {
                        return super.getCellRenderer(rowcolumn);
                    }
                }
                public void doLayout() {
                    int columnsWidthsSum = 0;
                    int realFirstColumn = -1;
                    int index;
                    for (int i = 0; i < .getColumnCount(); i++) {
                        index = .getRealColumn(i);
                        if (index == 2) {
                            //          if (index == 1) { // TODO: revert use column 2 once Scope is enabled
                            realFirstColumn = i;
                        } else {
                            columnsWidthsSum += getColumnModel().getColumn(i).getPreferredWidth();
                        }
                    }
                    if (realFirstColumn != -1) {
                        getColumnModel().getColumn(realFirstColumn)
                            .setPreferredWidth(Math.max(getWidth() - columnsWidthsSum));
                    }
                    super.doLayout();
                }
                ;
            };
        //    profilingPointsTable.getAccessibleContext().setAccessibleName(TABLE_ACCESS_NAME);
        .setRowHeight(UIUtils.getDefaultRowHeight() + 2);
        setColumnsData();
    }
    private void deletePPs() {
        int[] selectedRows = .getSelectedRows();
        if (selectedRows.length == 0) {
            return;
        }
        List<ProfilingPointpointsToRemove = new ArrayList();
        for (int selectedRow : selectedRows) {
            ProfilingPoint selectedProfilingPoint = getProfilingPointAt(selectedRow);
            pointsToRemove.add(selectedProfilingPoint);
        }
        for (ProfilingPoint pointToRemove : pointsToRemove) {
            ProfilingPointsManager.getDefault().removeProfilingPoint(pointToRemove);
        }
    }
    private void dispatchResultsRendererEvent(MouseEvent e) {
        int column = .columnAtPoint(e.getPoint());
        if (column != 3) {
            //    if (column != 2) { // TODO: revert to 3 once Scope is enabled
            .setCursor(Cursor.getDefaultCursor()); // Workaround for forgotten Hand cursor from HTML renderer, TODO: fix it!
            return;
        }
        int row = .rowAtPoint(e.getPoint());
        if (row == -1) {
            return;
        }
        ProfilingPoint profilingPoint = getProfilingPointAt(row);
        ProfilingPoint.ResultsRenderer resultsRenderer = profilingPoint.getResultsRenderer();
        Rectangle cellRect = .getCellRect(rowcolumntrue);
        MouseEvent mouseEvent = new MouseEvent(e.getID(), e.getWhen(), e.getModifiers(),
                                               e.getX() - cellRect.xe.getY() - cellRect.ye.getClickCount(),
                                               e.isPopupTrigger(), e.getButton());
        resultsRenderer.dispatchMouseEvent(mouseEvent);
    }
    private void initComponents() {
        setLayout(new BorderLayout());
        ProfilerToolbar toolbar = ProfilerToolbar.create(true);
         = new JLabel();
        org.openide.awt.Mnemonics.setLocalizedText(, Bundle.ProfilingPointsWindowUI_ProjectLabelText());
        .setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
         = new JComboBox(new Object[] { Bundle.ProfilingPointsWindowUI_AllProjectsString() }) {
                public Dimension getMaximumSize() {
                    return getPreferredSize();
                }
                public Dimension getPreferredSize() {
                    return new Dimension(200, super.getPreferredSize().);
                }
                ;
                public Dimension getMinimumSize() {
                    return getPreferredSize();
                }
                ;
            };
        .addActionListener(this);
        toolbar.add();
        toolbar.add();
        if (ProfilingPointsUIHelper.get().displaySubprojectsOption()) {
             = new JCheckBox();
            .setOpaque(false);
            UIUtils.addBorder(, BorderFactory.createEmptyBorder(0, 4, 0, 3));
            org.openide.awt.Mnemonics.setLocalizedText(, Bundle.ProfilingPointsWindowUI_InclSubprojCheckboxText());
            toolbar.add();
            .addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        ProfilerIDESettings.getInstance().setIncludeProfilingPointsDependencies(.isSelected());
                        refreshProfilingPoints();
                    }
                });
        }
        toolbar.addSeparator();
         = new JButton();
        .addActionListener(this);
        toolbar.add();
         = new JButton();
        .addActionListener(this);
        toolbar.add();
        toolbar.addSeparator();
         = new JButton();
        .addActionListener(this);
        toolbar.add();
        .addActionListener(this);
        toolbar.add();
        JExtendedTablePanel tablePanel = new JExtendedTablePanel();
        tablePanel.clearBorders();
        .addActionListener(this);
        .addActionListener(this);
        .addActionListener(this);
        .addActionListener(this);
         = new JMenuItem(Bundle.ProfilingPointsWindowUI_EditItemText());
        .addActionListener(this);
        .addActionListener(this);
         = new JPopupMenu();
        add(toolbar.getComponent(), .);
        add(tablePanel.);
    }
    private void refreshProfilingPoints() {
        int[] selectedRows = .getSelectedRows();
        ProfilingPoint[] selectedProfilingPoints = new ProfilingPoint[selectedRows.length];
        for (int i = 0; i < selectedRows.lengthi++) {
            selectedProfilingPoints[i] = getProfilingPointAt(selectedRows[i]);
        }
        List<ProfilingPointsortedProfilingPoints = ProfilingPointsManager.getDefault()
                                                                           .getSortedProfilingPoints(getSelectedProject(),
                                                                                                     );
         = sortedProfilingPoints.toArray(new ProfilingPoint[sortedProfilingPoints.size()]);
        if (selectedProfilingPoints.length > 0) {
            .selectRowsByInstances(selectedProfilingPoints, 0, true);
        }
        repaint();
    }
    private void showProfilingPointsPopup(Component sourceint xint y) {
        int[] selectedRows = .getSelectedRows();
        if (selectedRows.length == 0) {
            return;
        }
        boolean singleSelection = selectedRows.length == 1;
        ProfilingPoint selectedProfilingPoint = getProfilingPointAt(selectedRows[0]);
        .setVisible(!singleSelection || selectedProfilingPoint instanceof CodeProfilingPoint.Single);
        .setEnabled(singleSelection);
        .setVisible(singleSelection && selectedProfilingPoint instanceof CodeProfilingPoint.Paired);
        .setVisible(singleSelection && selectedProfilingPoint instanceof CodeProfilingPoint.Paired);
        .setEnabled(true);
        .setVisible(singleSelection && !selectedProfilingPoint.isEnabled());
        .setVisible(singleSelection && selectedProfilingPoint.isEnabled());
        .setVisible(!singleSelection);
        .setEnabled(singleSelection && !);
        .show(sourcexy);
    }
    private void updateButtons() {
        int[] selectedRows = .getSelectedRows();
        if (selectedRows.length == 0) {
            .setEnabled(false);
            .setEnabled(false);
            .setEnabled(false);
        } else if (selectedRows.length == 1) {
            .setEnabled(!);
        } else {
            .setEnabled(false);
        }
    }
    private void updateProjectsCombo() {
        Lookup.Provider[] projects = ProjectUtilities.getSortedProjects(ProjectUtilities.getOpenedProjects());
        List items = new ArrayList(projects.length + 1);
        items.addAll(Arrays.asList(projects));
        items.add(0, Bundle.ProfilingPointsWindowUI_AllProjectsString());
        Object selectedItem = .getSelectedItem();
         = true;
        comboModel.removeAllElements();
        for (int i = 0; i < items.size(); i++) {
            comboModel.addElement(items.get(i));
        }
        if ((selectedItem != null) && (comboModel.getIndexOf(selectedItem) != -1)) {
            .setSelectedItem(selectedItem);
        } else {
        }
         = false;
        refreshProfilingPoints();
    }