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.IWorkbenchPreferencePage; 19 import org.eclipse.ui.PlatformUI; 20 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; 21 22 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 23 24 25 33 public class CodeAssistFavoritesPreferencePage extends PropertyAndPreferencePage implements IWorkbenchPreferencePage { 34 35 private CodeAssistFavoritesConfigurationBlock fConfigurationBlock; 36 37 public void createControl(Composite parent) { 38 IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer(); 39 fConfigurationBlock= new CodeAssistFavoritesConfigurationBlock(getNewStatusChangedListener(), container); 40 41 super.createControl(parent); 42 PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE); 43 } 44 45 protected Control createPreferenceContent(Composite composite) { 46 return fConfigurationBlock.createContents(composite); 47 } 48 49 protected boolean hasProjectSpecificOptions(IProject project) { 50 return false; 51 } 52 53 protected String getPreferencePageID() { 54 return "org.eclipse.jdt.ui.preferences.CodeAssistStaticMembersPreferencePage"; } 56 57 protected String getPropertyPageID() { 58 return null; 59 } 60 61 64 public void dispose() { 65 if (fConfigurationBlock != null) { 66 fConfigurationBlock.dispose(); 67 } 68 super.dispose(); 69 } 70 71 74 protected void performDefaults() { 75 super.performDefaults(); 76 if (fConfigurationBlock != null) { 77 fConfigurationBlock.performDefaults(); 78 } 79 } 80 81 84 public boolean performOk() { 85 if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) { 86 return false; 87 } 88 return super.performOk(); 89 } 90 91 94 public void performApply() { 95 if (fConfigurationBlock != null) { 96 fConfigurationBlock.performApply(); 97 } 98 } 99 100 } 101 | Popular Tags |