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


Java ActionRegistration类代码示例

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


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

示例1: profileProjectPopup

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
@Messages({
    "LBL_ProfileProject=Profile"
})
@ActionID(category="Profile", id="org.netbeans.modules.profiler.actions.ProfileProjectPopup")
@ActionRegistration(displayName="#LBL_ProfileProject", lazy=false, asynchronous=true)
@ActionReferences({
    @ActionReference(path="Projects/org-netbeans-modules-java-j2seproject/Actions", position=1000),
    @ActionReference(path="Projects/org-netbeans-modules-java-j2semodule/Actions", position=1000),
    @ActionReference(path="Projects/org-netbeans-modules-apisupport-project/Actions", position=900),
    @ActionReference(path="Projects/org-netbeans-modules-apisupport-project-suite/Actions", position=1000),
    @ActionReference(path="Projects/org-netbeans-modules-web-project/Actions", position=1000)
})
public static Action profileProjectPopup() {
    Action delegate = ProjectSensitiveActions.projectSensitiveAction(
            ProjectSensitivePerformer.profileProject(ActionProvider.COMMAND_PROFILE), 
            NbBundle.getMessage(AntActions.class, "LBL_ProfileProject"), // NOI18N
            null
    );
    
    return delegate;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:AntActions.java

示例2: profileSingle

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
@Messages("LBL_ProfileFile=Profile &File")
@ActionID(category="Profile", id="org.netbeans.modules.profiler.actions.ProfileSingle")
@ActionRegistration(displayName="#LBL_ProfileFile", lazy=false)
@ActionReferences({
    @ActionReference(path="Loaders/text/x-java/Actions", position=1200),
    @ActionReference(path="Loaders/text/x-jsp/Actions", position=800),
    @ActionReference(path="Menu/Profile", position=110)
})
public static Action profileSingle() {
    Action delegate = FileSensitiveActions.fileSensitiveAction(
            new FileSensitivePerformer(ActionProvider.COMMAND_PROFILE_SINGLE),  
            Bundle.LBL_ProfileFile(),
            null);
    
    return delegate;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:AntActions.java

示例3: projects

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
@Messages({
        "# {0} - # of selected projects (0 if disabled), or -1 if main project", 
        "# {1} - project name, if exactly one project", 
//        "LBL_ProfileMainProjectAction=&Profile {0,choice,-1#Main Project|0#Project|1#Project ({1})|1<{0} Projects}" // #231371
        "LBL_AttachMainProjectAction=&Attach to {0,choice,-1#Main Project|0#Project|1#Project ({1})|1<Project}"
    })
    @ActionID(category="Profile", id="org.netbeans.modules.profiler.actions.AttachMainProject")
    @ActionRegistration(displayName="#LBL_AttachMainProjectAction", lazy=false)
    @ActionReferences({
        @ActionReference(path="Menu/Profile", position=125)
    })
    public static Action attachMainProjectAction() {
        Action delegate = ProjectSensitiveActions.projectSensitiveAction(
                ProjectSensitivePerformer.attachProject(), 
                NbBundle.getMessage(AntActions.class, "LBL_AttachMainProjectAction"), // NOI18N
                Icons.getIcon(ProfilerIcons.ATTACH)
        );
        delegate.putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(AntActions.class, "LBL_AttachMainProjectAction")); // NOI18N
        delegate.putValue("iconBase", Icons.getResource(ProfilerIcons.ATTACH)); // NOI18N
        
        return delegate;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:AntActions.java

示例4: customPopupActions

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
@ActionID(id = "org.netbeans.modules.maven.customPopup", category = "Project")
@ActionRegistration(displayName = "#LBL_Custom_Run", lazy=false)
@ActionReferences({
    @ActionReference(position = 1400, path = "Projects/org-netbeans-modules-maven/Actions"),
    @ActionReference(position = 250, path = "Loaders/text/x-maven-pom+xml/Actions"),
    @ActionReference(position = 1296, path = "Loaders/text/x-java/Actions"),
    @ActionReference(position = 1821, path = "Editors/text/x-java/Popup")
})
@Messages({"LBL_Custom_Run=Run Maven", "LBL_Custom_Run_File=Run Maven"})
public static ContextAwareAction customPopupActions() {
    return new ConditionallyShownAction() {
        
        protected @Override Action forProject(Project p, FileObject fo) {
            ActionProviderImpl ap = p.getLookup().lookup(ActionProviderImpl.class);
            return ap != null ? ap.new CustomPopupActions(triggeredOnFile, triggeredOnPom, fo) : null;
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:ActionProviderImpl.java

示例5: closeSubprojectsAction

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
@ActionID(id = "org.netbeans.modules.maven.closeSubprojects", category = "Project")
@ActionRegistration(displayName = "#ACT_CloseRequired", lazy=false)
@ActionReference(position = 2000, path = "Projects/org-netbeans-modules-maven/Actions")
@Messages("ACT_CloseRequired=Close Required Projects")
public static ContextAwareAction closeSubprojectsAction() {
    return new ConditionallyShownAction() {
        protected @Override Action forProject(Project p, FileObject fo) {
            NbMavenProjectImpl project = p.getLookup().lookup(NbMavenProjectImpl.class);
            if (project != null && NbMavenProject.TYPE_POM.equalsIgnoreCase(project.getProjectWatcher().getPackagingType())) {
                return new CloseSubprojectsAction(project);
            } else {
                return null;
            }
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ActionProviderImpl.java

示例6: newModeAction

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
@ActionID(category = "System", id = "org.netbeans.core.windows.model.NewMode")
@ActionRegistration(iconBase = "org/netbeans/core/windows/design/DesignView.png",
displayName = "#CTL_NewMode")
@Messages("CTL_NewMode=New Mode")
public static ActionListener newModeAction() {
    return new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            DesignViewComponent dvc = new DesignViewComponent();
            /*
            WindowManagerImpl wmi = (WindowManagerImpl)WindowManager.getDefault();
            Mode m = wmi.createMode("mode_" + (++designModeCounter),
                Constants.MODE_KIND_VIEW, Constants.MODE_KIND_VIEW, true,
                new SplitConstraint[]{new SplitConstraint(Constants.HORIZONTAL, 1, 0.2)}
            );
            m.dockInto(dvc);
             */
            dvc.open();
            dvc.requestAttention(true);
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:DesignView.java

示例7: copyAsText

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
/**
 * Return an Action which copies text without its format.
 *
 * @return
 */
@ActionID(
        category = "Edit/Office/Word Processor",
        id = "org.joeffice.wordprocessor.actions.copyAsText")
@ActionRegistration(
        displayName = "#CTL_CopyAsText")
@ActionReference(path = "Menu/Edit/Gimme More/Word Processor", position = 600)
@Messages("CTL_CopyAsText=Copy as text")
public static Action copyAsText() {
    String actionName = NbBundle.getMessage(SimpleActionsFactory.class, "CTL_CopyAsText");
    Action action = new AbstractAction(actionName) {
        @Override
        public void actionPerformed(ActionEvent e) {
            JTextPane edit = WordProcessorTopComponent.findCurrentTextPane();
            RichTextTransferHandler transferHandler = ((RichTextTransferHandler) edit.getTransferHandler());
            try {
                transferHandler.setAsTextOnly(true);
                edit.copy();
            } finally {
                transferHandler.setAsTextOnly(false);
            }
        }
    };
    return action;
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:30,代码来源:SimpleActionsFactory.java

示例8: pasteAsText

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
/**
 * Return an Action which pastes text unformatted.
 *
 * @return
 */
@ActionID(
        category = "Edit/Office/Word Processor",
        id = "org.joeffice.wordprocessor.actions.pasteAsText")
@ActionRegistration(
        displayName = "#CTL_PasteAsText")
@ActionReference(path = "Menu/Edit/Gimme More/Word Processor", position = 700)
@Messages("CTL_PasteAsText=Paste as text")
public static Action pasteAsText() {
    String actionName = NbBundle.getMessage(SimpleActionsFactory.class, "CTL_PasteAsText");
    Action action = new AbstractAction(actionName) {
        @Override
        public void actionPerformed(ActionEvent e) {
            JTextPane edit = WordProcessorTopComponent.findCurrentTextPane();
            RichTextTransferHandler transferHandler = ((RichTextTransferHandler) edit.getTransferHandler());
            try {
                transferHandler.setAsTextOnly(true);
                edit.paste();
            } finally {
                transferHandler.setAsTextOnly(false);
            }
        }
    };
    return action;
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:30,代码来源:SimpleActionsFactory.java

示例9: setMarginsAction

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
/**
 * Return an Action which sets margins of document. Used for creating menu item.
 *
 * @return
 */
@ActionID(
        category = "Edit/Office/Word Processor",
        id = "org.joeffice.wordprocessor.actions.MarginsAction")
@ActionRegistration(
        displayName = "#CTL_MarginsAction")
@ActionReference(path = "Menu/Edit/Gimme More/Word Processor", position = 1800)
@Messages("CTL_MarginsAction=Margins...")
public static Action setMarginsAction() {
    Action action = new AbstractAction("Margins...") {
        @Override
        public void actionPerformed(ActionEvent e) {
            JFrame mainFrame = (JFrame) WindowManager.getDefault().getMainWindow();
            JTextPane edit = WordProcessorTopComponent.findCurrentTextPane();
            DocxDocument doc = (DocxDocument) edit.getDocument();
            MarginsPanel marginsPanel = new MarginsPanel();
            marginsPanel.setMargins(doc.getDocumentMargins());
            marginsPanel.showDialog(mainFrame);
            if (marginsPanel.getOption() == JOptionPane.OK_OPTION) {
                doc.setDocumentMargins(marginsPanel.getMargins());
            }
        }
    };
    return action;
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:30,代码来源:SimpleActionsFactory.java

示例10: deleteTableAction

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
/**
 * Return an Action which removes table from document. Used for creating menu item.
 *
 * @return
 */
@ActionID(
        category = "Edit/Office/Word Processor",
        id = "org.joeffice.wordprocessor.actions.deleteTableAction")
@ActionRegistration(
        displayName = "#CTL_DeleteTableAction")
@ActionReference(path = "Menu/Edit/Gimme More/Word Processor/Table", position = 2000, separatorBefore = 1990)
@Messages("CTL_DeleteTableAction=Delete table")
public static Action deleteTableAction() {
    Action action = new AbstractAction("Table") {
        @Override
        public void actionPerformed(ActionEvent e) {
            JTextPane edit = WordProcessorTopComponent.findCurrentTextPane();
            DocxDocument doc = (DocxDocument) edit.getDocument();
            doc.deleteTable(edit.getCaretPosition());
        }
    };
    return action;
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:24,代码来源:SimpleActionsFactory.java

示例11: deleteRowAction

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
/**
 * Return an Action which removes row from document's table. Used for creating menu item.
 *
 * @return
 */
@ActionID(
        category = "Edit/Office/Word Processor",
        id = "org.joeffice.wordprocessor.actions.deleteRowAction")
@ActionRegistration(
        displayName = "#CTL_DeleteRowAction")
@ActionReference(path = "Menu/Edit/Gimme More/Word Processor/Table", position = 2100)
@Messages("CTL_DeleteRowAction=Delete row")
public static Action deleteRowAction() {
    Action action = new AbstractAction("Row") {
        @Override
        public void actionPerformed(ActionEvent e) {
            JTextPane edit = WordProcessorTopComponent.findCurrentTextPane();
            DocxDocument doc = (DocxDocument) edit.getDocument();
            doc.deleteRow(edit.getCaretPosition());
        }
    };
    return action;
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:24,代码来源:SimpleActionsFactory.java

示例12: deleteColumnAction

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
/**
 * Return an Action which removes column from document's table. Used for creating menu item.
 *
 * @return
 */
@ActionID(
        category = "Edit/Office/Word Processor",
        id = "org.joeffice.wordprocessor.actions.deleteColumnAction")
@ActionRegistration(
        displayName = "#CTL_DeleteColumnAction")
@ActionReference(path = "Menu/Edit/Gimme More/Word Processor/Table", position = 2200)
@Messages("CTL_DeleteColumnAction=Delete column")
public static Action deleteColumnAction() {
    Action action = new AbstractAction("Column") {
        @Override
        public void actionPerformed(ActionEvent e) {
            JTextPane edit = WordProcessorTopComponent.findCurrentTextPane();
            DocxDocument doc = (DocxDocument) edit.getDocument();
            doc.deleteColumn(edit.getCaretPosition());
        }
    };
    return action;
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:24,代码来源:SimpleActionsFactory.java

示例13: tablePropertiesAction

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
/**
 * Return an Action which setVisible(true)s table's properties Used for creating menu item.
 *
 * @return
 */
@ActionID(
        category = "Edit/Office/Word Processor",
        id = "org.joeffice.wordprocessor.actions.tablePropertiesAction")
@ActionRegistration(
        displayName = "#CTL_TablePropertiesAction")
@ActionReference(path = "Menu/Edit/Gimme More/Word Processor/Table", position = 2500, separatorBefore = 2490)
@Messages("CTL_TablePropertiesAction=Table Properties...")
public static Action tablePropertiesAction() {
    Action action = new AbstractAction("Table...") {
        @Override
        public void actionPerformed(ActionEvent e) {
            JTextPane edit = WordProcessorTopComponent.findCurrentTextPane();
            DocxDocument doc = (DocxDocument) edit.getDocument();
            Element table = doc.getTable(edit.getCaretPosition());
            if (table == null) {
                JOptionPane.showMessageDialog(null, "Invalid table offset!");
                return;
            }
            TableProperties tp = new TableProperties();
            tp.setTable(table);
            tp.setVisible(true);
        }
    };
    return action;
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:31,代码来源:SimpleActionsFactory.java

示例14: rowPropertiesAction

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
/**
 * Return an Action which setVisible(true)s row's properties Used for creating menu item.
 *
 * @return
 */
@ActionID(
        category = "Edit/Office/Word Processor",
        id = "org.joeffice.wordprocessor.actions.rowPropertiesAction")
@ActionRegistration(
        displayName = "#CTL_RowPropertiesAction")
@ActionReference(path = "Menu/Edit/Gimme More/Word Processor/Table", position = 2600)
@Messages("CTL_RowPropertiesAction=Row Properties...")
public static Action rowPropertiesAction() {
    Action action = new AbstractAction("Row...") {
        @Override
        public void actionPerformed(ActionEvent e) {
            JTextPane edit = WordProcessorTopComponent.findCurrentTextPane();
            DocxDocument doc = (DocxDocument) edit.getDocument();
            Element row = doc.getRow(edit.getCaretPosition());
            if (row == null) {
                JOptionPane.showMessageDialog(null, "Invalid row offset!");
                return;
            }
            TableProperties tp = new TableProperties();
            tp.setRow(row);
            tp.setVisible(true);
        }
    };
    return action;
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:31,代码来源:SimpleActionsFactory.java

示例15: cellPropertiesAction

import org.openide.awt.ActionRegistration; //导入依赖的package包/类
/**
 * Return an Action which setVisible(true)s cell's properties Used for creating menu item.
 *
 * @return
 */
@ActionID(
        category = "Edit/Office/Word Processor",
        id = "org.joeffice.wordprocessor.actions.cellPropertiesAction")
@ActionRegistration(
        displayName = "#CTL_CellPropertiesAction")
@ActionReference(path = "Menu/Edit/Gimme More/Word Processor/Table", position = 2700)
@Messages("CTL_CellPropertiesAction=Cell Properties...")
public static Action cellPropertiesAction() {
    Action action = new AbstractAction("Cell...") {
        @Override
        public void actionPerformed(ActionEvent e) {
            JTextPane edit = WordProcessorTopComponent.findCurrentTextPane();
            DocxDocument doc = (DocxDocument) edit.getDocument();
            Element cell = doc.getCell(edit.getCaretPosition());
            if (cell == null) {
                JOptionPane.showMessageDialog(null, "Invalid cell offset!");
                return;
            }
            TableProperties tp = new TableProperties();
            tp.setCell(cell);
            tp.setVisible(true);
        }
    };
    return action;
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:31,代码来源:SimpleActionsFactory.java


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