1 11 12 package org.eclipse.jdt.internal.ui.preferences; 13 14 import org.eclipse.core.resources.IProject; 15 16 import org.eclipse.swt.widgets.Composite; 17 import org.eclipse.swt.widgets.Control; 18 19 import org.eclipse.ui.IWorkbenchPreferencePage; 20 import org.eclipse.ui.PlatformUI; 21 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; 22 23 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 24 25 26 34 public class CodeAssistPreferencePage extends PropertyAndPreferencePage implements IWorkbenchPreferencePage { 35 36 private CodeAssistConfigurationBlock fConfigurationBlock; 37 38 public void createControl(Composite parent) { 39 IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer(); 40 fConfigurationBlock= new CodeAssistConfigurationBlock(getNewStatusChangedListener(), container); 41 42 super.createControl(parent); 43 PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE); 44 } 45 46 protected Control createPreferenceContent(Composite composite) { 47 return fConfigurationBlock.createContents(composite); 48 } 49 50 protected boolean hasProjectSpecificOptions(IProject project) { 51 return false; 52 } 53 54 protected String getPreferencePageID() { 55 return "org.eclipse.jdt.ui.preferences.CodeAssistPreferencePage"; } 57 58 protected String getPropertyPageID() { 59 return null; 60 } 61 62 65 public void dispose() { 66 if (fConfigurationBlock != null) { 67 fConfigurationBlock.dispose(); 68 } 69 super.dispose(); 70 } 71 72 75 protected void performDefaults() { 76 super.performDefaults(); 77 if (fConfigurationBlock != null) { 78 fConfigurationBlock.performDefaults(); 79 } 80 } 81 82 85 public boolean performOk() { 86 if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) { 87 return false; 88 } 89 return super.performOk(); 90 } 91 92 95 public void performApply() { 96 if (fConfigurationBlock != null) { 97 fConfigurationBlock.performApply(); 98 } 99 } 100 101 } 102 | Popular Tags |