@Override protected final Map<String, Action> getUncachedTraits( String type ) { return inspectActions( type ); }
public Map<String, Action> getActions( String type ) { return getTraits( type ); }
protected final Map<String, Action> getActions( String type ) { if ( mActionStyle == null ) { return Collections.emptyMap(); } return mActionStyle.getActions( type ); }
/** * @return the actions of the given class. Never null. */ @Override protected Map<String, Action> inspectActions( String type ) { // TreeMap so that returns alphabetically sorted actions Map<String, Action> actions = CollectionUtils.newTreeMap( StringUtils.CASE_INSENSITIVE_COMPARATOR ); // For each action... Class<?> clazz = ClassUtils.niceForName( type ); if ( clazz == null ) { return actions; } for ( Method method : clazz.getMethods() ) { // ...that is a match... if ( !matchAction( method ) ) { continue; } // ...that is not excluded... String methodName = method.getName(); if ( isExcluded( ClassUtils.getOriginalDeclaringClass( method ), methodName, method.getReturnType() ) ) { continue; } // ...add it actions.put( methodName, new MethodAction( methodName, method ) ); } return actions; }
@Override protected Map<String, String> inspectAction( Action action ) throws Exception { Map<String, String> attributes = CollectionUtils.newHashMap(); // UiAction (this is kind of a dummy match) if ( action.isAnnotationPresent( UiAction.class ) ) { attributes.put( NAME, action.getName() ); } return attributes; }
@Override protected Map<String, String> inspectAction( Action action ) throws Exception { Map<String, String> attributes = CollectionUtils.newHashMap(); // org.jdesktop.application.Action (this is kind of a given) org.jdesktop.application.Action actionAnnotation = action.getAnnotation( org.jdesktop.application.Action.class ); if ( actionAnnotation != null ) { attributes.put( NAME, action.getName() ); if ( !"".equals( actionAnnotation.name() ) ) { attributes.put( LABEL, actionAnnotation.name() ); } } return attributes; } }
element.setAttribute( NAME, action.getName() );
/** * @return the actions of the given class. Never null. */ @Override protected Map<String, Action> inspectActions( String type ) { // TreeMap so that returns alphabetically sorted actions Map<String, Action> actions = CollectionUtils.newTreeMap( StringUtils.CASE_INSENSITIVE_COMPARATOR ); // For each action... Class<?> clazz = ClassUtils.niceForName( type ); if ( clazz == null ) { return actions; } for ( Method method : clazz.getMethods() ) { // ...that is a match... if ( !matchAction( method ) ) { continue; } // ...that is not excluded... String methodName = method.getName(); if ( isExcluded( ClassUtils.getOriginalDeclaringClass( method ), methodName, method.getReturnType() ) ) { continue; } // ...add it actions.put( methodName, new MethodAction( methodName, method ) ); } return actions; }
@Override protected Map<String, String> inspectAction( Action action ) throws Exception { Map<String, String> attributes = CollectionUtils.newHashMap(); // UiAction (this is kind of a dummy match) if ( action.isAnnotationPresent( UiAction.class ) ) { attributes.put( NAME, action.getName() ); } return attributes; }
element.setAttribute( NAME, action.getName() );
@Override protected final Map<String, Action> getUncachedTraits( String type ) { return inspectActions( type ); }
public Map<String, Action> getActions( String type ) { return getTraits( type ); }
protected final Map<String, Action> getActions( String type ) { if ( mActionStyle == null ) { return Collections.emptyMap(); } return mActionStyle.getActions( type ); }