Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 135958 Details for
Bug 276466
[call hierarchy] Improve UI for View Menu Preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Initial Fix
patch3_274087UI.txt.txt (text/plain), 45.04 KB, created by
Raksha Vasisht
on 2009-05-15 06:14:21 EDT
(
hide
)
Description:
Initial Fix
Filename:
MIME Type:
Creator:
Raksha Vasisht
Created:
2009-05-15 06:14:21 EDT
Size:
45.04 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.java,v >retrieving revision 1.13 >diff -u -r1.13 CallHierarchyMessages.java >--- ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.java 30 Apr 2009 14:02:28 -0000 1.13 >+++ ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.java 15 May 2009 08:37:00 -0000 >@@ -73,6 +73,7 @@ > public static String CallHierarchyLabelProvider_noMethodSelected; > public static String CallHierarchyLabelProvider_updatePending; > public static String CallHierarchyLabelProvider_matches; >+ public static String CallHierarchyPreferencePage_expand_with_constructors_title; > public static String CallHierarchyViewPart_empty; > public static String CallHierarchyViewPart_callsToConstructors; > public static String CallHierarchyViewPart_callsToField; >@@ -140,4 +141,5 @@ > > public static String CallHierarchyViewPart_layout_menu; > public static String CallHierarchyViewPart_field_menu; >+ public static String CallHierarchyViewPart_preferences_label; > } >Index: ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.properties,v >retrieving revision 1.44 >diff -u -r1.44 CallHierarchyMessages.properties >--- ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.properties 30 Apr 2009 14:02:28 -0000 1.44 >+++ ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.properties 15 May 2009 08:37:01 -0000 >@@ -70,6 +70,7 @@ > CallHierarchyLabelProvider_noMethodSelected=- no method selected - > CallHierarchyLabelProvider_updatePending=... > CallHierarchyLabelProvider_matches={0} ({1} matches) >+CallHierarchyPreferencePage_expand_with_constructors_title=Expand With Constructors > CallHierarchyViewPart_empty=To display the call hierarchy, select one or more methods, classes, fields, or initializers, and select the \'Open Call Hierarchy\' menu option. Alternatively, you can drag and drop the member or members onto this view. > CallHierarchyViewPart_callsToConstructors=Members calling constructors of ''{0}'' - in {1} > CallHierarchyViewPart_callsToField=Members accessing ''{0}'' - in {1} >@@ -85,6 +86,7 @@ > CallHierarchyViewPart_callsFromMembers_3=Calls from ''{0}'', ''{1}'', ''{2}'' - in {3} > CallHierarchyViewPart_callsFromMembers_more=Calls from ''{0}'', ''{1}'', ''{2}'', ... - in {3} > CallHierarchyViewPart_callsFromMethod=Calls from ''{0}'' - in {1} >+CallHierarchyViewPart_preferences_label= Preferences... > FocusOnSelectionAction_focusOnSelection_text=Fo&cus On Selection > FocusOnSelectionAction_focusOnSelection_description=Focus On Selection > FocusOnSelectionAction_focusOnSelection_tooltip=Focus On Selection >Index: ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyContentProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyContentProvider.java,v >retrieving revision 1.32 >diff -u -r1.32 CallHierarchyContentProvider.java >--- ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyContentProvider.java 14 May 2009 20:05:18 -0000 1.32 >+++ ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyContentProvider.java 15 May 2009 08:37:00 -0000 >@@ -53,18 +53,7 @@ > * > * @since 3.5 > */ >- public static final String PREF_DEFAULT_EXPAND_WITH_CONSTRUCTORS= "CallHierarchy.defaultExpandWithConstructors"; //$NON-NLS-1$ >- >- /** >- * A named preference that controls whether methods from anonymous types are by default expanded >- * with constructors in the Call Hierarchy. >- * <p> >- * Value is of type <code>Boolean</code>. >- * </p> >- * >- * @since 3.5 >- */ >- public static final String PREF_ANONYMOUS_EXPAND_WITH_CONSTRUCTORS= "CallHierarchy.anonymousExpandWithConstructors"; //$NON-NLS-1$ >+ public static final String CALL_HIERARCHY_PREFERENCES= "CallHierarchy.defaultExpandWithConstructors"; //$NON-NLS-1$ > > private final static Object[] EMPTY_ARRAY= new Object[0]; > >@@ -174,19 +163,10 @@ > static void ensureDefaultExpandWithConstructors(CallerMethodWrapper wrapper) { > > if (!wrapper.isExpandWithConstructorsSet()) { >- if (CallHierarchyContentProvider.canExpandWithConstructors(wrapper)) { >+ if (canExpandWithConstructors(wrapper)) { > IType type= wrapper.getMember().getDeclaringType(); > try { >- boolean withConstructors= false; >- if (type != null) { >- boolean anonymousPref= PreferenceConstants.getPreferenceStore().getBoolean(PREF_ANONYMOUS_EXPAND_WITH_CONSTRUCTORS); >- if (anonymousPref && type.isAnonymous()) { >- withConstructors= true; >- } else if (isInTheDefaultExpandWithConstructorList(type)) { >- withConstructors= true; >- } >- } >- wrapper.setExpandWithConstructors(withConstructors); >+ wrapper.setExpandWithConstructors(type != null && (type.isAnonymous() || isInTheDefaultExpandWithConstructorList(wrapper))); > } catch (JavaModelException e) { > // ignore: expand mode will be off > } >@@ -215,23 +195,25 @@ > } > return true; > } >- >+ > /** >- * Checks if declaring type matches the pre-defined array of types for default expand with >- * constructors. >+ * Checks if the member or its declaring type matches the pre-defined array of members and types >+ * for default expand with constructors. > * >- * @param type the declaring type of the caller method wrapper >- * @return <code>true</code> if type matches the pre-defined list, <code>false</code> otherwise >+ * @param wrapper caller method wrapper >+ * @return <code>true</code> if method or type matches the pre-defined list, <code>false</code> >+ * otherwise > * @since 3.5 > */ >- static boolean isInTheDefaultExpandWithConstructorList(IType type) { >- String serializedTypes= PreferenceConstants.getPreferenceStore().getString(PREF_DEFAULT_EXPAND_WITH_CONSTRUCTORS); >- if (serializedTypes.length() == 0) >+ static boolean isInTheDefaultExpandWithConstructorList(CallerMethodWrapper wrapper) { >+ String storedTypes= (PreferenceConstants.getPreferenceStore().getString(CALL_HIERARCHY_PREFERENCES)); >+ if (storedTypes.length() == 0) > return false; >+ String member= wrapper.getMember().getElementName(); >+ IType type= wrapper.getMember().getDeclaringType(); >+ String[] defaultTypes= storedTypes.split(";"); //$NON-NLS-1$ > >- String[] defaultTypes= serializedTypes.split(";"); //$NON-NLS-1$ >- >- String typeName= type.getFullyQualifiedName('.'); >+ String typeName= type.getFullyQualifiedName('.').concat(".*"); //$NON-NLS-1$ > String superClass; > String[] superInterfaces; > try { >@@ -242,12 +224,12 @@ > } > for (int i= 0; i < defaultTypes.length; i++) { > String defaultType= defaultTypes[i]; >- if (typeName.equals(defaultType) || (superClass != null && typeNameMatches(superClass, defaultType))) { >+ if (typeNameMatches(member, defaultType) || typeName.equals(defaultType) || (superClass != null && typeNameMatches(superClass.concat(".*"), defaultType))) { //$NON-NLS-1$ > return true; > } > if (superInterfaces.length > 0) { > for (int j= 0; j < superInterfaces.length; j++) { >- if (typeNameMatches(superInterfaces[j], defaultType)) >+ if (typeNameMatches(superInterfaces[j].concat(".*"), defaultType)) //$NON-NLS-1$ > return true; > } > } >Index: ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyViewPart.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyViewPart.java,v >retrieving revision 1.74 >diff -u -r1.74 CallHierarchyViewPart.java >--- ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyViewPart.java 26 Apr 2009 21:39:35 -0000 1.74 >+++ ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyViewPart.java 15 May 2009 08:37:02 -0000 >@@ -235,6 +235,7 @@ > private boolean fShowCallDetails; > protected Composite fParent; > private IPartListener2 fPartListener; >+ private PreferencesActionGroup fPreferences; > > > public CallHierarchyViewPart() { >@@ -1000,6 +1001,7 @@ > fSearchScopeActions = new SearchScopeActionGroup(this, fDialogSettings); > fFiltersActionGroup = new CallHierarchyFiltersActionGroup(this, > fCallHierarchyViewer); >+ fPreferences= new PreferencesActionGroup(this); > fHistoryDropDownAction = new HistoryDropDownAction(this); > fHistoryDropDownAction.setEnabled(false); > fCancelSearchAction = new CancelSearchAction(this); >@@ -1027,7 +1029,7 @@ > new GenerateActionGroup(this), > new RefactorActionGroup(this), > new JavaSearchActionGroup(this), >- fSearchScopeActions, fFiltersActionGroup >+ fSearchScopeActions, fFiltersActionGroup, fPreferences > }); > } > >Index: ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties,v >retrieving revision 1.486 >diff -u -r1.486 PreferencesMessages.properties >--- ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties 2 Apr 2009 09:30:29 -0000 1.486 >+++ ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties 15 May 2009 08:37:05 -0000 >@@ -1,5 +1,5 @@ > ############################################################################### >-# Copyright (c) 2000, 2008 IBM Corporation and others. >+# Copyright (c) 2000, 2009 IBM Corporation and others. > # All rights reserved. This program and the accompanying materials > # are made available under the terms of the Eclipse Public License v1.0 > # which accompanies this distribution, and is available at >@@ -923,6 +923,25 @@ > CodeAssistStaticMembersConfigurationBlock_edit_button= &Edit > CodeAssistStaticMembersConfigurationBlock_remove_button= &Remove > >+CallHierarchyPreferencesConfigurationBlock_description= De&fine a list of members or types with their fully qualified names.Call Hierarchy for these types/members will "Expand With Constructors" by default. >+CallHierarchyPreferencesConfigurationBlock_newType_button= New &Type... >+CallHierarchyPreferencesConfigurationBlock_newMember_button= New &Member... >+CallHierarchyPreferencesConfigurationBlock_edit_button= &Edit >+CallHierarchyPreferencesConfigurationBlock_remove_button= &Remove >+ >+CallHierarchyPreferencesDialog_member_title= New Member for Expand With Constructors >+CallHierarchyPreferencesDialog_member_labelText= Enter a fully qualified static member (e.g. \'java.lang.Math.sqrt\'): >+CallHierarchyPreferencesDialog_type_title= New Type for Expand With Constructors >+CallHierarchyPreferencesDialog_type_labelText= Enter a fully qualified type (e.g. \'java.lang.Math\'): >+CallHierarchyPreferencesDialog_browse_button= &Browse... >+CallHierarchyPreferencesDialog_ChooseTypeDialog_title= Type Selection >+CallHierarchyPreferencesDialog_ChooseTypeDialog_description= Choose type name: >+CallHierarchyPreferencesDialog_ChooseTypeDialog_error_message= A problem occurred while collecting types. See the error Log for details. >+CallHierarchyPreferencesDialog_error_enterName=Enter a name or prefix. >+CallHierarchyPreferencesDialog_error_invalidTypeName=Not a valid type name. >+CallHierarchyPreferencesDialog_error_invalidMemberName=Not a valid member name. >+CallHierarchyPreferencesDialog_error_entryExists=Entry already exists in list. >+ > FavoriteStaticMemberInputDialog_member_title= New Member Favorite > FavoriteStaticMemberInputDialog_member_labelText= Enter a fully qualified static member (e.g. \'java.lang.Math.sqrt\'): > FavoriteStaticMemberInputDialog_type_title= New Type Favorite >Index: ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java,v >retrieving revision 1.117 >diff -u -r1.117 PreferencesMessages.java >--- ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java 2 Apr 2009 09:30:30 -0000 1.117 >+++ ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java 15 May 2009 08:37:03 -0000 >@@ -807,6 +807,12 @@ > public static String CodeAssistStaticMembersConfigurationBlock_newMember_button; > public static String CodeAssistStaticMembersConfigurationBlock_edit_button; > public static String CodeAssistStaticMembersConfigurationBlock_remove_button; >+ >+ public static String CallHierarchyPreferencesConfigurationBlock_description; >+ public static String CallHierarchyPreferencesConfigurationBlock_newType_button; >+ public static String CallHierarchyPreferencesConfigurationBlock_newMember_button; >+ public static String CallHierarchyPreferencesConfigurationBlock_edit_button; >+ public static String CallHierarchyPreferencesConfigurationBlock_remove_button; > > public static String FavoriteStaticMemberInputDialog_member_title; > public static String FavoriteStaticMemberInputDialog_member_labelText; >@@ -820,5 +826,19 @@ > public static String FavoriteStaticMemberInputDialog_error_invalidMemberName; > public static String FavoriteStaticMemberInputDialog_error_invalidTypeName; > public static String FavoriteStaticMemberInputDialog_error_entryExists; >+ >+ public static String CallHierarchyPreferencesDialog_member_title; >+ public static String CallHierarchyPreferencesDialog_member_labelText; >+ public static String CallHierarchyPreferencesDialog_type_title; >+ public static String CallHierarchyPreferencesDialog_type_labelText; >+ public static String CallHierarchyPreferencesDialog_browse_button; >+ public static String CallHierarchyPreferencesDialog_ChooseTypeDialog_title; >+ public static String CallHierarchyPreferencesDialog_ChooseTypeDialog_description; >+ public static String CallHierarchyPreferencesDialog_ChooseTypeDialog_error_message; >+ public static String CallHierarchyPreferencesDialog_error_enterName; >+ public static String CallHierarchyPreferencesDialog_error_invalidMemberName; >+ public static String CallHierarchyPreferencesDialog_error_invalidTypeName; >+ public static String CallHierarchyPreferencesDialog_error_entryExists; >+ > > } >Index: ui/org/eclipse/jdt/ui/PreferenceConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/PreferenceConstants.java,v >retrieving revision 1.245 >diff -u -r1.245 PreferenceConstants.java >--- ui/org/eclipse/jdt/ui/PreferenceConstants.java 23 Mar 2009 17:25:02 -0000 1.245 >+++ ui/org/eclipse/jdt/ui/PreferenceConstants.java 15 May 2009 08:37:08 -0000 >@@ -43,6 +43,7 @@ > > import org.eclipse.jdt.internal.ui.JavaPlugin; > import org.eclipse.jdt.internal.ui.JavaUIPreferenceInitializer; >+import org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyContentProvider; > import org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightings; > import org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage; > import org.eclipse.jdt.internal.ui.preferences.formatter.FormatterProfileManager; >@@ -2976,6 +2977,13 @@ > */ > public final static String CODEASSIST_FAVORITE_STATIC_MEMBERS= "content_assist_favorite_static_members"; //$NON-NLS-1$ > >+ /** >+ * A named preference that holds the types/members which expand with constructors by default. >+ * >+ * @since 3.5 >+ */ >+ public static final String CALL_HIERARCHY_PREFERENCES= "call_hierarchy_preferences_page"; //$NON-NLS-1$ >+ > > /** > * A named preference that controls the behavior of the refactoring wizard for showing the error page. >@@ -3832,6 +3841,7 @@ > > store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_COMMENT_BOLD, false); > store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_COMMENT_ITALIC, false); >+ store.setDefault(CallHierarchyContentProvider.CALL_HIERARCHY_PREFERENCES, "java.lang.Runnable;java.util.concurrent.Callable;org.eclipse.swt.widgets.Listener"); //$NON-NLS-1$ > > // semantic highlighting > SemanticHighlightings.initDefaults(store); >Index: ui/org/eclipse/jdt/internal/ui/callhierarchy/PreferencesActionGroup.java >=================================================================== >RCS file: ui/org/eclipse/jdt/internal/ui/callhierarchy/PreferencesActionGroup.java >diff -N ui/org/eclipse/jdt/internal/ui/callhierarchy/PreferencesActionGroup.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/jdt/internal/ui/callhierarchy/PreferencesActionGroup.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,82 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ *******************************************************************************/ >+ >+package org.eclipse.jdt.internal.ui.callhierarchy; >+ >+import org.eclipse.jface.action.Action; >+import org.eclipse.jface.action.IMenuManager; >+import org.eclipse.jface.action.Separator; >+import org.eclipse.jface.preference.IPreferenceNode; >+import org.eclipse.jface.preference.PreferenceDialog; >+import org.eclipse.jface.preference.PreferenceManager; >+import org.eclipse.jface.preference.PreferenceNode; >+ >+import org.eclipse.ui.IActionBars; >+import org.eclipse.ui.actions.ActionGroup; >+ >+/** >+ * Call Hierarchy preferences action group. >+ * >+ * @since 3.5 >+ * >+ */ >+public class PreferencesActionGroup extends ActionGroup { >+ private CallHierarchyViewPart fPart; >+ >+ public PreferencesActionGroup(CallHierarchyViewPart part) { >+ fPart= part; >+ } >+ >+ /** >+ * Call hierarchy preferences action class. >+ * >+ * @since 3.5 >+ * >+ */ >+ public class CallHierarchyPreferencesAction extends Action { >+ >+ /** >+ * Creates the call hierarchy preference action. >+ */ >+ public CallHierarchyPreferencesAction() { >+ setText(CallHierarchyMessages.CallHierarchyViewPart_preferences_label); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.action.Action#run() >+ */ >+ public void run() { >+ CallHierarchyPreferencePage page= new CallHierarchyPreferencePage(); >+ IPreferenceNode targetNode= new PreferenceNode("org.eclipse.jdt.ui.preferences.CallHierarchyPreferencePage", page); //$NON-NLS-1$ >+ PreferenceManager manager= new PreferenceManager(); >+ manager.addToRoot(targetNode); >+ PreferenceDialog dialog= new PreferenceDialog(fPart.getSite().getShell(), manager); >+ dialog.create(); >+ dialog.open(); >+ } >+ } >+ >+ >+ /* (non-Javadoc) >+ * Method declared on ActionGroup. >+ */ >+ public void fillActionBars(IActionBars actionBars) { >+ fillViewMenu(actionBars.getMenuManager()); >+ } >+ >+ /* (non-Javadoc) >+ * Method declared on ActionGroup. >+ */ >+ private void fillViewMenu(IMenuManager viewMenu) { >+ viewMenu.add(new Separator("preferences")); //$NON-NLS-1$ >+ viewMenu.add(new CallHierarchyPreferencesAction()); >+ } >+ >+ >+} >Index: ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyPreferencesConfigurationBlock.java >=================================================================== >RCS file: ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyPreferencesConfigurationBlock.java >diff -N ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyPreferencesConfigurationBlock.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyPreferencesConfigurationBlock.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,597 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ *******************************************************************************/ >+ >+package org.eclipse.jdt.internal.ui.callhierarchy; >+ >+import java.util.ArrayList; >+import java.util.Arrays; >+import java.util.List; >+ >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.graphics.Image; >+import org.eclipse.swt.graphics.Point; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.swt.widgets.Text; >+ >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.core.runtime.IStatus; >+ >+import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.dialogs.StatusDialog; >+import org.eclipse.jface.layout.PixelConverter; >+import org.eclipse.jface.operation.IRunnableContext; >+import org.eclipse.jface.viewers.LabelProvider; >+import org.eclipse.jface.viewers.ViewerComparator; >+import org.eclipse.jface.window.Window; >+ >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.dialogs.SelectionDialog; >+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; >+ >+import org.eclipse.jdt.core.IType; >+import org.eclipse.jdt.core.JavaConventions; >+import org.eclipse.jdt.core.JavaCore; >+import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.core.search.IJavaSearchScope; >+import org.eclipse.jdt.core.search.SearchEngine; >+ >+import org.eclipse.jdt.ui.IJavaElementSearchConstants; >+import org.eclipse.jdt.ui.JavaUI; >+import org.eclipse.jdt.ui.PreferenceConstants; >+ >+import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; >+import org.eclipse.jdt.internal.ui.JavaPluginImages; >+import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; >+import org.eclipse.jdt.internal.ui.dialogs.TextFieldNavigationHandler; >+import org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock; >+import org.eclipse.jdt.internal.ui.preferences.PreferencesMessages; >+import org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent; >+import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; >+import org.eclipse.jdt.internal.ui.util.ExceptionHandler; >+import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; >+import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; >+import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; >+import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; >+import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; >+import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter; >+import org.eclipse.jdt.internal.ui.wizards.dialogfields.IStringButtonAdapter; >+import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; >+import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; >+import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField; >+ >+/** >+ * Call hierarchy preferences page configuration block. >+ * >+ * @since 3.5 * >+ */ >+public class CallHierarchyPreferencesConfigurationBlock extends OptionsConfigurationBlock { >+ >+ /** >+ * Call hierarchy preferences dialog for types and members. >+ */ >+ private static class CallHierarchyPreferencesDialog extends StatusDialog { >+ >+ private class StringButtonAdapter implements IDialogFieldListener, IStringButtonAdapter { >+ /* >+ * @see IDialogFieldListener#dialogFieldChanged(DialogField) >+ */ >+ public void dialogFieldChanged(DialogField field) { >+ doValidation(); >+ } >+ >+ /* >+ * @see IStringButtonAdapter#changeControlPressed(DialogField) >+ */ >+ public void changeControlPressed(DialogField field) { >+ doBrowseTypes(); >+ } >+ } >+ >+ private StringButtonDialogField fNameDialogField; >+ >+ private List fExistingEntries; >+ >+ private final boolean fIsEditingMember; >+ >+ /** >+ * Creates a call hierarchy preference dialog for members or types. >+ * >+ * @param parent the parent shell >+ * @param existingEntries the existing list of types and members >+ * @param isEditingMember <code>true</code if its a member, <code>false</code> otherwise >+ */ >+ public CallHierarchyPreferencesDialog(Shell parent, List existingEntries, boolean isEditingMember) { >+ super(parent); >+ fIsEditingMember= isEditingMember; >+ fExistingEntries= existingEntries; >+ >+ String label, title; >+ if (isEditingMember) { >+ title= PreferencesMessages.CallHierarchyPreferencesDialog_member_title; >+ label= PreferencesMessages.CallHierarchyPreferencesDialog_member_labelText; >+ } else { >+ title= PreferencesMessages.CallHierarchyPreferencesDialog_type_title; >+ label= PreferencesMessages.CallHierarchyPreferencesDialog_type_labelText; >+ } >+ setTitle(title); >+ >+ StringButtonAdapter adapter= new StringButtonAdapter(); >+ >+ fNameDialogField= new StringButtonDialogField(adapter); >+ fNameDialogField.setLabelText(label); >+ fNameDialogField.setButtonLabel(PreferencesMessages.CallHierarchyPreferencesDialog_browse_button); >+ fNameDialogField.setDialogFieldListener(adapter); >+ fNameDialogField.setText(""); //$NON-NLS-1$ >+ } >+ >+ /* >+ * @see org.eclipse.jface.dialogs.Dialog#isResizable() >+ * @since 3.4 >+ */ >+ protected boolean isResizable() { >+ return true; >+ } >+ >+ /** >+ * Sets the initial selection in the name dialog field. >+ * >+ * @param editedEntry the edited entry >+ */ >+ public void setInitialSelection(String editedEntry) { >+ Assert.isNotNull(editedEntry); >+ if (editedEntry.length() == 0) >+ fNameDialogField.setText(""); //$NON-NLS-1$ >+ else >+ fNameDialogField.setText(editedEntry); >+ } >+ >+ public String getResult() { >+ String val= fNameDialogField.getText(); >+ if (!fIsEditingMember) >+ val= val + WILDCARD; >+ return val; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) >+ */ >+ protected Control createDialogArea(Composite parent) { >+ Composite composite= (Composite)super.createDialogArea(parent); >+ initializeDialogUnits(parent); >+ >+ GridLayout layout= (GridLayout)composite.getLayout(); >+ layout.numColumns= 2; >+ >+ fNameDialogField.doFillIntoGrid(composite, 3); >+ >+ fNameDialogField.getChangeControl(null).setVisible(!fIsEditingMember); >+ >+ LayoutUtil.setHorizontalSpan(fNameDialogField.getLabelControl(null), 2); >+ >+ int fieldWidthHint= convertWidthInCharsToPixels(60); >+ Text text= fNameDialogField.getTextControl(null); >+ LayoutUtil.setWidthHint(text, fieldWidthHint); >+ LayoutUtil.setHorizontalGrabbing(text); >+ LayoutUtil.setHorizontalSpan(text, fIsEditingMember ? 2 : 1); >+ TextFieldNavigationHandler.install(text); >+ >+ DialogField.createEmptySpace(composite, 1); >+ >+ fNameDialogField.postSetFocusOnDialogField(parent.getDisplay()); >+ >+ >+ applyDialogFont(composite); >+ return composite; >+ } >+ >+ /** >+ * Creates the type hierarchy for type selection. >+ */ >+ private void doBrowseTypes() { >+ IRunnableContext context= new BusyIndicatorRunnableContext(); >+ IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); >+ int style= IJavaElementSearchConstants.CONSIDER_ALL_TYPES; >+ try { >+ SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), context, scope, style, false, fNameDialogField.getText()); >+ dialog.setTitle(PreferencesMessages.CallHierarchyPreferencesDialog_ChooseTypeDialog_title); >+ dialog.setMessage(PreferencesMessages.CallHierarchyPreferencesDialog_ChooseTypeDialog_description); >+ if (dialog.open() == Window.OK) { >+ IType res= (IType)dialog.getResult()[0]; >+ fNameDialogField.setText(res.getFullyQualifiedName('.')); >+ } >+ } catch (JavaModelException e) { >+ ExceptionHandler.handle(e, getShell(), PreferencesMessages.CallHierarchyPreferencesDialog_ChooseTypeDialog_title, >+ PreferencesMessages.CallHierarchyPreferencesDialog_ChooseTypeDialog_error_message); >+ } >+ } >+ >+ /** >+ * Validates the entered type or member adn updates the status. >+ */ >+ private void doValidation() { >+ StatusInfo status= new StatusInfo(); >+ String newText= fNameDialogField.getText(); >+ if (newText.length() == 0) { >+ status.setError(""); //$NON-NLS-1$ >+ } else { >+ IStatus val= JavaConventions.validateJavaTypeName(newText, JavaCore.VERSION_1_3, JavaCore.VERSION_1_3); >+ if (val.matches(IStatus.ERROR)) { >+ if (fIsEditingMember) >+ status.setError(PreferencesMessages.CallHierarchyPreferencesDialog_error_invalidMemberName); >+ else >+ status.setError(PreferencesMessages.CallHierarchyPreferencesDialog_error_invalidTypeName); >+ } else { >+ if (doesExist(newText)) { >+ status.setError(PreferencesMessages.CallHierarchyPreferencesDialog_error_entryExists); >+ } >+ } >+ } >+ updateStatus(status); >+ } >+ >+ /** >+ * Checks if the entry already exists. >+ * >+ * @param name the type or member name >+ * @return <code>true</code> if it already exists in the list of types and members, >+ * <code>false</code> otherwise >+ */ >+ private boolean doesExist(String name) { >+ for (int i= 0; i < fExistingEntries.size(); i++) { >+ String entry= (String)fExistingEntries.get(i); >+ if (name.equals(entry)) { >+ return true; >+ } >+ } >+ return false; >+ } >+ >+ >+ /* >+ * @see org.eclipse.jface.window.Window#configureShell(Shell) >+ */ >+ protected void configureShell(Shell newShell) { >+ super.configureShell(newShell); >+ PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE); >+ } >+ >+ } >+ >+ /** >+ * The list label provider class. >+ */ >+ private static class ListLabelProvider extends LabelProvider { >+ >+ public final Image MEMBER_ICON; >+ >+ private final Image CLASS_ICON; >+ >+ public ListLabelProvider() { >+ MEMBER_ICON= JavaElementImageProvider.getDecoratedImage(JavaPluginImages.DESC_MISC_PUBLIC, 0, JavaElementImageProvider.SMALL_SIZE); >+ CLASS_ICON= JavaElementImageProvider.getDecoratedImage(JavaPluginImages.DESC_OBJS_CLASS, 0, JavaElementImageProvider.SMALL_SIZE); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) >+ */ >+ public Image getImage(Object element) { >+ return ((String)element).endsWith(WILDCARD) ? CLASS_ICON : MEMBER_ICON; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object) >+ */ >+ public String getText(Object element) { >+ return BasicElementLabels.getJavaElementName((String)element); >+ } >+ } >+ >+ >+ /** >+ * The change listener for <code>ListDialogField</code>. >+ */ >+ private class ListAdapter implements IListAdapter, IDialogFieldListener { >+ >+ /** >+ * Checks if field can be edited. >+ * >+ * @param field the list dialog field >+ * @return <code>true</code> if it can be edited, <code>false</code> otherwise >+ */ >+ private boolean canEdit(ListDialogField field) { >+ List selected= field.getSelectedElements(); >+ return selected.size() == 1 && canRemove(field); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#customButtonPressed(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField, int) >+ */ >+ public void customButtonPressed(ListDialogField field, int index) { >+ doButtonPressed(index); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#selectionChanged(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField) >+ */ >+ public void selectionChanged(ListDialogField field) { >+ fList.enableButton(IDX_EDIT, canEdit(field)); >+ fList.enableButton(IDX_REMOVE, canRemove(field)); >+ } >+ >+ /** >+ * Checks if the field can be removed. >+ * >+ * @param field the list dialog field >+ * @return <code>true</code> if it can be removed, <code>false</code> otherwise >+ */ >+ private boolean canRemove(ListDialogField field) { >+ List selected= field.getSelectedElements(); >+ for (int j= 0; j < defaultTypes.length; j++) { >+ if (selected.contains(defaultTypes[j])) >+ return false; >+ } >+ return true; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener#dialogFieldChanged(org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField) >+ */ >+ public void dialogFieldChanged(DialogField field) { >+ doDialogFieldChanged(field); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#doubleClicked(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField) >+ */ >+ public void doubleClicked(ListDialogField field) { >+ if (canEdit(field)) { >+ doButtonPressed(IDX_EDIT); >+ } >+ } >+ } >+ >+ /** >+ * A named preference key that holds the types whose methods are by default expanded with >+ * constructors in the Call Hierarchy. >+ * >+ * @since 3.5 >+ */ >+ public static final Key CALL_HIERARCHY_PREFERENCES= getJDTUIKey(PreferenceConstants.CALL_HIERARCHY_PREFERENCES); >+ >+ private static final String WILDCARD= ".*"; //$NON-NLS-1$ >+ >+ private static final int IDX_NEW_TYPE= 0; >+ private static final int IDX_NEW_MEMBER= 1; >+ private static final int IDX_EDIT= 2; >+ private static final int IDX_REMOVE= 3; >+ >+ private ListDialogField fList; >+ >+ /** >+ * The array of types for default expand with constructors. >+ */ >+ String[] defaultTypes= { "java.lang.Runnable.*", "java.util.concurrent.Callable.*", "org.eclipse.swt.widgets.Listener.*" }; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ >+ >+ /** >+ * Returns all the key values. >+ * >+ * @return array of keys >+ */ >+ public static Key[] getAllKeys() { >+ return new Key[] { CALL_HIERARCHY_PREFERENCES }; >+ } >+ >+ >+ /** >+ * Creates the call hierarchy preferences configuration block. >+ * >+ * @param context the status >+ * @param container the preference container >+ */ >+ public CallHierarchyPreferencesConfigurationBlock(IStatusChangeListener context, IWorkbenchPreferenceContainer container) { >+ super(context, null, getAllKeys(), container); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#createContents(org.eclipse.swt.widgets.Composite) >+ */ >+ protected Control createContents(Composite parent) { >+ ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); >+ scrolled.setExpandHorizontal(true); >+ scrolled.setExpandVertical(true); >+ >+ Composite control= new Composite(scrolled, SWT.NONE); >+ GridLayout layout= new GridLayout(); >+ layout.numColumns= 2; >+ layout.marginWidth= 0; >+ layout.marginHeight= 0; >+ control.setLayout(layout); >+ >+ createFavoriteList(control); >+ >+ initialize(); >+ >+ scrolled.setContent(control); >+ final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT); >+ scrolled.setMinSize(size.x, size.y); >+ >+ Dialog.applyDialogFont(scrolled); >+ >+ return scrolled; >+ } >+ >+ /** >+ * Create a list dialog field. >+ * >+ * @param parent the composite >+ */ >+ private void createFavoriteList(Composite parent) { >+ String[] buttonLabels= new String[] { >+ PreferencesMessages.CallHierarchyPreferencesConfigurationBlock_newType_button, >+ PreferencesMessages.CallHierarchyPreferencesConfigurationBlock_newMember_button, >+ PreferencesMessages.CallHierarchyPreferencesConfigurationBlock_edit_button, >+ PreferencesMessages.CallHierarchyPreferencesConfigurationBlock_remove_button >+ }; >+ >+ ListAdapter adapter= new ListAdapter(); >+ >+ fList= new ListDialogField(adapter, buttonLabels, new ListLabelProvider()); >+ fList.setDialogFieldListener(adapter); >+ fList.setLabelText(PreferencesMessages.CallHierarchyPreferencesConfigurationBlock_description); >+ fList.setRemoveButtonIndex(IDX_REMOVE); >+ fList.enableButton(IDX_EDIT, false); >+ fList.setViewerComparator(new ViewerComparator()); >+ >+ PixelConverter pixelConverter= new PixelConverter(parent); >+ >+ fList.doFillIntoGrid(parent, 3); >+ LayoutUtil.setHorizontalSpan(fList.getLabelControl(null), 2); >+ LayoutUtil.setWidthHint(fList.getLabelControl(null), pixelConverter.convertWidthInCharsToPixels(60)); >+ LayoutUtil.setHorizontalGrabbing(fList.getListControl(null)); >+ >+ Control listControl= fList.getListControl(null); >+ GridData gd= (GridData)listControl.getLayoutData(); >+ gd.verticalAlignment= GridData.BEGINNING; >+ gd.heightHint= pixelConverter.convertHeightInCharsToPixels(7); >+ >+ } >+ >+ /** >+ * Initialize the elements of the list dialog field. >+ */ >+ public void initialize() { >+ initializeFields(); >+ } >+ >+ /** >+ * Initialize the elements of the list dialog field. >+ */ >+ private void initializeFields() { >+ List storedPreference= new ArrayList(); >+ storedPreference.addAll(Arrays.asList(getCallHierarchyPreferences())); >+ if (!storedPreference.contains(defaultTypes[0])) { >+ storedPreference.addAll(Arrays.asList(defaultTypes)); >+ } >+ fList.setElements(storedPreference); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#performDefaults() >+ */ >+ public void performDefaults() { >+ super.performDefaults(); >+ fList.setElements(Arrays.asList(defaultTypes)); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#getFullBuildDialogStrings(boolean) >+ */ >+ protected String[] getFullBuildDialogStrings(boolean workspaceSettings) { >+ return null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#validateSettings(org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock.Key, java.lang.String, java.lang.String) >+ */ >+ protected void validateSettings(Key changedKey, String oldValue, String newValue) { >+ >+ } >+ >+ /** >+ * Perform the 'New' and 'Edit' button operations by opening the respective call hierarchy >+ * preferences dialog. >+ * >+ * @param index the index of the button >+ */ >+ private void doButtonPressed(int index) { >+ if (index == IDX_NEW_TYPE || index == IDX_NEW_MEMBER) { // add new >+ List existing= fList.getElements(); >+ CallHierarchyPreferencesDialog dialog= new CallHierarchyPreferencesDialog(getShell(), existing, index == IDX_NEW_MEMBER); >+ if (dialog.open() == Window.OK) { >+ fList.addElement(dialog.getResult()); >+ } >+ } else if (index == IDX_EDIT) { // edit >+ List selected= fList.getSelectedElements(); >+ if (selected.isEmpty()) >+ return; >+ >+ String editedEntry= (String)selected.get(0); >+ >+ List existing= fList.getElements(); >+ existing.remove(editedEntry); >+ boolean isType= editedEntry.endsWith(WILDCARD); >+ CallHierarchyPreferencesDialog dialog= new CallHierarchyPreferencesDialog(getShell(), existing, !isType); >+ if (isType) >+ dialog.setInitialSelection(editedEntry.substring(0, editedEntry.length() - 2)); >+ else >+ dialog.setInitialSelection(editedEntry); >+ >+ if (dialog.open() == Window.OK) { >+ fList.replaceElement(editedEntry, dialog.getResult()); >+ } >+ } >+ } >+ >+ /** >+ * Update the preference keys and constants. >+ * >+ * @param field the dialog field >+ */ >+ protected final void doDialogFieldChanged(DialogField field) { >+ // set values in working copy >+ if (field == fList) { >+ setValue(CALL_HIERARCHY_PREFERENCES, serializeFavorites(fList.getElements())); >+ PreferenceConstants.getPreferenceStore().setValue(CallHierarchyContentProvider.CALL_HIERARCHY_PREFERENCES, serializeFavorites(fList.getElements())); >+ } >+ } >+ >+ /** >+ * Returns the call hierarchy preferences. >+ * >+ * @return the call hierarchy preferences >+ */ >+ private String[] getCallHierarchyPreferences() { >+ String str= getValue(CALL_HIERARCHY_PREFERENCES); >+ if (str != null && str.length() > 0) >+ return deserializeFavorites(str); >+ return new String[0]; >+ } >+ >+ /** >+ * Return the array of types and/or members after splitting the stored preference string. >+ * >+ * @param str the input string >+ * @return the array of types and/or members >+ */ >+ private static String[] deserializeFavorites(String str) { >+ return str.split(";"); //$NON-NLS-1$ >+ } >+ >+ /** >+ * Creates a single output string from the list of strings using a delimiter. >+ * >+ * @param str the input string >+ * @return the single output string from the list of strings using a delimiter >+ */ >+ private static String serializeFavorites(List str) { >+ int size= str.size(); >+ StringBuffer buf= new StringBuffer(); >+ for (int i= 0; i < size; i++) { >+ buf.append((String)str.get(i)); >+ if (i < size - 1) >+ buf.append(';'); >+ } >+ return buf.toString(); >+ } >+ >+} >Index: ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyPreferencePage.java >=================================================================== >RCS file: ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyPreferencePage.java >diff -N ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyPreferencePage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyPreferencePage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,119 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ *******************************************************************************/ >+ >+package org.eclipse.jdt.internal.ui.callhierarchy; >+ >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+ >+import org.eclipse.core.resources.IProject; >+ >+import org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage; >+ >+/** >+ * Call Hierarchy view menu preference page. >+ * >+ * @since 3.5 >+ * >+ */ >+public class CallHierarchyPreferencePage extends PropertyAndPreferencePage { >+ >+ private CallHierarchyPreferencesConfigurationBlock fConfigurationBlock; >+ >+ /** >+ * Creates a call hierarchy preference page and sets the title. >+ */ >+ public CallHierarchyPreferencePage() { >+ super(); >+ setTitle(CallHierarchyMessages.CallHierarchyPreferencePage_expand_with_constructors_title); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite) >+ */ >+ public void createControl(Composite parent) { >+ //IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer)getContainer(); >+ fConfigurationBlock= new CallHierarchyPreferencesConfigurationBlock(getNewStatusChangedListener(), null); >+ super.createControl(parent); >+ //PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#createPreferenceContent(org.eclipse.swt.widgets.Composite) >+ */ >+ protected Control createPreferenceContent(Composite composite) { >+ return fConfigurationBlock.createContents(composite); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPreferencePageID() >+ */ >+ protected String getPreferencePageID() { >+ return "org.eclipse.jdt.ui.preferences.CallHierarchyPreferencePage"; //$NON-NLS-1$ >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPropertyPageID() >+ */ >+ protected String getPropertyPageID() { >+ return null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#hasProjectSpecificOptions(org.eclipse.core.resources.IProject) >+ */ >+ protected boolean hasProjectSpecificOptions(IProject project) { >+ return false; >+ } >+ >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.dialogs.DialogPage#dispose() >+ */ >+ public void dispose() { >+ if (fConfigurationBlock != null) { >+ fConfigurationBlock.dispose(); >+ } >+ super.dispose(); >+ } >+ >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#performDefaults() >+ */ >+ protected void performDefaults() { >+ super.performDefaults(); >+ if (fConfigurationBlock != null) { >+ fConfigurationBlock.performDefaults(); >+ } >+ } >+ >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.preference.PreferencePage#performOk() >+ */ >+ public boolean performOk() { >+ if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) { >+ return false; >+ } >+ return super.performOk(); >+ } >+ >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.preference.PreferencePage#performApply() >+ */ >+ public void performApply() { >+ if (fConfigurationBlock != null) { >+ fConfigurationBlock.performApply(); >+ } >+ } >+ >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 276466
:
135958
|
144529
|
146514
|
147082
|
149404
|
151152
|
151933