1 11 package org.eclipse.jdt.internal.ui.preferences; 12 13 import org.eclipse.core.resources.IProject; 14 15 import org.eclipse.swt.widgets.Composite; 16 import org.eclipse.swt.widgets.Control; 17 18 import org.eclipse.ui.PlatformUI; 19 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; 20 21 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 22 23 public final class CodeAssistAdvancedPreferencePage extends PropertyAndPreferencePage { 24 25 private CodeAssistAdvancedConfigurationBlock fConfigurationBlock; 26 27 public void createControl(Composite parent) { 28 IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer(); 29 fConfigurationBlock= new CodeAssistAdvancedConfigurationBlock(getNewStatusChangedListener(), container); 30 31 super.createControl(parent); 32 PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE); 33 } 34 35 protected Control createPreferenceContent(Composite composite) { 36 return fConfigurationBlock.createContents(composite); 37 } 38 39 protected boolean hasProjectSpecificOptions(IProject project) { 40 return false; 41 } 42 43 protected String getPreferencePageID() { 44 return "org.eclipse.jdt.ui.preferences.CodeAssistPreferenceAdvanced"; } 46 47 protected String getPropertyPageID() { 48 return null; 49 } 50 51 54 public void dispose() { 55 if (fConfigurationBlock != null) { 56 fConfigurationBlock.dispose(); 57 } 58 super.dispose(); 59 } 60 61 64 protected void performDefaults() { 65 super.performDefaults(); 66 if (fConfigurationBlock != null) { 67 fConfigurationBlock.performDefaults(); 68 } 69 } 70 71 74 public boolean performOk() { 75 if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) { 76 return false; 77 } 78 return super.performOk(); 79 } 80 81 84 public void performApply() { 85 if (fConfigurationBlock != null) { 86 fConfigurationBlock.performApply(); 87 } 88 } 89 } 90 | Popular Tags |