KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > NoLineNumberAttributesStatusHandler


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui;
12
13
14 import com.ibm.icu.text.MessageFormat;
15
16 import org.eclipse.core.runtime.IStatus;
17 import org.eclipse.debug.core.IStatusHandler;
18 import org.eclipse.jface.preference.IPreferenceStore;
19 import org.eclipse.swt.widgets.Display;
20
21 import com.sun.jdi.ReferenceType;
22
23 public class NoLineNumberAttributesStatusHandler implements IStatusHandler {
24
25     /**
26      * @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object)
27      */

28     public Object JavaDoc handleStatus(IStatus status, Object JavaDoc source) {
29         ReferenceType type= (ReferenceType) source;
30         IPreferenceStore preferenceStore= JDIDebugUIPlugin.getDefault().getPreferenceStore();
31         if (preferenceStore.getBoolean(IJDIPreferencesConstants.PREF_ALERT_UNABLE_TO_INSTALL_BREAKPOINT)) {
32             final ErrorDialogWithToggle dialog= new ErrorDialogWithToggle(JDIDebugUIPlugin.getActiveWorkbenchShell(),
33                     DebugUIMessages.NoLineNumberAttributesStatusHandler_Java_Breakpoint_1,
34                     MessageFormat.format(DebugUIMessages.NoLineNumberAttributesStatusHandler_2, new String JavaDoc[] {type.name()}),
35                     status, IJDIPreferencesConstants.PREF_ALERT_UNABLE_TO_INSTALL_BREAKPOINT,
36                     DebugUIMessages.NoLineNumberAttributesStatusHandler_3,
37                     preferenceStore);
38             Display display= JDIDebugUIPlugin.getStandardDisplay();
39             display.syncExec(new Runnable JavaDoc() {
40                 public void run() {
41                     dialog.open();
42                 }
43             });
44         }
45         return null;
46     }
47
48 }
49
Popular Tags