|
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 |
/** |