• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PaletteActions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.netbeans.spi.palette.PaletteActions的典型用法代码示例。如果您正苦于以下问题:Java PaletteActions类的具体用法?Java PaletteActions怎么用?Java PaletteActions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PaletteActions类属于org.netbeans.spi.palette包,在下文中一共展示了PaletteActions类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getActions

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
@Override
public Action[] getActions(boolean context) {
    if (actions == null) {
        List<Action> actionList = new ArrayList<Action>(5);
        Action a = new Utils.NewCategoryAction( this );
        if( a.isEnabled() ) {
            actionList.add( a );
            actionList.add( null );
        }
        actionList.add( new Utils.SortCategoriesAction( this ) );
        actionList.add( null );
        actionList.add( new Utils.RefreshPaletteAction() );
        actions = actionList.toArray( new Action[actionList.size()] );
    }
    PaletteActions customActions = (PaletteActions)getLookup().lookup( PaletteActions.class );
    if( null != customActions ) {
        return Utils.mergeActions( actions, customActions.getCustomPaletteActions() );
    }
    return actions;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:RootNode.java


示例2: getActions

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
public Action[] getActions(boolean context) {
    if (actions == null) {
        Node n = getParentNode();
        if( null == n ) {
            return new Action[0];
        }

        actions = new Action[] {
            new Utils.CutItemAction( this ),
            new Utils.CopyItemAction( this ),
            new Utils.PasteItemAction( n ),
            null,
            new Utils.RemoveItemAction( this ),
            null,
            new Utils.SortItemsAction( n ),
            null,
            new Utils.RefreshPaletteAction()
        };
    }
    PaletteActions customActions = getCustomActions();
    if( null != customActions ) {
        return Utils.mergeActions( actions, customActions.getCustomItemActions( getLookup() ) );
    }
    return actions;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ItemNode.java


示例3: createCustomButtons

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
private void createCustomButtons() {
    PaletteActions customActions = root.getLookup().lookup( PaletteActions.class );
    if( null == customActions )
        return;
    
    Action[] actions = customActions.getImportActions();
    if( null == actions || actions.length == 0 )
        return;
    
    customButtons = new JButton[actions.length];
    for( int i=0; i<actions.length; i++ ) {
        customButtons[i] = new JButton( actions[i] );
        if( null != actions[i].getValue( Action.NAME ) )
            Mnemonics.setLocalizedText( customButtons[i], actions[i].getValue( Action.NAME ).toString() );
        if( null != actions[i].getValue( Action.LONG_DESCRIPTION ) )
            customButtons[i].getAccessibleContext().setAccessibleDescription( actions[i].getValue( Action.LONG_DESCRIPTION ).toString() );
        java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = i;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 10);
        customActionsPanel.add( customButtons[i], gridBagConstraints);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:Customizer.java


示例4: refresh

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
public void refresh() {
    synchronized( rootNode ) {
        PaletteActions customActions = rootNode.getLookup().lookup( PaletteActions.class );
        Action customRefreshAction = customActions.getRefreshAction();
        if( null != customRefreshAction ) {
            customRefreshAction.actionPerformed( new ActionEvent( getRoot(), 0, "refresh" ) ); //NOI18N
        }
        clearSelection();
        categoriesNeedRefresh = true;
        isRefreshingChildren = true;
        try {
            rootNode.refreshChildren();
        } finally {
            isRefreshingChildren = false;
        }
        fireCategoriesChanged( null, false );
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:DefaultModel.java


示例5: getActions

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
@Override
public Action[] getActions(boolean context) {
    if (actions == null) {
        Node n = getParentNode();
        if( null == n ) {
            return new Action[0];
        }
        List<Action> actionList = new ArrayList<Action>(12);
        actionList.add( new Utils.PasteItemAction( this ) );
        actionList.add( null );
        Action a = new Utils.NewCategoryAction( n );
        if( a.isEnabled() ) {
            actionList.add( a );
            actionList.add( null );
        }
        actionList.add( new Utils.DeleteCategoryAction(this) );
        actionList.add( new Utils.RenameCategoryAction(this) );
        actionList.add( null );
        actionList.add( new Utils.SortItemsAction(this) );
        actionList.add( null );
        actionList.add( new Utils.SortCategoriesAction( n ) );
        actionList.add( null );
        actionList.add( new Utils.RefreshPaletteAction() );
        actions = actionList.toArray( new Action[actionList.size()] );
    }
    PaletteActions customActions = (PaletteActions)getParentNode().getLookup().lookup( PaletteActions.class );
    if( null != customActions ) {
        return Utils.mergeActions( actions, customActions.getCustomCategoryActions( getLookup() ) );
    }
    return actions;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:CategoryNode.java


示例6: getCustomActions

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
private PaletteActions getCustomActions() {
    PaletteActions res = null;
    Node category = getParentNode();
    if( null != category ) {
        Node root = category.getParentNode();
        if( null != root ) {
           res = root.getLookup().lookup( PaletteActions.class ); 
        }
    }
    return res;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ItemNode.java


示例7: resetPalette

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
public static void resetPalette( final PaletteController controller, final Settings settings ) {
    Node rootNode = (Node)controller.getRoot().lookup( Node.class );
    if( null != rootNode ) {
        PaletteActions customActions = rootNode.getLookup().lookup( PaletteActions.class );
        Action resetAction = customActions.getResetAction();
        if( null != resetAction ) {
            settings.reset();
            resetAction.actionPerformed( new ActionEvent( controller, 0, "reset" ) ); //NOI18N
            controller.refresh();
        } else {
            resetPalette( rootNode, controller, settings );
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:Utils.java


示例8: createPaletteActions

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
@Override
public PaletteActions createPaletteActions() {
    return new FormPaletteActions();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:NbFormServices.java


示例9: getPreferredAction

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
public Action getPreferredAction() {

        PaletteActions customActions = getCustomActions();
        
        if( null == customActions )
            return null;;
        
        return customActions.getPreferredAction( getLookup() );
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ItemNode.java


示例10: createPaletteActions

import org.netbeans.spi.palette.PaletteActions; //导入依赖的package包/类
PaletteActions createPaletteActions(); 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:2,代码来源:FormServices.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HealthMonitor类代码示例发布时间:2022-05-22
下一篇:
Java Namespace类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap