1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 10:15:39 +02:00

Bug 303808: Remove GdbConsoleInvertColorAction and use preferences

Change-Id: Ic99160ff208eb71457093003b4cf070a9dfda540
Signed-off-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
This commit is contained in:
Alvaro Sanchez-Leon 2016-09-14 17:58:00 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent d203d965a2
commit 5ab506c95e
7 changed files with 1 additions and 53 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 B

View file

@ -24,10 +24,7 @@ public class ConsoleMessages extends NLS {
public static String ConsoleMessages_save_confirm_overwrite_desc; public static String ConsoleMessages_save_confirm_overwrite_desc;
public static String ConsoleMessages_save_info_io_error_title; public static String ConsoleMessages_save_info_io_error_title;
public static String ConsoleMessages_save_info_io_error_desc; public static String ConsoleMessages_save_info_io_error_desc;
public static String ConsoleInvertColorsAction_name;
public static String ConsoleInvertColorsAction_description;
public static String ConsoleTerminateLaunchAction_name; public static String ConsoleTerminateLaunchAction_name;
public static String ConsoleTerminateLaunchAction_description; public static String ConsoleTerminateLaunchAction_description;

View file

@ -18,9 +18,6 @@ ConsoleMessages_save_confirm_overwrite_desc=File exists, do you want overwrite i
ConsoleMessages_save_info_io_error_title=Error ConsoleMessages_save_info_io_error_title=Error
ConsoleMessages_save_info_io_error_desc=Error during save console content. Task failed. ConsoleMessages_save_info_io_error_desc=Error during save console content. Task failed.
ConsoleInvertColorsAction_name=Invert Colors
ConsoleInvertColorsAction_description=Invert the colors for the gdb consoles
ConsoleTerminateLaunchAction_name=Termi&nate Launch ConsoleTerminateLaunchAction_name=Termi&nate Launch
ConsoleTerminateLaunchAction_description=Terminate the launch associated to this GDB console ConsoleTerminateLaunchAction_description=Terminate the launch associated to this GDB console

View file

@ -28,7 +28,6 @@ public class GdbBasicCliConsolePage extends IOConsolePage implements IDebugConte
private final IConsoleView fView; private final IConsoleView fView;
private final IDebuggerConsole fConsole; private final IDebuggerConsole fConsole;
private GdbConsoleInvertColorsAction fInvertColorsAction;
private GdbConsoleTerminateLaunchAction fTerminateLaunchAction; private GdbConsoleTerminateLaunchAction fTerminateLaunchAction;
private GdbConsoleShowPreferencesAction fShowPreferencePageAction; private GdbConsoleShowPreferencesAction fShowPreferencePageAction;
@ -58,7 +57,6 @@ public class GdbBasicCliConsolePage extends IOConsolePage implements IDebugConte
@Override @Override
protected void createActions() { protected void createActions() {
fInvertColorsAction = new GdbConsoleInvertColorsAction();
fTerminateLaunchAction = new GdbConsoleTerminateLaunchAction(fLaunch); fTerminateLaunchAction = new GdbConsoleTerminateLaunchAction(fLaunch);
fShowPreferencePageAction = new GdbConsoleShowPreferencesAction(getSite().getShell()); fShowPreferencePageAction = new GdbConsoleShowPreferencesAction(getSite().getShell());
} }
@ -66,7 +64,6 @@ public class GdbBasicCliConsolePage extends IOConsolePage implements IDebugConte
@Override @Override
protected void contextMenuAboutToShow(IMenuManager menuManager) { protected void contextMenuAboutToShow(IMenuManager menuManager) {
menuManager.add(fTerminateLaunchAction); menuManager.add(fTerminateLaunchAction);
menuManager.add(fInvertColorsAction);
menuManager.add(new Separator()); menuManager.add(new Separator());
menuManager.add(fShowPreferencePageAction); menuManager.add(fShowPreferencePageAction);
} }

View file

@ -1,39 +0,0 @@
/*******************************************************************************
* Copyright (c) 2016 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal.ui.console;
import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants;
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.action.Action;
import org.osgi.service.prefs.BackingStoreException;
/**
* Action to toggle the inverted colors setting of all the GDB consoles
*/
public class GdbConsoleInvertColorsAction extends Action {
public GdbConsoleInvertColorsAction() {
setText(ConsoleMessages.ConsoleInvertColorsAction_name);
setToolTipText(ConsoleMessages.ConsoleInvertColorsAction_description);
setImageDescriptor(GdbUIPlugin.getImageDescriptor(IConsoleImagesConst.IMG_CONSOLE_INVERT_COLORS));
}
@Override
public void run() {
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GdbPlugin.PLUGIN_ID);
boolean enabled = preferences.getBoolean(IGdbDebugPreferenceConstants.PREF_CONSOLE_INVERTED_COLORS, false);
preferences.putBoolean(IGdbDebugPreferenceConstants.PREF_CONSOLE_INVERTED_COLORS, !enabled);
try {
preferences.flush();
} catch (BackingStoreException e) {
}
}
}

