Line 29
Link Here
|
|
|
29 |
import javax.swing.Action; |
Line 37
Link Here
|
37 |
import org.openide.util.actions.*; |
|
|
Lines 226-235
Link Here
|
226 |
// Also specially handle SystemAction's. |
226 |
// Also specially handle action instances. |
227 |
if (SystemAction.class.isAssignableFrom (clazz)) { |
227 |
if (beanInfoIcon == null && Action.class.isAssignableFrom(clazz)) { |
228 |
SystemAction action = SystemAction.get (clazz); |
228 |
Action action = (Action)ic.instanceCreate(); |
229 |
if (beanInfoIcon == null) { |
229 |
Icon icon = (Icon)action.getValue(Action.SMALL_ICON); |
230 |
Icon icon = action.getIcon (); |
230 |
// [PENDING] not very pretty, but there is no good way to |
231 |
// [PENDING] not very pretty, but there is no good way to |
231 |
// get an Image from an Icon that I know of |
232 |
// get an Image from an Icon that I know of |
232 |
if (icon instanceof ImageIcon) { |
233 |
if (icon instanceof ImageIcon) { |
233 |
beanInfoIcon = ((ImageIcon)icon).getImage(); |
234 |
beanInfoIcon = ((ImageIcon) icon).getImage (); |
234 |
} else { |
235 |
} |
235 |
beanInfoIcon = Utilities.loadImage("org/openide/resources/actions/empty.gif", true); // NOI18N |
236 |
-- |
|
|
Line 253
Link Here
|
253 |
Class clazz; |
|
|
Lines 257-261
Link Here
|
257 |
clazz = ic.instanceClass(); |
256 |
Class clazz = ic.instanceClass(); |
258 |
} catch (Exception e) { |
|
|
259 |
ErrorManager.getDefault ().notify (ErrorManager.INFORMATIONAL, e); |
260 |
return; |
261 |
} |
262 |
-- |
Lines 271-273
Link Here
|
271 |
// Also specially handle SystemAction's. |
266 |
// Also specially handle action instances. |
272 |
if (SystemAction.class.isAssignableFrom (clazz)) { |
267 |
if (Action.class.isAssignableFrom(clazz)) { |
273 |
SystemAction action = SystemAction.get (clazz); |
268 |
Action action = (Action)ic.instanceCreate(); |
274 |
-- |
|
|
Line 275
Link Here
|
275 |
String name = action.getName (); |
270 |
String name = (String)action.getValue(Action.NAME); |
276 |
-- |
|
|
Lines 280-281
Link Here
|
280 |
ErrorManager.getDefault().notify( |
275 |
ErrorManager.getDefault().log(ErrorManager.WARNING, |
281 |
new RuntimeException("Please attach following information to the issue " + // NOI18N |
276 |
"Please attach following information to the issue " + // NOI18N |
282 |
-- |
|
|
Line 283
Link Here
|
283 |
"SystemAction " + className + " does not implement getName() properly. It returns null!")); // NOI18N |
278 |
"action " + className + " does not implement SystemAction.getName() or Action.getValue(NAME) properly. It returns null!"); // NOI18N |
284 |
-- |
|
|
Line 297
Link Here
|
297 |
setDisplayName(getDataObject().getName()); |
292 |
} catch (Exception e) { |
298 |
-- |
293 |
ErrorManager.getDefault ().notify (ErrorManager.INFORMATIONAL, e); |
|
|
294 |
setDisplayName(getDataObject().getName()); |
295 |
return; |
296 |
} |
Line 595
Link Here
|
595 |
public SystemAction getDefaultAction() { |
594 |
public Action getPreferredAction() { |
596 |
-- |
|
|