Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/ActionMessages.java33
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/ActionMessages.properties13
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/SetAutoSolibActionDelegate.java271
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/VerboseModeActionDelegate.java56
4 files changed, 0 insertions, 373 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/ActionMessages.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/ActionMessages.java
deleted file mode 100644
index 88b4e5ba22b..00000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/ActionMessages.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 QNX Software Systems 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.mi.internal.ui.actions;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ActionMessages {
-
- private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.mi.internal.ui.actions.ActionMessages";//$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
-
- private ActionMessages() {
- }
-
- public static String getString( String key ) {
- try {
- return RESOURCE_BUNDLE.getString( key );
- }
- catch( MissingResourceException e ) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/ActionMessages.properties b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/ActionMessages.properties
deleted file mode 100644
index 5dd0f84d4fe..00000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/ActionMessages.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2006 QNX Software Systems 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:
-# QNX Software Systems - initial API and implementation
-###############################################################################
-
-SetAutoSolibActionDelegate.0=Exceptions occurred attempting to set 'Automatically Load Symbols' mode.
-SetAutoSolibActionDelegate.1=Set 'Automatically Load Symbols' mode failed.
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/SetAutoSolibActionDelegate.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/SetAutoSolibActionDelegate.java
deleted file mode 100644
index edb3e38cbdd..00000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/SetAutoSolibActionDelegate.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2015 QNX Software Systems 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.mi.internal.ui.actions;
-
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDISession;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
-import org.eclipse.cdt.debug.mi.core.MIPlugin;
-import org.eclipse.cdt.debug.mi.core.cdi.Session;
-import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager;
-import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * The delegate for the "Automatically Load Symbols" action.
- */
-public class SetAutoSolibActionDelegate implements IViewActionDelegate, ISelectionListener, IPartListener {
-
- private IViewPart fView = null;
-
- private IAction fAction;
-
- private IStatus fStatus = null;
-
- /**
- * Constructor for SetAutoSolibActionDelegate.
- */
- public SetAutoSolibActionDelegate() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart)
- */
- @Override
- public void init( IViewPart view ) {
- fView = view;
- view.getSite().getPage().addPartListener( this );
- view.getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
- */
- @Override
- public void selectionChanged( IWorkbenchPart part, ISelection selection ) {
- if ( part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) ) {
- update( getAction() );
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(IAction)
- */
- @Override
- public void run( IAction action ) {
- BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
-
- @Override
- public void run() {
- try {
- doAction( DebugUITools.getDebugContext() );
- setStatus( null );
- }
- catch( DebugException e ) {
- setStatus( e.getStatus() );
- }
- }
- } );
- if ( getStatus() != null && !getStatus().isOK() ) {
- IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
- if ( window != null ) {
- CDebugUIPlugin.errorDialog( getErrorDialogMessage(), getStatus() );
- }
- else {
- CDebugUIPlugin.log( getStatus() );
- }
- }
- update( action );
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
- */
- @Override
- public void selectionChanged( IAction action, ISelection selection ) {
- setAction( action );
- if ( getView() != null ) {
- update( action );
- }
- }
-
- protected void update( IAction action ) {
- if ( action != null ) {
- IAdaptable element = DebugUITools.getDebugContext();
- action.setEnabled( getEnableStateForSelection( element ) );
- action.setChecked( getCheckStateForSelection( element ) );
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart)
- */
- @Override
- public void partActivated( IWorkbenchPart part ) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- @Override
- public void partBroughtToTop( IWorkbenchPart part ) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart)
- */
- @Override
- public void partClosed( IWorkbenchPart part ) {
- if ( part.equals( getView() ) ) {
- dispose();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart)
- */
- @Override
- public void partDeactivated( IWorkbenchPart part ) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart)
- */
- @Override
- public void partOpened( IWorkbenchPart part ) {
- }
-
- protected IViewPart getView() {
- return fView;
- }
-
- protected void setView( IViewPart viewPart ) {
- fView = viewPart;
- }
-
- protected void setAction( IAction action ) {
- fAction = action;
- }
-
- protected IAction getAction() {
- return fAction;
- }
-
- protected void dispose() {
- if ( getView() != null ) {
- getView().getViewSite().getPage().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
- getView().getViewSite().getPage().removePartListener( this );
- }
- }
-
- protected boolean getCheckStateForSelection( IAdaptable element ) {
- SharedLibraryManager slm = getSharedLibraryManager( element );
- Target target = getTarget(element);
- if ( slm != null && target != null) {
- try {
- return slm.isAutoLoadSymbols(target);
- } catch( CDIException e ) {
- }
- }
- return false;
- }
-
- protected boolean getEnableStateForSelection( IAdaptable element ) {
- return (element instanceof IDebugElement && ((IDebugElement)element).getDebugTarget().isSuspended() && getSharedLibraryManager( element ) != null);
- }
-
- protected String getStatusMessage() {
- return ActionMessages.getString( "SetAutoSolibActionDelegate.0" ); //$NON-NLS-1$
- }
-
- protected String getErrorDialogMessage() {
- return ActionMessages.getString( "SetAutoSolibActionDelegate.1" ); //$NON-NLS-1$
- }
-
- protected void setStatus( IStatus status ) {
- fStatus = status;
- }
-
- protected IStatus getStatus() {
- return fStatus;
- }
-
- protected void doAction( IAdaptable element ) throws DebugException {
- if ( getView() == null )
- return;
- SharedLibraryManager slm = getSharedLibraryManager( element );
- Target target = getTarget(element);
- if ( slm != null && target != null && getAction() != null ) {
- try {
- slm.setAutoLoadSymbols( target, getAction().isChecked() );
- }
- catch( CDIException e ) {
- getAction().setChecked( !getAction().isChecked() );
- throw new DebugException( new Status( IStatus.ERROR, MIPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, e.getMessage(), null ) );
- }
- }
- }
-
- private SharedLibraryManager getSharedLibraryManager( IAdaptable element ) {
- if ( element != null ) {
- ICDISession session = element.getAdapter( ICDISession.class );
- if ( session instanceof Session )
- return ((Session)session).getSharedLibraryManager();
- }
- return null;
- }
-
- private Target getTarget( IAdaptable element ) {
- if (element != null) {
- ICDITarget target = element.getAdapter( ICDITarget.class );
- if (target instanceof Target) {
- return (Target)target;
- }
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/VerboseModeActionDelegate.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/VerboseModeActionDelegate.java
deleted file mode 100644
index c625d6157e8..00000000000
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/VerboseModeActionDelegate.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2012 QNX Software Systems 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.mi.internal.ui.actions;
-
-import org.eclipse.cdt.debug.mi.core.GDBProcess;
-import org.eclipse.cdt.debug.mi.ui.console.VerboseModeChangedEvent;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-public class VerboseModeActionDelegate extends ActionDelegate implements IObjectActionDelegate {
-
- private GDBProcess fProcess;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- @Override
- public void setActivePart( IAction action, IWorkbenchPart targetPart ) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- @Override
- public void run( IAction action ) {
- if ( fProcess != null ) {
- boolean enabled = fProcess.getTarget().isVerboseModeEnabled();
- fProcess.getTarget().enableVerboseMode( !enabled );
- fProcess.getTarget().getMISession().notifyObservers(new VerboseModeChangedEvent(fProcess.getTarget().getMISession(),0));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public void selectionChanged( IAction action, ISelection selection ) {
- IStructuredSelection s = (IStructuredSelection)selection;
- fProcess = ( !s.isEmpty() ) ? (GDBProcess)s.getFirstElement() : null;
- action.setEnabled( fProcess != null && !fProcess.isTerminated());
- action.setChecked( fProcess != null && fProcess.getTarget().isVerboseModeEnabled() );
- }
-
-}

Back to the top