View file

@ -52,7 +52,6 @@ public class GdbFullCliConsolePage extends Page implements IDebugContextListener
private MenuManager fMenuManager; private MenuManager fMenuManager;
private GdbConsoleInvertColorsAction fInvertColorsAction;
private GdbConsoleTerminateLaunchAction fTerminateLaunchAction; private GdbConsoleTerminateLaunchAction fTerminateLaunchAction;
/** The control for the terminal widget embedded in the console */ /** The control for the terminal widget embedded in the console */
@ -182,7 +181,6 @@ public class GdbFullCliConsolePage extends Page implements IDebugContextListener
} }
protected void createActions() { protected void createActions() {
fInvertColorsAction = new GdbConsoleInvertColorsAction();
fTerminateLaunchAction = new GdbConsoleTerminateLaunchAction(fLaunch); fTerminateLaunchAction = new GdbConsoleTerminateLaunchAction(fLaunch);
fClearAction = new GdbConsoleClearAction(fTerminalControl); fClearAction = new GdbConsoleClearAction(fTerminalControl);
fCopyAction = new GdbConsoleCopyAction(fTerminalControl); fCopyAction = new GdbConsoleCopyAction(fTerminalControl);
@ -212,7 +210,6 @@ public class GdbFullCliConsolePage extends Page implements IDebugContextListener
menuManager.add(new Separator()); menuManager.add(new Separator());
menuManager.add(fTerminateLaunchAction); menuManager.add(fTerminateLaunchAction);
menuManager.add(fInvertColorsAction);
menuManager.add(fAutoTerminateAction); menuManager.add(fAutoTerminateAction);
menuManager.add(new Separator()); menuManager.add(new Separator());

View file

@ -15,7 +15,6 @@ package org.eclipse.cdt.dsf.gdb.internal.ui.console;
*/ */
public interface IConsoleImagesConst { public interface IConsoleImagesConst {
public static final String IMG_SAVE_CONSOLE = "icons/full/obj16/save_console.gif"; //$NON-NLS-1$ public static final String IMG_SAVE_CONSOLE = "icons/full/obj16/save_console.gif"; //$NON-NLS-1$
public static final String IMG_CONSOLE_INVERT_COLORS = "icons/full/obj16/console_invert_colors.gif"; //$NON-NLS-1$
public static final String IMG_CONSOLE_TERMINATE_ACTIVE_COLOR = "icons/full/elcl16/stop.gif"; //$NON-NLS-1$ public static final String IMG_CONSOLE_TERMINATE_ACTIVE_COLOR = "icons/full/elcl16/stop.gif"; //$NON-NLS-1$
public static final String IMG_CONSOLE_TERMINATE_DISABLED_COLOR = "icons/full/dlcl16/stop.gif"; //$NON-NLS-1$ public static final String IMG_CONSOLE_TERMINATE_DISABLED_COLOR = "icons/full/dlcl16/stop.gif"; //$NON-NLS-1$