Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 172077
Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyDialog.java (-7 / +21 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Trevor Kaufman (endante@gmail.com) - bug 172077
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.ui.internal.dialogs;
12
package org.eclipse.ui.internal.dialogs;
12
13
Lines 65-78 Link Here
65
				.iterator();
66
				.iterator();
66
		String name = getName(element);
67
		String name = getName(element);
67
		if (!pages.hasNext()) {
68
		if (!pages.hasNext()) {
69
			String message;
70
			if (name == null) {
71
				message = WorkbenchMessages.PropertyDialog_noNameNoPropertyMessage;
72
			} else {
73
				message = NLS.bind(
74
						WorkbenchMessages.PropertyDialog_noPropertyMessage,
75
						name);
76
			}
77
			
68
			MessageDialog.openInformation(shell,
78
			MessageDialog.openInformation(shell,
69
					WorkbenchMessages.PropertyDialog_messageTitle, NLS.bind(
79
					WorkbenchMessages.PropertyDialog_messageTitle, message);
70
							WorkbenchMessages.PropertyDialog_noPropertyMessage,
71
							name));
72
			return null;
80
			return null;
73
		}
81
		}
74
		title = NLS
82
		
75
				.bind(WorkbenchMessages.PropertyDialog_propertyMessage, name);
83
		if (name == null) {
84
			title = WorkbenchMessages.PropertyDialog_noNamePropertyMessage;
85
		} else {
86
			title = NLS.bind(WorkbenchMessages.PropertyDialog_propertyMessage,
87
					name);
88
		}
89
		
76
		PropertyDialog propertyDialog = new PropertyDialog(shell, pageManager,
90
		PropertyDialog propertyDialog = new PropertyDialog(shell, pageManager,
77
				new StructuredSelection(element));
91
				new StructuredSelection(element));
78
92
Lines 95-108 Link Here
95
	 * 
109
	 * 
96
	 * @param element
110
	 * @param element
97
	 *            the element
111
	 *            the element
98
	 * @return the name of the element
112
	 * @return the name of the element or <code>null</code> if the name cannot be retrieved
99
	 */
113
	 */
100
	private static String getName(Object element) {
114
	private static String getName(Object element) {
101
		IWorkbenchAdapter adapter = (IWorkbenchAdapter)Util.getAdapter(element, IWorkbenchAdapter.class);
115
		IWorkbenchAdapter adapter = (IWorkbenchAdapter)Util.getAdapter(element, IWorkbenchAdapter.class);
102
		if (adapter != null) {
116
		if (adapter != null) {
103
			return adapter.getLabel(element);
117
			return adapter.getLabel(element);
104
		}
118
		}
105
		return "";//$NON-NLS-1$
119
		return null;
106
	}
120
	}
107
121
108
	/**
122
	/**
(-)Eclipse UI/org/eclipse/ui/internal/messages.properties (+3 lines)
Lines 11-16 Link Here
11
#        - Fix for Bug 57087
11
#        - Fix for Bug 57087
12
#        - Fix for Bug 138034 [Preferences] Label decorations page - extra space
12
#        - Fix for Bug 138034 [Preferences] Label decorations page - extra space
13
#        - Fix for Bug 128529
13
#        - Fix for Bug 128529
14
#     Trevor Kaufman (endante@gmail.com) - Fix for Bug 172077
14
###############################################################################
15
###############################################################################
15
16
16
# package: org.eclipse.ui
17
# package: org.eclipse.ui
Lines 478-484 Link Here
478
PropertyDialog_toolTip = Open Properties Dialog
479
PropertyDialog_toolTip = Open Properties Dialog
479
PropertyDialog_messageTitle = Property Pages
480
PropertyDialog_messageTitle = Property Pages
480
PropertyDialog_noPropertyMessage = No property pages for {0}.
481
PropertyDialog_noPropertyMessage = No property pages for {0}.
482
PropertyDialog_noNameNoPropertyMessage = No property pages.
481
PropertyDialog_propertyMessage = Properties for {0}
483
PropertyDialog_propertyMessage = Properties for {0}
484
PropertyDialog_noNamePropertyMessage = Properties
482
PropertyPageNode_errorTitle = Property Page Creation Problems
485
PropertyPageNode_errorTitle = Property Page Creation Problems
483
PropertyPageNode_errorMessage = Unable to create the selected property page.
486
PropertyPageNode_errorMessage = Unable to create the selected property page.
484
487
(-)Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java (+3 lines)
Lines 8-13 Link Here
8
 * Contributors:
8
 * Contributors:
9
 * IBM - Initial API and implementation
9
 * IBM - Initial API and implementation
10
 * Sebastian Davids - bug 128529
10
 * Sebastian Davids - bug 128529
11
 * Trevor Kaufman (endante@gmail.com) - bug 172077
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.eclipse.ui.internal;
13
package org.eclipse.ui.internal;
13
14
Lines 512-518 Link Here
512
	public static String PropertyDialog_toolTip;
513
	public static String PropertyDialog_toolTip;
513
	public static String PropertyDialog_messageTitle;
514
	public static String PropertyDialog_messageTitle;
514
	public static String PropertyDialog_noPropertyMessage;
515
	public static String PropertyDialog_noPropertyMessage;
516
	public static String PropertyDialog_noNameNoPropertyMessage;
515
	public static String PropertyDialog_propertyMessage;
517
	public static String PropertyDialog_propertyMessage;
518
	public static String PropertyDialog_noNamePropertyMessage;
516
	public static String PropertyPageNode_errorTitle;
519
	public static String PropertyPageNode_errorTitle;
517
	public static String PropertyPageNode_errorMessage;
520
	public static String PropertyPageNode_errorMessage;
518
521

Return to bug 172077