Here you can find the source of getActionInstanceName(Action delegate)
private static String getActionInstanceName(Action delegate)
//package com.java2s; //License from project: GNU General Public License import javax.swing.Action; public class Main { private static final String INSTANCE_PREFIX = "TransientAction-"; private static final String INSTANCE_SUFFIX = ".instance"; private static String getActionInstanceName(Action delegate) { Object commandKey = delegate.getValue(Action.ACTION_COMMAND_KEY); String id;//ww w . ja va 2 s. c o m if (commandKey != null && !commandKey.toString().isEmpty()) { id = commandKey.toString(); } else { id = delegate.getClass().getName(); } id = id.replace('/', '-').replace('.', '-').replace('$', '-'); if (!id.startsWith(INSTANCE_PREFIX)) { id = INSTANCE_PREFIX + id; } if (!id.endsWith(INSTANCE_SUFFIX)) { id += INSTANCE_SUFFIX; } return id; } }