From 0137c4d0e89841e5e1f175c99d4f9db775779e46 Mon Sep 17 00:00:00 2001 From: "andrey.zaytsev" Date: Wed, 2 Oct 2013 17:16:33 +0400 Subject: [PATCH] safe delete dead code --- .../ui/breakpoints/BreakpointFactory.java | 3 - .../ui/breakpoints/BreakpointPanel.form | 52 -- .../ui/breakpoints/BreakpointPanel.java | 559 ------------------ .../ExceptionBreakpointFactory.java | 6 - .../breakpoints/FieldBreakpointFactory.java | 5 - .../breakpoints/MethodBreakpointFactory.java | 6 - .../ui/breakpoints/actions/AddAction.java | 56 -- .../actions/BreakpointPanelAction.java | 61 -- .../breakpoints/actions/GotoSourceAction.java | 63 -- .../ui/breakpoints/actions/RemoveAction.java | 73 --- .../breakpoints/actions/SwitchViewAction.java | 45 -- .../actions/ToggleFlattenPackagesAction.java | 52 -- .../actions/ToggleGroupByClassesAction.java | 52 -- .../actions/ToggleGroupByMethodsAction.java | 52 -- .../breakpoints/actions/ViewSourceAction.java | 48 -- 15 files changed, 1133 deletions(-) delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPanel.form delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPanel.java delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/AddAction.java delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/BreakpointPanelAction.java delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/GotoSourceAction.java delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/RemoveAction.java delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/SwitchViewAction.java delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleFlattenPackagesAction.java delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleGroupByClassesAction.java delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleGroupByMethodsAction.java delete mode 100644 java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ViewSourceAction.java diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointFactory.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointFactory.java index 2077b56dc34e..67c32935849e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointFactory.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointFactory.java @@ -55,9 +55,6 @@ public abstract class BreakpointFactory { return null; } - protected void configureBreakpointPanel(BreakpointPanel panel) { - } - protected abstract String getHelpID(); public abstract String getDisplayName(); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPanel.form b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPanel.form deleted file mode 100644 index ff8bf76957ef..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPanel.form +++ /dev/null @@ -1,52 +0,0 @@ - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPanel.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPanel.java deleted file mode 100644 index a19c9e52e2e8..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPanel.java +++ /dev/null @@ -1,559 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints; - -import com.intellij.debugger.DebuggerManagerEx; -import com.intellij.debugger.ui.breakpoints.actions.BreakpointPanelAction; -import com.intellij.openapi.editor.Document; -import com.intellij.openapi.fileEditor.FileDocumentManager; -import com.intellij.openapi.fileEditor.OpenFileDescriptor; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Key; -import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.psi.PsiField; -import com.intellij.ui.IdeBorderFactory; -import com.intellij.ui.ScrollPaneFactory; -import com.intellij.ui.SideBorder; -import com.intellij.ui.TableUtil; -import com.intellij.util.ui.UIUtil; -import com.intellij.util.ui.tree.TreeUtil; -import com.intellij.xdebugger.impl.breakpoints.ui.AbstractBreakpointPanel; -import gnu.trove.TIntArrayList; -import org.jetbrains.annotations.NonNls; - -import javax.swing.*; -import javax.swing.event.*; -import javax.swing.tree.TreeModel; -import javax.swing.tree.TreePath; -import javax.swing.tree.TreeSelectionModel; -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Jeka - */ -public class BreakpointPanel extends AbstractBreakpointPanel { - private final BreakpointPropertiesPanel myPropertiesPanel; - private final BreakpointPanelAction[] myActions; - private final Key myBreakpointCategory; - private Breakpoint myCurrentViewableBreakpoint; - private final List myDisposeActions = new ArrayList(); - - private final Project myProject; - private JPanel myPanel; - private JPanel myBreakPointsPanel; - private JPanel myTablePlace; - private JPanel myPropertiesPanelPlace; - private final BreakpointTable myTable; - private final BreakpointTree myTree; - private JPanel myButtonsPanel; - private String myCurrentViewId = TABLE_VIEW; - - private static final @NonNls String PROPERTIES_STUB = "STUB"; - private static final @NonNls String PROPERTIES_DATA = "DATA"; - - public static final @NonNls String TREE_VIEW = "TREE"; - public static final @NonNls String TABLE_VIEW = "TABLE"; - - public BreakpointPanel(final Project project, - BreakpointPropertiesPanel propertiesPanel, - final BreakpointPanelAction[] actions, - Key breakpointCategory, - String tabName, - String helpId) { - super(tabName, helpId, Breakpoint.class); - myProject = project; - myPropertiesPanel = propertiesPanel; - myActions = actions; - myBreakpointCategory = breakpointCategory; - - myTable = new BreakpointTable(project); - myTree = new BreakpointTree(project); - - myTablePlace.setLayout(new CardLayout()); - JScrollPane pane = ScrollPaneFactory.createScrollPane(myTable); - pane.putClientProperty(UIUtil.KEEP_BORDER_SIDES, SideBorder.ALL); - myTablePlace.add(pane, TABLE_VIEW); - - final ListSelectionListener listSelectionListener = new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - if (!e.getValueIsAdjusting()) { - updateCurrentBreakpointPropertiesPanel(); - } - } - }; - final ListSelectionModel tableSelectionModel = myTable.getSelectionModel(); - tableSelectionModel.addListSelectionListener(listSelectionListener); - myDisposeActions.add(new Runnable() { - public void run() { - tableSelectionModel.removeListSelectionListener(listSelectionListener); - } - }); - - final TreeSelectionModel treeSelectionModel = myTree.getSelectionModel(); - final TreeSelectionListener treeSelectionListener = new TreeSelectionListener() { - public void valueChanged(TreeSelectionEvent e) { - updateCurrentBreakpointPropertiesPanel(); - } - }; - treeSelectionModel.addTreeSelectionListener(treeSelectionListener); - myDisposeActions.add(new Runnable() { - public void run() { - treeSelectionModel.removeTreeSelectionListener(treeSelectionListener); - } - }); - - final BreakpointTableModel tableModel = myTable.getModel(); - final TableModelListener tableModelListener = new TableModelListener() { - public void tableChanged(TableModelEvent e) { - if (e.getType() == TableModelEvent.UPDATE) { - updateCurrentBreakpointPropertiesPanel(); - } - fireBreakpointsChanged(); - } - }; - tableModel.addTableModelListener(tableModelListener); - myDisposeActions.add(new Runnable() { - public void run() { - tableModel.removeTableModelListener(tableModelListener); - } - }); - - - final TreeModel treeModel = myTree.getModel(); - final TreeModelListener treeModelListener = new TreeModelListener() { - public void treeNodesChanged(TreeModelEvent e) { - } - - public void treeNodesInserted(TreeModelEvent e) { - } - - public void treeNodesRemoved(TreeModelEvent e) { - } - - public void treeStructureChanged(TreeModelEvent e) { - SwingUtilities.invokeLater(new Runnable() { - public void run() { - ensureSelectionExists(); - updateButtons(); - } - }); - } - }; - treeModel.addTreeModelListener(treeModelListener); - myDisposeActions.add(new Runnable() { - public void run() { - treeModel.removeTreeModelListener(treeModelListener); - } - }); - - myPropertiesPanelPlace.setLayout(new CardLayout()); - final JPanel stubPanel = new JPanel(); - stubPanel.setMinimumSize(myPropertiesPanel.getPanel().getMinimumSize()); - myPropertiesPanelPlace.add(stubPanel, PROPERTIES_STUB); - myPropertiesPanelPlace.add(myPropertiesPanel.getPanel(), PROPERTIES_DATA); - - myBreakPointsPanel.setBorder(IdeBorderFactory.createEmptyBorder(6, 6, 0, 6)); - - myButtonsPanel.setLayout(new GridBagLayout()); - for (int idx = 0; idx < actions.length; idx++) { - final BreakpointPanelAction action = actions[idx]; - action.setPanel(this); - final AbstractButton button = action.isStateAction()? new JCheckBox(action.getName()) : new JButton(action.getName()); - action.setButton(button); - button.addActionListener(action); - myDisposeActions.add(new Runnable() { - public void run() { - button.removeActionListener(action); - } - }); - final double weighty = (idx == actions.length - 1) ? 1.0 : 0.0; - myButtonsPanel.add(button, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, weighty, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 2, 2), 0, 0)); - } - final ListSelectionListener tableSelectionListener = new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - updateButtons(); - } - }; - tableSelectionModel.addListSelectionListener(tableSelectionListener); - myDisposeActions.add(new Runnable() { - public void run() { - tableSelectionModel.removeListSelectionListener(tableSelectionListener); - } - }); - - pane = ScrollPaneFactory.createScrollPane(myTree); - pane.putClientProperty(UIUtil.KEEP_BORDER_SIDES, SideBorder.ALL); - myTablePlace.add(pane, TREE_VIEW); - - updateCurrentBreakpointPropertiesPanel(); - - final BreakpointManager breakpointManager = DebuggerManagerEx.getInstanceEx(project).getBreakpointManager(); - final BreakpointManagerListener breakpointManagerListener = new BreakpointManagerListener() { - public void breakpointsChanged() { - if (isTreeShowing()) { - myTree.repaint(); - } - else { - myTable.repaint(); - } - } - }; - breakpointManager.addBreakpointManagerListener(breakpointManagerListener); - myDisposeActions.add(new Runnable() { - public void run() { - breakpointManager.removeBreakpointManagerListener(breakpointManagerListener); - } - }); - } - - public BreakpointTable getTable() { - return myTable; - } - - public BreakpointTree getTree() { - return myTree; - } - - public void switchViews() { - final Breakpoint[] selectedBreakpoints = getSelectedBreakpoints(); - showView(isTreeShowing() ? TABLE_VIEW : TREE_VIEW); - selectBreakpoints(selectedBreakpoints); - } - - public void showView(final String viewId) { - if (TREE_VIEW.equals(viewId) || TABLE_VIEW.equals(viewId)) { - myCurrentViewId = viewId; - ((CardLayout)myTablePlace.getLayout()).show(myTablePlace, viewId); - updateButtons(); - ensureSelectionExists(); - } - } - - public String getCurrentViewId() { - return myCurrentViewId; - } - - public boolean isTreeShowing() { - return BreakpointPanel.TREE_VIEW.equals(getCurrentViewId()); - } - - @SuppressWarnings({"HardCodedStringLiteral"}) - public void setupPanelUI() { - final BreakpointManager breakpointManager = getBreakpointManager(); - final Key category = getBreakpointCategory(); - final BreakpointTree tree = getTree(); - final String flattenPackages = breakpointManager.getProperty(category + "_flattenPackages"); - if (flattenPackages != null) { - tree.setFlattenPackages("true".equalsIgnoreCase(flattenPackages)); - } - final String groupByClasses = breakpointManager.getProperty(category + "_groupByClasses"); - if (groupByClasses != null) { - tree.setGroupByClasses("true".equalsIgnoreCase(groupByClasses)); - } - final String groupByMethods = breakpointManager.getProperty(category + "_groupByMethods"); - if (groupByMethods != null) { - tree.setGroupByMethods("true".equalsIgnoreCase(groupByMethods)); - } - - final String viewId = breakpointManager.getProperty(category + "_viewId"); - if (viewId != null) { - showView(viewId); - } - } - - @SuppressWarnings({"HardCodedStringLiteral"}) - public void savePanelSettings() { - Key category = getBreakpointCategory(); - final BreakpointManager breakpointManager = getBreakpointManager(); - - final BreakpointTree tree = getTree(); - breakpointManager.setProperty(category + "_flattenPackages", tree.isFlattenPackages() ? "true" : "false"); - breakpointManager.setProperty(category + "_groupByClasses", tree.isGroupByClasses() ? "true" : "false"); - breakpointManager.setProperty(category + "_groupByMethods", tree.isGroupByMethods() ? "true" : "false"); - breakpointManager.setProperty(category + "_viewId", getCurrentViewId()); - } - - protected BreakpointManager getBreakpointManager() { - return DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager(); - } - - private boolean hasEnabledBreakpoints() { - final List breakpoints = getBreakpoints(); - for (Breakpoint breakpoint : breakpoints) { - if (breakpoint.ENABLED) { - return true; - } - } - return false; - } - - public Icon getTabIcon() { - final BreakpointFactory factory = BreakpointFactory.getInstance(getBreakpointCategory()); - return hasEnabledBreakpoints() ? factory.getIcon() : factory.getDisabledIcon(); - } - - public boolean canSelectBreakpoint(final Breakpoint breakpoint) { - return breakpoint.getCategory().equals(getBreakpointCategory()); - } - - public Key getBreakpointCategory() { - return myBreakpointCategory; - } - - public Breakpoint getCurrentViewableBreakpoint() { - return myCurrentViewableBreakpoint; - } - - public void saveBreakpoints() { - if (myCurrentViewableBreakpoint != null) { - myPropertiesPanel.saveTo(myCurrentViewableBreakpoint, new Runnable() { - public void run() { - myTable.repaint(); - } - }); - } - } - - public void updateButtons() { - for (final BreakpointPanelAction action : myActions) { - final AbstractButton button = action.getButton(); - action.update(); - if (!button.isEnabled() && button.hasFocus()) { - button.transferFocus(); - } - } - } - - public JPanel getPanel() { - return myPanel; - } - - public void selectBreakpoint(Breakpoint breakpoint) { - if (isTreeShowing()) { - myTree.selectBreakpoint(breakpoint); - } - else { - int index = myTable.getModel().getBreakpointIndex(breakpoint); - ListSelectionModel model = myTable.getSelectionModel(); - model.clearSelection(); - model.addSelectionInterval(index, index); - } - } - - @Override - public boolean hasBreakpoints() { - return getBreakpointManager().getBreakpoints(getBreakpointCategory()).length > 0; - } - - public void selectBreakpoints(Breakpoint[] breakpoints) { - if (isTreeShowing()) { - myTree.selectBreakpoints(breakpoints); - } - else { - final TIntArrayList rows = new TIntArrayList(breakpoints.length); - for (Breakpoint breakpoint : breakpoints) { - final int index = myTable.getModel().getBreakpointIndex(breakpoint); - if (index >= 0) { - rows.add(index); - } - } - myTable.getSelectionModel().clearSelection(); - TableUtil.selectRows(myTable, rows.toNativeArray()); - } - } - - public void resetBreakpoints() { - Breakpoint[] breakpoints = getBreakpointManager().getBreakpoints(getBreakpointCategory()); - myTable.setBreakpoints(breakpoints); - myTree.setBreakpoints(breakpoints); - ensureSelectionExists(); - updateButtons(); - } - - public Breakpoint[] getSelectedBreakpoints() { - return isTreeShowing() ? myTree.getSelectedBreakpoints() : myTable.getSelectedBreakpoints(); - } - - public void removeSelectedBreakpoints() { - final Breakpoint[] selectedBreakpoints = getSelectedBreakpoints(); - if (selectedBreakpoints.length == 0) { - return; - } - - final boolean inTreeMode = isTreeShowing(); - - final int minSelectionIndex; - if (inTreeMode) { - minSelectionIndex = Math.max(0, myTree.getSelectionModel().getMinSelectionRow()); - } - else { - minSelectionIndex = Math.max(0, myTable.getSelectionModel().getMinSelectionIndex()); - } - - myTree.removeBreakpoints(selectedBreakpoints); - myTable.getModel().removeBreakpoints(selectedBreakpoints); - myCurrentViewableBreakpoint = null; - - if (inTreeMode) { - if (myTree.getRowCount() > 0) { - int rowToSelect = minSelectionIndex >= myTree.getRowCount()? myTree.getRowCount() - 1 : minSelectionIndex; - final TreePath path = myTree.getPathForRow(rowToSelect); - if (path != null) { - TreeUtil.selectPath(myTree, path, true); - } - } - } - else { - if (myTable.getRowCount() > 0) { // if in table mode and there are items to select - int indexToSelect = minSelectionIndex >= myTable.getRowCount()? myTable.getRowCount() - 1 : minSelectionIndex; - TableUtil.selectRows(myTable, new int[] {indexToSelect}); - } - } - - updateCurrentBreakpointPropertiesPanel(); - } - - public void insertBreakpointAt(Breakpoint breakpoint, int index) { - myTable.getModel().insertBreakpointAt(breakpoint, index); - myTree.addBreakpoint(breakpoint); - selectBreakpoint(breakpoint); - } - - public void addBreakpoint(Breakpoint breakpoint) { - myTable.getModel().addBreakpoint(breakpoint); - myTree.addBreakpoint(breakpoint); - selectBreakpoint(breakpoint); - } - - private void updateCurrentBreakpointPropertiesPanel() { - if (myCurrentViewableBreakpoint != null) { - myPropertiesPanel.saveTo(myCurrentViewableBreakpoint, new Runnable() { - public void run() { - if (isTreeShowing()) { - myTree.repaint(); - } - else { - myTable.repaint(); - } - } - }); - } - Breakpoint[] breakpoints = getSelectedBreakpoints(); - Breakpoint oldViewableBreakpoint = myCurrentViewableBreakpoint; - myCurrentViewableBreakpoint = (breakpoints != null && breakpoints.length == 1) ? breakpoints[0] : null; - if (myCurrentViewableBreakpoint != null) { - if (oldViewableBreakpoint == null) { - ((CardLayout)myPropertiesPanelPlace.getLayout()).show(myPropertiesPanelPlace, PROPERTIES_DATA); - } - myPropertiesPanel.initFrom(myCurrentViewableBreakpoint, true); - } - else { - ((CardLayout)myPropertiesPanelPlace.getLayout()).show(myPropertiesPanelPlace, PROPERTIES_STUB); - } - updateButtons(); - } - - public JComponent getControl(String control) { - return myPropertiesPanel.getControl(control); - } - - public int getBreakpointCount() { - return myTable.getBreakpoints().size(); - } - - public final List getBreakpoints() { - return myTable.getBreakpoints(); - } - - public void dispose() { - savePanelSettings(); - for (Runnable runnable : myDisposeActions) { - runnable.run(); - } - myDisposeActions.clear(); - - myTree.dispose(); - - final KeyStroke[] tableStrokes = myTable.getRegisteredKeyStrokes(); - for (KeyStroke stroke : tableStrokes) { - myTable.unregisterKeyboardAction(stroke); - } - - myPropertiesPanel.dispose(); - } - - public OpenFileDescriptor createEditSourceDescriptor(final Project project) { - Breakpoint[] breakpoints = getSelectedBreakpoints(); - if (breakpoints == null || breakpoints.length == 0) { - return null; - } - Breakpoint br = breakpoints[0]; - int line; - Document doc; - if (br instanceof BreakpointWithHighlighter) { - BreakpointWithHighlighter breakpoint = (BreakpointWithHighlighter)br; - doc = breakpoint.getDocument(); - line = breakpoint.getLineIndex(); - } - else { - return null; - } - if (line < 0 || line >= doc.getLineCount()) { - return null; - } - int offset = doc.getLineStartOffset(line); - if(br instanceof FieldBreakpoint) { - PsiField field = ((FieldBreakpoint) br).getPsiField(); - if(field != null) { - offset = field.getTextOffset(); - } - } - VirtualFile vFile = FileDocumentManager.getInstance().getFile(doc); - if (vFile == null || !vFile.isValid()) { - return null; - } - return new OpenFileDescriptor(project, vFile, offset); - } - - public void ensureSelectionExists() { - if (myTable.getRowCount() > 0 && myTable.getSelectedRow() < 0) { - ListSelectionModel model = myTable.getSelectionModel(); - model.clearSelection(); - model.addSelectionInterval(0, 0); - } - - final List treeBreakpoints = myTree.getBreakpoints(); - if (treeBreakpoints.size() > 0) { - if (myTree.getSelectionModel().getSelectionCount() == 0) { - myTree.selectFirstBreakpoint(); - } - } - - SwingUtilities.invokeLater(new Runnable() { - public void run() { - if (isTreeShowing()) { - myTree.requestFocus(); - } - else { - myTable.requestFocus(); - } - } - }); - } - -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/ExceptionBreakpointFactory.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/ExceptionBreakpointFactory.java index 465a96828347..40b75c4ffc71 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/ExceptionBreakpointFactory.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/ExceptionBreakpointFactory.java @@ -59,12 +59,6 @@ public class ExceptionBreakpointFactory extends BreakpointFactory { return DebuggerBundle.message("exception.breakpoints.tab.title"); } - @Override - protected void configureBreakpointPanel(BreakpointPanel panel) { - super.configureBreakpointPanel(panel); - panel.getTree().setGroupByMethods(false); - } - @Override public BreakpointPropertiesPanel createBreakpointPropertiesPanel(Project project, boolean compact) { return new ExceptionBreakpointPropertiesPanel(project, compact); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpointFactory.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpointFactory.java index 18d30f74b2d1..1bdef0c862e7 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpointFactory.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpointFactory.java @@ -48,11 +48,6 @@ public class FieldBreakpointFactory extends BreakpointFactory{ return AllIcons.Debugger.Db_disabled_field_breakpoint; } - @Override - protected void configureBreakpointPanel(BreakpointPanel panel) { - panel.getTree().setGroupByMethods(false); - } - @Override protected String getHelpID() { return HelpID.FIELD_WATCHPOINTS; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointFactory.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointFactory.java index 2574e224efbd..a08e2a123ae6 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointFactory.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointFactory.java @@ -60,12 +60,6 @@ public class MethodBreakpointFactory extends BreakpointFactory{ return new MethodBreakpointPropertiesPanel(project, compact); } - @Override - protected void configureBreakpointPanel(BreakpointPanel panel) { - super.configureBreakpointPanel(panel); - panel.getTree().setGroupByMethods(false); - } - @Override public Key getBreakpointCategory() { return MethodBreakpoint.CATEGORY; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/AddAction.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/AddAction.java deleted file mode 100644 index 8e3b37e9bff3..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/AddAction.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints.actions; - -import com.intellij.debugger.ui.breakpoints.Breakpoint; -import com.intellij.debugger.ui.breakpoints.BreakpointFactory; -import com.intellij.debugger.ui.breakpoints.BreakpointPanel; -import com.intellij.ide.IdeBundle; -import com.intellij.openapi.project.Project; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; - -/** - * @author Eugene Zhuravlev - * Date: May 25, 2005 - */ -public class AddAction extends BreakpointPanelAction { - protected final Project myProject; - protected BreakpointFactory myBreakpointFactory; - - public AddAction(BreakpointFactory breakpointFactory, Project project) { - super(IdeBundle.message("button.add")); - myProject = project; - this.myBreakpointFactory = breakpointFactory; - } - - public void setPanel(BreakpointPanel panel) { - super.setPanel(panel); - getPanel().getTable().registerKeyboardAction(this, KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - } - - public void update() { - } - - public void actionPerformed(ActionEvent e) { - Breakpoint breakpoint = myBreakpointFactory.addBreakpoint(myProject); - if (breakpoint != null) { - getPanel().addBreakpoint(breakpoint); - } - } -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/BreakpointPanelAction.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/BreakpointPanelAction.java deleted file mode 100644 index 32e7f5cc8718..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/BreakpointPanelAction.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints.actions; - -import com.intellij.debugger.ui.breakpoints.BreakpointPanel; - -import javax.swing.*; -import java.awt.event.ActionListener; - -/** - * @author Eugene Zhuravlev - * Date: May 25, 2005 - */ -public abstract class BreakpointPanelAction implements ActionListener { - private final String myName; - private AbstractButton myButton; - private BreakpointPanel myPanel; - - protected BreakpointPanelAction(String name) { - myName = name; - } - - public final String getName() { - return myName; - } - - public boolean isStateAction() { - return false; - } - - public void setPanel(BreakpointPanel panel) { - myPanel = panel; - } - - public final BreakpointPanel getPanel() { - return myPanel; - } - - public void setButton(AbstractButton button) { - myButton = button; - } - - public final AbstractButton getButton() { - return myButton; - } - - public abstract void update(); -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/GotoSourceAction.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/GotoSourceAction.java deleted file mode 100644 index aedbfb475281..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/GotoSourceAction.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints.actions; - -import com.intellij.debugger.ui.breakpoints.BreakpointPanel; -import com.intellij.ide.IdeBundle; -import com.intellij.openapi.actionSystem.*; -import com.intellij.openapi.fileEditor.FileEditorManager; -import com.intellij.openapi.fileEditor.OpenFileDescriptor; -import com.intellij.openapi.project.Project; - -import java.awt.event.ActionEvent; - -/** - * @author Eugene Zhuravlev - * Date: May 25, 2005 - */ -public class GotoSourceAction extends BreakpointPanelAction { - private final Project myProject; - - protected GotoSourceAction(final Project project) { - super(IdeBundle.message("button.go.to")); - myProject = project; - } - - public void actionPerformed(ActionEvent e) { - gotoSource(); - } - - private void gotoSource() { - OpenFileDescriptor editSourceDescriptor = getPanel().createEditSourceDescriptor(myProject); - if (editSourceDescriptor != null) { - FileEditorManager.getInstance(myProject).openTextEditor(editSourceDescriptor, true); - } - } - - public void setPanel(BreakpointPanel panel) { - super.setPanel(panel); - ShortcutSet shortcutSet = ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE).getShortcutSet(); - new AnAction() { - public void actionPerformed(AnActionEvent e){ - gotoSource(); - } - }.registerCustomShortcutSet(shortcutSet, getPanel().getPanel()); - } - - public void update() { - getButton().setEnabled(getPanel().getCurrentViewableBreakpoint() != null); - } -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/RemoveAction.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/RemoveAction.java deleted file mode 100644 index 72a86b746e3b..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/RemoveAction.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints.actions; - -import com.intellij.debugger.DebuggerBundle; -import com.intellij.debugger.DebuggerManagerEx; -import com.intellij.debugger.ui.breakpoints.AnyExceptionBreakpoint; -import com.intellij.debugger.ui.breakpoints.Breakpoint; -import com.intellij.debugger.ui.breakpoints.BreakpointManager; -import com.intellij.debugger.ui.breakpoints.BreakpointPanel; -import com.intellij.openapi.project.Project; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; - -/** - * @author Eugene Zhuravlev - * Date: May 25, 2005 - */ -public class RemoveAction extends BreakpointPanelAction { - private final Project myProject; - - public RemoveAction(final Project project) { - super(DebuggerBundle.message("button.remove")); - myProject = project; - } - - - public void setPanel(BreakpointPanel panel) { - super.setPanel(panel); - getPanel().getTable().registerKeyboardAction( - this, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT - ); - getPanel().getTree().registerKeyboardAction( - this, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT - ); - } - - public void actionPerformed(ActionEvent e) { - Breakpoint[] breakpoints = getPanel().getSelectedBreakpoints(); - if (breakpoints != null) { - for (Breakpoint breakpoint1 : breakpoints) { - if (breakpoint1 instanceof AnyExceptionBreakpoint) { - return; - } - } - getPanel().removeSelectedBreakpoints(); - BreakpointManager manager = DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager(); - for (final Breakpoint breakpoint : breakpoints) { - getPanel().getTree().removeBreakpoint(breakpoint); - manager.removeBreakpoint(breakpoint); - } - } - } - - public void update() { - getButton().setEnabled(getPanel().getSelectedBreakpoints().length > 0); - } -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/SwitchViewAction.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/SwitchViewAction.java deleted file mode 100644 index 8a44fbba2fc9..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/SwitchViewAction.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints.actions; - -import com.intellij.debugger.DebuggerBundle; -import com.intellij.debugger.ui.breakpoints.BreakpointPanel; - -import javax.swing.*; -import java.awt.event.ActionEvent; - -/** - * @author Eugene Zhuravlev - * Date: May 25, 2005 - */ -public class SwitchViewAction extends BreakpointPanelAction { - public SwitchViewAction() { - super(DebuggerBundle.message("button.switch.view")); - } - - - public void actionPerformed(ActionEvent e) { - getPanel().switchViews(); - } - - - public void update() { - final AbstractButton button = getButton(); - final BreakpointPanel panel = getPanel(); - button.setText(panel.isTreeShowing()? DebuggerBundle.message("button.list.view") : DebuggerBundle.message("button.tree.view")); - button.setEnabled(panel.getBreakpointCount() > 0); - } -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleFlattenPackagesAction.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleFlattenPackagesAction.java deleted file mode 100644 index d6681f4aa32a..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleFlattenPackagesAction.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints.actions; - -import com.intellij.debugger.ui.breakpoints.BreakpointPanel; -import com.intellij.debugger.DebuggerBundle; - -import javax.swing.*; -import java.awt.event.ActionEvent; - -/** - * @author Eugene Zhuravlev - * Date: May 25, 2005 - */ -public class ToggleFlattenPackagesAction extends BreakpointPanelAction { - public ToggleFlattenPackagesAction() { - super(DebuggerBundle.message("button.flatten.packages")); - } - - public boolean isStateAction() { - return true; - } - - public void setButton(AbstractButton button) { - super.setButton(button); - getButton().setSelected(getPanel().getTree().isFlattenPackages()); - } - - public void actionPerformed(ActionEvent e) { - getPanel().getTree().setFlattenPackages(getButton().isSelected()); - } - - public void update() { - final AbstractButton button = getButton(); - final BreakpointPanel panel = getPanel(); - button.setEnabled(panel.getBreakpointCount() > 0 && panel.isTreeShowing()); - button.setSelected(panel.getTree().isFlattenPackages()); - } -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleGroupByClassesAction.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleGroupByClassesAction.java deleted file mode 100644 index 7dec6f3ff7a5..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleGroupByClassesAction.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints.actions; - -import com.intellij.debugger.ui.breakpoints.BreakpointPanel; -import com.intellij.debugger.DebuggerBundle; - -import javax.swing.*; -import java.awt.event.ActionEvent; - -/** - * @author Eugene Zhuravlev - * Date: May 25, 2005 - */ -public class ToggleGroupByClassesAction extends BreakpointPanelAction { - public ToggleGroupByClassesAction() { - super(DebuggerBundle.message("button.group.by.classes")); - } - - public boolean isStateAction() { - return true; - } - - public void setButton(AbstractButton button) { - super.setButton(button); - getButton().setSelected(getPanel().getTree().isGroupByClasses()); - } - - public void actionPerformed(ActionEvent e) { - getPanel().getTree().setGroupByClasses(getButton().isSelected()); - } - - public void update() { - final AbstractButton button = getButton(); - final BreakpointPanel panel = getPanel(); - button.setEnabled(panel.getBreakpointCount() > 0 && panel.isTreeShowing()); - button.setSelected(panel.getTree().isGroupByClasses()); - } -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleGroupByMethodsAction.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleGroupByMethodsAction.java deleted file mode 100644 index 57fcabe9462f..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ToggleGroupByMethodsAction.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints.actions; - -import com.intellij.debugger.ui.breakpoints.BreakpointPanel; -import com.intellij.debugger.DebuggerBundle; - -import javax.swing.*; -import java.awt.event.ActionEvent; - -/** - * @author Eugene Zhuravlev - * Date: May 25, 2005 - */ -public class ToggleGroupByMethodsAction extends BreakpointPanelAction { - public ToggleGroupByMethodsAction() { - super(DebuggerBundle.message("button.group.by.methods")); - } - - public boolean isStateAction() { - return true; - } - - public void setButton(AbstractButton button) { - super.setButton(button); - getButton().setSelected(getPanel().getTree().isGroupByMethods()); - } - - public void actionPerformed(ActionEvent e) { - getPanel().getTree().setGroupByMethods(getButton().isSelected()); - } - - public void update() { - final AbstractButton button = getButton(); - final BreakpointPanel panel = getPanel(); - button.setEnabled(panel.getBreakpointCount() > 0 && panel.isTreeShowing()); - button.setSelected(panel.getTree().isGroupByMethods()); - } -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ViewSourceAction.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ViewSourceAction.java deleted file mode 100644 index 0744ef917d56..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/actions/ViewSourceAction.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.debugger.ui.breakpoints.actions; - -import com.intellij.ide.IdeBundle; -import com.intellij.openapi.fileEditor.FileEditorManager; -import com.intellij.openapi.fileEditor.OpenFileDescriptor; -import com.intellij.openapi.project.Project; - -import java.awt.event.ActionEvent; - -/** - * @author Eugene Zhuravlev - * Date: May 25, 2005 - */ -public class ViewSourceAction extends BreakpointPanelAction { - private final Project myProject; - - public ViewSourceAction(final Project project) { - super(IdeBundle.message("button.view.source")); - myProject = project; - } - - - public void actionPerformed(ActionEvent e) { - OpenFileDescriptor editSourceDescriptor = getPanel().createEditSourceDescriptor(myProject); - if (editSourceDescriptor != null) { - FileEditorManager.getInstance(myProject).openTextEditor(editSourceDescriptor, false); - } - } - - public void update() { - getButton().setEnabled(getPanel().getCurrentViewableBreakpoint() != null); - } -}