1 11 package org.eclipse.jdt.internal.debug.ui.propertypages; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.jdt.debug.core.IJavaBreakpoint; 15 import org.eclipse.jdt.debug.core.IJavaObject; 16 import org.eclipse.jdt.internal.debug.ui.IJavaDebugHelpContextIds; 17 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; 18 import org.eclipse.swt.SWT; 19 import org.eclipse.swt.layout.GridData; 20 import org.eclipse.swt.layout.GridLayout; 21 import org.eclipse.swt.widgets.Composite; 22 import org.eclipse.swt.widgets.Control; 23 import org.eclipse.ui.PlatformUI; 24 import org.eclipse.ui.dialogs.PropertyPage; 25 26 29 public class JavaBreakpointAdvancedPage extends PropertyPage { 30 31 ThreadFilterEditor fThreadFilterEditor; 32 InstanceFilterEditor fInstanceFilterEditor; 33 34 37 public boolean performOk() { 38 doStore(); 39 return super.performOk(); 40 } 41 42 45 protected void doStore() { 46 fThreadFilterEditor.doStore(); 47 if (fInstanceFilterEditor != null) { 48 fInstanceFilterEditor.doStore(); 49 } 50 } 51 52 55 protected Control createContents(Composite parent) { 56 noDefaultAndApplyButton(); 57 Composite mainComposite = new Composite(parent, SWT.NONE); 58 mainComposite.setFont(parent.getFont()); 59 mainComposite.setLayout(new GridLayout()); 60 mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); 61 createThreadFilterEditor(mainComposite); 62 createTypeSpecificEditors(mainComposite); 63 createInstanceFilterEditor(mainComposite); 64 setValid(true); 65 return mainComposite; 66 } 67 68 public void createInstanceFilterEditor(Composite parent) { 69 IJavaBreakpoint breakpoint= getBreakpoint(); 70 try { 71 IJavaObject[] instances = breakpoint.getInstanceFilters(); 72 if (instances.length > 0) { 73 fInstanceFilterEditor= new InstanceFilterEditor(parent, breakpoint); 74 } 75 } catch (CoreException e) { 76 JDIDebugUIPlugin.log(e); 77 } 78 } 79 80 84 protected void createTypeSpecificEditors(Composite parent) { 85 } 87 88 protected void createThreadFilterEditor(Composite parent) { 89 fThreadFilterEditor = new ThreadFilterEditor(parent, this); 90 } 91 92 public IJavaBreakpoint getBreakpoint() { 93 return (IJavaBreakpoint) getElement(); 94 } 95 96 99 public void createControl(Composite parent) { 100 super.createControl(parent); 101 PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.JAVA_BREAKPOINT_ADVANCED_PROPERTY_PAGE); 102 } 103 } 104 | Popular Tags |