1 11 package org.eclipse.debug.internal.ui.actions; 12 13 14 import org.eclipse.debug.core.DebugEvent; 15 import org.eclipse.debug.core.DebugException; 16 import org.eclipse.debug.core.model.IDebugTarget; 17 import org.eclipse.debug.core.model.IDisconnect; 18 19 public class DisconnectActionDelegate extends AbstractListenerActionDelegate { 20 21 24 protected void doAction(Object element) throws DebugException { 25 if (element instanceof IDisconnect) { 26 ((IDisconnect) element).disconnect(); 27 } 28 } 29 30 33 protected boolean isRunInBackground() { 34 return true; 35 } 36 37 40 protected boolean isEnabledFor(Object element) { 41 return element instanceof IDisconnect && ((IDisconnect) element).canDisconnect(); 42 } 43 44 47 protected String getStatusMessage() { 48 return ActionMessages.DisconnectActionDelegate_Exceptions_occurred_attempting_to_disconnect__2; } 50 51 54 protected String getErrorDialogMessage() { 55 return ActionMessages.DisconnectActionDelegate_Disconnect_failed_1; } 57 58 61 protected void doHandleDebugEvent(DebugEvent event) { 62 if (event.getKind() == DebugEvent.TERMINATE && event.getSource() instanceof IDebugTarget) { 63 update(getAction(), getSelection()); 64 } 65 } 66 } 67 | Popular Tags |