Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/MiConsolePageParticipant.java130
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/VerboseModeChangedEvent.java30
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/IMiConsoleImagesConst.java18
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleMessages.java30
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleMessages.properties14
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleSaveAction.java82
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleVerboseModeAction.java52
7 files changed, 0 insertions, 356 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/MiConsolePageParticipant.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/MiConsolePageParticipant.java
deleted file mode 100644
index 98a30180bb..0000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/MiConsolePageParticipant.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 STMicroelectronics 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
- *
- * Contributors:
- * STMicroelectronics - Process console enhancements
- * Alena Laskavaia (QNX) - Fix for 186172
- *******************************************************************************/
-package org.eclipse.cdt.debug.mi.ui.console;
-
-import java.util.Observable;
-import java.util.Observer;
-
-import org.eclipse.cdt.debug.mi.core.GDBProcess;
-import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
-import org.eclipse.cdt.debug.mi.ui.console.actions.MiConsoleSaveAction;
-import org.eclipse.cdt.debug.mi.ui.console.actions.MiConsoleVerboseModeAction;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsolePageParticipant;
-import org.eclipse.ui.part.IPageBookViewPage;
-import org.eclipse.ui.console.IConsole;
-
-/**
- * Enhances ProcessConsole when the process attached is a GDBProcess
- * @since 6.1
- *
- */
-public class MiConsolePageParticipant implements IConsolePageParticipant, IDebugEventSetListener, Observer {
-
- private MiConsoleSaveAction fSaveConsole = null;
- private MiConsoleVerboseModeAction fVerboseMode = null;
- private org.eclipse.debug.ui.console.IConsole fConsole = null;
- private org.eclipse.cdt.debug.mi.core.GDBProcess GDBProcess = null;
-
- @Override
- public void activated() {
- }
-
- @Override
- public void deactivated() {
- }
-
- @Override
- public void dispose() {
- if (GDBProcess != null) {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
- fSaveConsole = null;
- fVerboseMode = null;
- GDBProcess = null;
- fConsole = null;
- }
-
- @Override
- public void init(IPageBookViewPage page, IConsole console) {
-
- if(console instanceof org.eclipse.debug.ui.console.IConsole)
- {
- fConsole = (org.eclipse.debug.ui.console.IConsole) console;
- if(fConsole.getProcess() instanceof GDBProcess) {
-
- GDBProcess = (GDBProcess) fConsole.getProcess();
-
- // add two new actions: save console content and verbose console mode switcher
- IActionBars bars = page.getSite().getActionBars();
- bars.getToolBarManager().appendToGroup(IConsoleConstants.OUTPUT_GROUP, new Separator());
- fSaveConsole = new MiConsoleSaveAction(fConsole);
- bars.getToolBarManager().appendToGroup(IConsoleConstants.OUTPUT_GROUP, fSaveConsole);
- fVerboseMode = new MiConsoleVerboseModeAction(fConsole);
- bars.getToolBarManager().appendToGroup(IConsoleConstants.OUTPUT_GROUP, fVerboseMode);
- bars.getToolBarManager().appendToGroup(IConsoleConstants.OUTPUT_GROUP, new Separator());
-
- // add a debug event listener
- DebugPlugin.getDefault().addDebugEventListener(this);
- // if we miss change event update enablement manually
- fVerboseMode.updateStateAndEnablement();
- Target target = GDBProcess.getTarget();
- if (target != null) {
- // register this object as MISession observer
- target.getMISession().addObserver(this);
- }
- }
- }
- }
-
- @Override
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- @Override
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getSource().equals(GDBProcess)) {
- if (fVerboseMode != null) {
- fVerboseMode.updateStateAndEnablement();
- Target target = GDBProcess.getTarget();
- if (target != null) {
- // register this object as MISession observer
- target.getMISession().addObserver(this);
- }
- }
- }
- }
- }
-
- /**
- * Handle MISession notification
- */
- @Override
- public void update(Observable arg0, Object arg1) {
- if((arg1!=null) && (arg1 instanceof VerboseModeChangedEvent) && (fVerboseMode != null)) {
- try {
- fVerboseMode.updateStateAndEnablement();
- } catch (Exception e) {
- }
- }
- }
-
-}
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/VerboseModeChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/VerboseModeChangedEvent.java
deleted file mode 100644
index 3db6cb4c84..0000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/VerboseModeChangedEvent.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 STMicroelectronics.
- * 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
- *
- * Contributors:
- * STMicroelectronics - Process console enhancements
- *******************************************************************************/
-package org.eclipse.cdt.debug.mi.ui.console;
-
-import org.eclipse.cdt.debug.mi.core.MISession;
-import org.eclipse.cdt.debug.mi.core.event.MIEvent;
-
-/**
- * MISession event, verbose console mode changed
- * @since 6.1
- *
- */
-public class VerboseModeChangedEvent extends MIEvent {
-
- private static final long serialVersionUID = 1L;
-
- public VerboseModeChangedEvent(MISession session, int token) {
- super(session, token);
- setPropagate(false);
- }
-
-}
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/IMiConsoleImagesConst.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/IMiConsoleImagesConst.java
deleted file mode 100644
index 5459ce6312..0000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/IMiConsoleImagesConst.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2014 STMicroelectronics.
- * 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
- *
- * Contributors:
- * STMicroelectronics - Process console enhancements
- *******************************************************************************/
-package org.eclipse.cdt.debug.mi.ui.console.actions;
-
-/** @since 6.2 */
-public interface IMiConsoleImagesConst {
-
- public static final String IMG_SAVE_CONSOLE = "icons/obj16/save_console.gif"; //$NON-NLS-1$
- public static final String IMG_VERBOSE_CONSOLE = "icons/obj16/verbose_mode_co.gif"; //$NON-NLS-1$
-}
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleMessages.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleMessages.java
deleted file mode 100644
index 37f1157cd4..0000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleMessages.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2014 STMicroelectronics.
- * 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
- *
- * Contributors:
- * STMicroelectronics - Process console enhancements
- *******************************************************************************/
-package org.eclipse.cdt.debug.mi.ui.console.actions;
-
-import org.eclipse.osgi.util.NLS;
-
-/** @since 6.2 */
-public class MiConsoleMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.mi.ui.console.actions.MiConsoleMessages"; //$NON-NLS-1$
-
- public static String saveActionTooltip;
- public static String verboseActionTooltip;
-
- public static String confirmOverWrite;
- public static String infoIOError;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, MiConsoleMessages.class);
- }
-
-}
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleMessages.properties b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleMessages.properties
deleted file mode 100644
index 4ac2493106..0000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleMessages.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2006 STMicroelectronics
-# 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
-#
-# Contributors:
-# STMicroelectronics - initial API and implementation
-###############################################################################
-saveActionTooltip=Save console content
-verboseActionTooltip=Verbose console mode
-confirmOverWrite=File exists, do you want overwrite it?
-infoIOError=Error during save console content. Task failed.
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleSaveAction.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleSaveAction.java
deleted file mode 100644
index 1a226d9516..0000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleSaveAction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2014 STMicroelectronics.
- * 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
- *
- * Contributors:
- * STMicroelectronics - Process console enhancements
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.mi.ui.console.actions;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
-import org.eclipse.debug.ui.console.IConsole;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-
-/**
- * Save console content
- * @since 6.2
- */
-public class MiConsoleSaveAction extends Action{
-
- private IConsole fConsole;
- private String fileName;
-
- public MiConsoleSaveAction(IConsole console) {
- super();
- setToolTipText(MiConsoleMessages.saveActionTooltip);
- setImageDescriptor(MIUIPlugin.imageDescriptorFromPlugin(MIUIPlugin.PLUGIN_ID,IMiConsoleImagesConst.IMG_SAVE_CONSOLE));
- fConsole = console;
- }
-
- @Override
- public void run() {
-
- FileDialog fileDialog = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE);
- fileName = fileDialog.open();
- if(fileName==null) {
- return;
- }
-
- Runnable saveJob = new Runnable() {
- @Override
- public void run() {
- saveContent();
- }
- };
- BusyIndicator.showWhile(Display.getCurrent(), saveJob);
-
- }
-
- protected void saveContent() {
- boolean confirmed = true;
-
- try {
- File f = new File(fileName);
- if(f.exists()) {
- confirmed = MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), "Confirm overwrite", MiConsoleMessages.confirmOverWrite);
- }
- if(confirmed) {
- BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
- out.write(fConsole.getDocument().get());
- out.close();
- }
- } catch (IOException e) {
- MessageDialog.openError(Display.getCurrent().getActiveShell(),"Error",MiConsoleMessages.infoIOError);
- }
-
- }
-
-}
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleVerboseModeAction.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleVerboseModeAction.java
deleted file mode 100644
index 43861f18aa..0000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/ui/console/actions/MiConsoleVerboseModeAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2014 STMicroelectronics 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
- *
- * Contributors:
- * STMicroelectronics - Process console enhancements
- * Alena Laskavaia (QNX) - Fix for 186172
- *******************************************************************************/
-package org.eclipse.cdt.debug.mi.ui.console.actions;
-
-import org.eclipse.cdt.debug.mi.core.GDBProcess;
-import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
-import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
-import org.eclipse.debug.ui.console.IConsole;
-import org.eclipse.jface.action.Action;
-
-/**
- * Verbose console mode switcher
- * @since 6.2
- */
-public class MiConsoleVerboseModeAction extends Action {
- private IConsole fConsole;
-
- public MiConsoleVerboseModeAction(IConsole console) {
- super();
- setToolTipText(MiConsoleMessages.verboseActionTooltip);
- setImageDescriptor(MIUIPlugin.imageDescriptorFromPlugin(MIUIPlugin.PLUGIN_ID, IMiConsoleImagesConst.IMG_VERBOSE_CONSOLE));
- fConsole = console;
- }
-
- public void updateStateAndEnablement() {
- // initialize button
- GDBProcess gdbProcess = (GDBProcess) fConsole.getProcess();
- setEnabled(!gdbProcess.isTerminated());
- Target target = gdbProcess.getTarget();
- if (target != null) {
- setChecked(target.isVerboseModeEnabled());
- } else {
- setChecked(false);
- }
- }
-
- @Override
- public void run() {
- GDBProcess fProcess = (GDBProcess) fConsole.getProcess();
- fProcess.getTarget().enableVerboseMode(isChecked());
- }
-
-}

Back to the top