当前位置: 首页>>代码示例>>Java>>正文


Java SystemAction.get方法代码示例

本文整理汇总了Java中org.openide.util.actions.SystemAction.get方法的典型用法代码示例。如果您正苦于以下问题:Java SystemAction.get方法的具体用法?Java SystemAction.get怎么用?Java SystemAction.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.util.actions.SystemAction的用法示例。


在下文中一共展示了SystemAction.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGetActions

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public void testGetActions () throws Exception {
    final SystemAction[] arr1 = {
        SystemAction.get (PropertiesAction.class)
    };
    final SystemAction[] arr2 = {
    };
    
    AbstractNode an = new AbstractNode (Children.LEAF) {
        @Override
        public SystemAction[] getActions () {
            return arr1;
        }
        
        @Override
        public SystemAction[] getContextActions () {
            return arr2;
        }
    };
    
    
    assertEquals ("getActions(false) properly delegates to getActions()", arr1, an.getActions (false));
    assertEquals ("getActions(true) properly delegates to getContextActions()", arr2, an.getActions (true));
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:NodeTest.java

示例2: getActions

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public Action[] getActions(boolean context) {
    if (catalog instanceof CatalogWriter)
        return new Action[] {
            SystemAction.get(AddCatalogEntryAction.class),
            SystemAction.get(RefreshAction.class),
            SystemAction.get(CatalogNode.UnmountAction.class),
            null,
            //??? #24349 CustimizeAction sometimes added by BeanNode here
            SystemAction.get(PropertiesAction.class)
        };
    else
        return new Action[] {
            SystemAction.get(RefreshAction.class),
            SystemAction.get(CatalogNode.UnmountAction.class),
            null,
            //??? #24349 CustimizeAction sometimes added by BeanNode here
            SystemAction.get(PropertiesAction.class)
        };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:CatalogNode.java

示例3: getActions

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action[] getActions(boolean context) {
    if ( context ) {
        return super.getActions(context);
    } else {
        return new SystemAction[] {
            SystemAction.get(CreateDatabaseAction.class),
            SystemAction.get(StartAction.class),
            SystemAction.get(StopAction.class),
            SystemAction.get(ConnectServerAction.class),
            SystemAction.get(DisconnectServerAction.class),
            SystemAction.get(DeleteAction.class),
            SystemAction.get(RefreshServerAction.class),
            SystemAction.get(AdministerAction.class),
            SystemAction.get(PropertiesAction.class)
        };
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:ServerNode.java

示例4: testIconsSystemAction24

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
/**
 * Test whether pressed, rollover and disabled 24x24 icons
 * work for SystemAction.
 */
public void testIconsSystemAction24() throws Exception {
    Action saInstance = SystemAction.get(TestSystemAction.class);
    
    JButton jb = new JButton();
    jb.putClientProperty("PreferredIconSize",new Integer(24));
    Actions.connect(jb, saInstance);
    
    Icon icon = jb.getIcon();
    assertNotNull(icon);
    checkIfLoadedCorrectIcon(icon, jb, 4, "Enabled icon");
    
    Icon rolloverIcon = jb.getRolloverIcon();
    assertNotNull(rolloverIcon);
    checkIfLoadedCorrectIcon(rolloverIcon, jb, 5, "Rollover icon");
    
    Icon pressedIcon = jb.getPressedIcon();
    assertNotNull(pressedIcon);
    checkIfLoadedCorrectIcon(pressedIcon, jb, 6, "Pressed icon");
    
    Icon disabledIcon = jb.getDisabledIcon();
    assertNotNull(disabledIcon);
    checkIfLoadedCorrectIcon(disabledIcon, jb, 7, "Disabled icon");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:ActionsTest.java

示例5: getProvider

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public static ShelveChangesActionProvider getProvider () {
    if (ACTION_PROVIDER == null) {
        ACTION_PROVIDER = new ShelveChangesActionProvider() {
            @Override
            public Action getAction () {
                Action a = SystemAction.get(SaveStashAction.class);
                Utils.setAcceleratorBindings("Actions/Git", a); //NOI18N
                return a;
            }

            @Override
            public JComponent[] getUnshelveActions (VCSContext ctx, boolean popup) {
                JComponent[] cont = UnshelveMenu.getInstance().getMenu(ctx, popup);
                if (cont == null) {
                    cont = super.getUnshelveActions(ctx, popup);
                }
                return cont;
            }
            
        };
    }
    return ACTION_PROVIDER;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ShelveChangesAction.java

示例6: getActions

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public Action[] getActions(boolean context) {
    if (!context) {
        return new Action[]{
            getPreferredAction(),
            SystemAction.get(HideResultAction.class)
        };
    } else {
        return new Action[0];
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:TextDetail.java

示例7: setUp

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
protected void setUp() throws Exception {
    global = SystemAction.get(actionClass());
    map = new ActionMap ();
    map.put (actionKey (), action);
    lookup = Lookups.singleton(map);
    // Retrieve context sensitive action instance if possible.
    clone = global.createContextAwareInstance(lookup);
    
    listener = new CntListener ();
    clone.addPropertyChangeListener(listener);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:AbstractCallbackActionTestHidden.java

示例8: testEnable

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
private void testEnable (final PropertySet [] pros) throws Exception {
    Node n = new AbstractNode (Children.LEAF) {
        public PropertySet [] getPropertySets () {
            return pros;
        }
    };
    
    
    assertEquals ("Node has the given properties.", pros, n.getPropertySets ());
    
    PropertiesAction pa = SystemAction.get(PropertiesAction.class);
    Action a = pa.createContextAwareInstance (n.getLookup ());
    
    assertTrue ("PropertiesAction is enabled.", a.isEnabled ());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:PropertiesActionTest.java

示例9: getPreferredAction

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action getPreferredAction() {
    if ((node.getInformation().getStatus() & FileInformation.STATUS_VERSIONED_CONFLICT) != 0) {
        return SystemAction.get(ResolveConflictsAction.class);
    }
    return SystemAction.get(DiffAction.class);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:SyncFileNode.java

示例10: getActions

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public Action[] getActions(boolean context) {
    return new Action[]{
                new EditDependencyAction(dep.getModuleEntry().getCodeNameBase(), project),
                SystemAction.get(FindAction.class),
                new ShowJavadocAction(dep, project),
                SystemAction.get(RemoveAction.class),
            };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:LibrariesNode.java

示例11: getActions

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action[] getActions(boolean context) {
    if ( context ) {
        return super.getActions(context);
    } else {
        return new SystemAction[] {
            SystemAction.get(ConnectAction.class),
            SystemAction.get(DeleteAction.class)
        };
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:DatabaseNode.java

示例12: getProvider

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public static ShelveChangesActionProvider getProvider () {
    if (ACTION_PROVIDER == null) {
        ACTION_PROVIDER = new ShelveChangesActionProvider() {
            @Override
            public Action getAction () {
                Action a = SystemAction.get(ShelveChangesAction.class);
                Utils.setAcceleratorBindings("Actions/Mercurial", a); //NOI18N
                return a;
            }
        };
    };
    return ACTION_PROVIDER;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ShelveChangesAction.java

示例13: undo

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
private void undo() throws Exception {
    final UndoAction ua = SystemAction.get(UndoAction.class);
    assertNotNull("Cannot obtain UndoAction", ua);
    while (ua.isEnabled()) {
        SwingUtilities.invokeAndWait(new Runnable() {

            public void run() {
                ua.performAction();
            }
        });
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:BasicOpenFileTest.java

示例14: getActions

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action[] getActions(boolean context) {
    return new Action[]{SystemAction.get(OpenAction.class)};
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Programming-Blueprints,代码行数:5,代码来源:PhotoNode.java

示例15: getActions

import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action[] getActions(boolean context) {
    return new Action[] { 
        SystemAction.get(RefreshAction.class)
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:DockerImagesNode.java


注:本文中的org.openide.util.actions.SystemAction.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。