| package org.eclipse.debug.internal.ui.preferences; |
| |
| /* |
| * (c) Copyright IBM Corp. 2002. |
| * All Rights Reserved. |
| */ |
| |
| import org.eclipse.debug.core.ILaunchConfiguration; |
| import org.eclipse.debug.core.ILaunchManager; |
| import org.eclipse.debug.internal.ui.DebugUIPlugin; |
| import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement; |
| |
| /** |
| * Debug favorites and history |
| */ |
| public class DebugHistoryPreferenceTab extends LaunchHistoryPreferenceTab { |
| |
| /** |
| * @see LaunchHistoryPreferenceTab#getFavoritesLabel() |
| */ |
| protected String getFavoritesLabel() { |
| return DebugPreferencesMessages.getString("DebugHistoryPreferenceTab.Favorite_Debug_Confi&gurations__1"); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see LaunchHistoryPreferenceTab#getRecentLabel() |
| */ |
| protected String getRecentLabel() { |
| return DebugPreferencesMessages.getString("DebugHistoryPreferenceTab.Recent_Debug_&Launches__2"); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see LaunchHistoryPreferenceTab#getInitialFavorites() |
| */ |
| protected ILaunchConfiguration[] getInitialFavorites() { |
| LaunchConfigurationHistoryElement[] favs = DebugUIPlugin.getLaunchConfigurationManager().getDebugFavorites(); |
| ILaunchConfiguration[] configs = new ILaunchConfiguration[favs.length]; |
| for (int i = 0; i < favs.length; i++) { |
| configs[i] = favs[i].getLaunchConfiguration(); |
| } |
| return configs; |
| } |
| |
| /** |
| * @see LaunchHistoryPreferenceTab#getIntialRecents() |
| */ |
| protected ILaunchConfiguration[] getInitialRecents() { |
| LaunchConfigurationHistoryElement[] favs = DebugUIPlugin.getLaunchConfigurationManager().getDebugHistory(); |
| ILaunchConfiguration[] configs = new ILaunchConfiguration[favs.length]; |
| for (int i = 0; i < favs.length; i++) { |
| configs[i] = favs[i].getLaunchConfiguration(); |
| if (configs[i] == null) { |
| // not using launch configs |
| return new ILaunchConfiguration[0]; |
| } |
| } |
| return configs; |
| } |
| |
| /** |
| * @see LaunchHistoryPreferenceTab#getMode() |
| */ |
| protected String getMode() { |
| return ILaunchManager.DEBUG_MODE; |
| } |
| } |