Package org.openide.util

Examples of org.openide.util.ContextAwareAction


    public static ContextAwareAction alwaysEnabled(Map m) {
        try {
            Class<?> aeaClass = Lookup.getDefault().lookup(ClassLoader.class).loadClass("org.openide.awt.AlwaysEnabledAction");
            Method createMethod = aeaClass.getDeclaredMethod("create", Map.class);
            createMethod.setAccessible(true);
            ContextAwareAction action = (ContextAwareAction) createMethod.invoke(aeaClass, m);
            return new ContextAwareActionWrapper(action);

        } catch (Exception ex) {
            Exceptions.printStackTrace(ex);
            return null;
View Full Code Here


    public static void renameProject(Project p, Object caller) {
        if (p == null) {
            return;
        }
        ContextAwareAction action = (ContextAwareAction) CommonProjectActions.renameProjectAction();
        Lookup ctx = Lookups.singleton(p);
        Action ctxAction = action.createContextAwareInstance(ctx);
        ctxAction.actionPerformed(new ActionEvent(caller, 0, "")); // NOI18N
    }
View Full Code Here

TOP

Related Classes of org.openide.util.ContextAwareAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.