• Interface IAction
  •  package org.eclipse.jface.action;
    import org.eclipse.core.commands.IHandlerAttributes;
    import org.eclipse.jface.resource.ImageDescriptor;
    import org.eclipse.jface.util.IPropertyChangeListener;
    import org.eclipse.swt.events.HelpListener;
    import org.eclipse.swt.widgets.Event;
    public interface IAction {
    public static int AS_UNSPECIFIED = 0x00;
    public static int AS_PUSH_BUTTON = 0x01;
    public static int AS_CHECK_BOX = 0x02;
    public static int AS_DROP_DOWN_MENU = 0x04;
    public static int AS_RADIO_BUTTON = 0x08;
    public static final String TEXT = "text";
    public static final String ENABLED = "enabled";
    public static final String IMAGE = "image";
    public static final String TOOL_TIP_TEXT = "toolTipText";
    public static final String DESCRIPTION = "description";
    public static final String CHECKED = "checked";
    public static final String RESULT = "result";
    public static final String HANDLED = IHandlerAttributes.ATTRIBUTE_HANDLED;
    public void addPropertyChangeListener(IPropertyChangeListener listener);
    public int getAccelerator();
    public String getActionDefinitionId();
    public String getDescription();
    public ImageDescriptor getDisabledImageDescriptor();
    public HelpListener getHelpListener();
    public ImageDescriptor getHoverImageDescriptor();
    public String getId();
    public ImageDescriptor getImageDescriptor();
    public IMenuCreator getMenuCreator();
    public int getStyle();
    public String getText();
    public String getToolTipText();
    public boolean isChecked();
    public boolean isEnabled();
    public boolean isHandled();
    public void removePropertyChangeListener(IPropertyChangeListener listener);
    public void run();
    public void runWithEvent(Event event);
    public void setActionDefinitionId(String id);
    public void setChecked(boolean checked);
    public void setDescription(String text);
    public void setDisabledImageDescriptor(ImageDescriptor newImage);
    public void setEnabled(boolean enabled);
    public void setHelpListener(HelpListener listener);
    public void setHoverImageDescriptor(ImageDescriptor newImage);
    public void setId(String id);
    public void setImageDescriptor(ImageDescriptor newImage);
    public void setMenuCreator(IMenuCreator creator);
    public void setText(String text);
    public void setToolTipText(String text);
    public void setAccelerator(int keycode);
    }

    IAction

  • IPageService
  •  public interface IPageService {
    public void addPageListener(IPageListener listener);
    public void addPerspectiveListener(IPerspectiveListener listener);
    public IWorkbenchPage getActivePage();
    public void removePageListener(IPageListener listener);
    public void removePerspectiveListener(IPerspectiveListener listener);
    }
  • IRunnableContext
  •  public interface IRunnableContext {
    public void run(boolean fork, boolean cancelable,
    IRunnableWithProgress runnable) throws InvocationTargetException,
    InterruptedException;
    }
  • IServiceLocator
  •  public interface IServiceLocator {
    public Object getService(Class api);
    public boolean hasService(Class api);
    }
  • IShellProvider
  •  public interface IShellProvider {
    Shell getShell();
    }
  • IWorkbenchWindow:A workbench window is a top level window in a workbench. Visually, a workbench window has a menubar, a toolbar, a status bar, and a main area for displaying a single page consisting of a collection of views and editors. Each workbench window has a collection of 0 or more pages; the active page is the one that is being presented to the end user; at most one page is active in a window at a time. Same as Activity???
  •  public interface IWorkbenchWindow extends IPageService,
    IRunnableContext,
    IServiceLocator,
    IShellProvider
    {
    public boolean close();
    public IWorkbenchPage getActivePage();
    public IWorkbenchPage[] getPages();
    public IPartService getPartService();
    public ISelectionService getSelectionService();
    public Shell getShell();
    public IWorkbench getWorkbench();
    public boolean isApplicationMenu(String menuId);
    public IWorkbenchPage openPage(String perspectiveId, IAdaptable input)
    throws WorkbenchException;
    public IWorkbenchPage openPage(IAdaptable input) throws WorkbenchException;
    public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException;
    public void setActivePage(IWorkbenchPage page);
    public IExtensionTracker getExtensionTracker();
    }
  • Interface IActionDelegate
  •  package org.eclipse.ui;
    import org.eclipse.jface.action.IAction;
    import org.eclipse.jface.viewers.ISelection; public interface IActionDelegate {
    public void run(IAction action);
    public void selectionChanged(IAction action, ISelection selection);
    }
  • IWorkbenchWindowActionDelegate
  •  package org.eclipse.ui;
    
     import org.eclipse.ui.IActionDelegate;
    import org.eclipse.ui.IWorkbenchWindow; public interface IWorkbenchWindowActionDelegate extends IActionDelegate {
    public void dispose();
    public void init(IWorkbenchWindow window);
    }
  • HelloAction 
  •  package com.dragon.contribution.hello.actions;
    
     import org.eclipse.jface.action.IAction;
    import org.eclipse.jface.viewers.ISelection;
    import org.eclipse.ui.IWorkbenchWindow;
    import org.eclipse.ui.IWorkbenchWindowActionDelegate;
    import org.eclipse.jface.dialogs.MessageDialog; public class HelloAction implements IWorkbenchWindowActionDelegate {
    private IWorkbenchWindow window; public HelloAction() {
    }
    public void run(IAction action) { //implementation when clicking menu or button in tools button
    MessageDialog.openInformation(
    window.getShell(),
    "Hello",
    "Hello, Eclipse world");
    }
    public void selectionChanged(IAction action, ISelection selection) {
    }
    public void dispose() {
    }
    public void init(IWorkbenchWindow window) { //called by Eclipse core and pass window object created by runtime kernel
    this.window = window;
    }
    }

Eclipse Action的更多相关文章

  1. eclipse使用struts2找不到action方法或找不到action的错误记录

    在确认web.xml已经配置, 配置好struts.xml , 代码没有报错, jar包没有问题, 服务器也没有问题, 代码逻辑没有问题, 关键字方法名action都没有写错, 可以运行旧的相同的代码 ...

  2. eclipse中配置struts2出现There is no Action mapped for namespace [/] and action name [Login] associated wi

    下午在eclipse中配置struts2时报: There is no Action mapped for namespace [/] and action name [Login] associat ...

  3. eclipse使用SSH框架出现There is no Action mapped for namespace [/] and action name [] associated with context path错误

    eclipse使用SSH框架出现There is no Action mapped for namespace [/] and action name [] associated with conte ...

  4. The command ("dfs.browser.action.delete") is undefined 解决Hadoop Eclipse插件报错

    Hadoop Eclipse插件 报错. 使用 hadoop-eclipse-kepler-plugin-2.2.0.jar 如下所示 Error Log 强迫症看了 受不了 The command ...

  5. 【原】eclipse save action设置文件保存时自动格式化

    学了一段java了,发现其实eclipse有很多实用小功能,能够让你编码的时候快捷方便,如果你苦于一些你常用到的功能无法自动实现,那么你可以上网查一下,就会发现其实eclipse已经给你提供了便捷之路 ...

  6. Eclipse groovy in action

    Eclipse :Version: Juno Service Release 2GrEclipse plugins:http://dist.springsource.org/release/GRECL ...

  7. Eclipse 刚检出的项目 Build path 的时候提示 No action available

    问题: 从SVN检出来的项目发现无法进行build path,也不报错,任何类之间也无法关联(Ctrl+右键无法点进去). 原因: .classpath是Eclipse的工程文件,别人没有将工程的信息 ...

  8. C#跨平台手机应用开发工具Xamarin尝试 与Eclipse简单对比

    Xamarin 支持使用C#开发基于Android.IOS.WindowsPhone应用开发,最大特点C#+跨平台,详细说明问度娘. 安装 研究 想体验研究的点击查看页面 Xamarin For Vi ...

  9. eclipse运行没问题,tomcat以脚本启动后插入数据库的中文会乱码

    记一次部署工程的时候遇到的问题 部署war包到win7的时候发现,布上去后插入数据库的中文会乱码,然后发现用eclipse运行源码没问题,一开始以为是war打出来的时候编码错误,然后将eclipse的 ...

随机推荐

  1. ubuntu14.04 apt-get install找不到软件,更换源解决

    安装14.04后,有时使用apt-get命令安装程序,会提示找不到程序,这是因为软件源不正确,网上说的换163的.中科大的.阿里的等等,我在更新源的时候都会出错,一般是报404错误,网上也没找到好的办 ...

  2. spring boot中 启用aspectj

    <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring- ...

  3. PyCharm出现module 'matplotlib' has no attribute 'verbose'解决方案

    其实不是你安装错了,也不是你代码问题,这就是PyCharm的锅! 虽然有三种解法办法,我觉得还是改IDE配置是最佳方法 把这个钩去掉就行了...... # -*- coding: utf-8 -*- ...

  4. input keyup的时候实现内容过滤

    当在文本框中输入关键字,就会搜索出包含关键字的数据 实现: 只需要一个内容过滤即可 <body> <input type="text" id="sear ...

  5. nginx配置文件企业优化

    1.1 企业规范优化Nginx配置文件 第一个里程碑:创建扩展目录,生成虚拟主机配置文件 mkdir extra sed -n '10,15p' nginx.conf >extra/www.co ...

  6. 需要了解的几个Java基础点

    关键字 native:表示要调用非Java语言写函数,比如用C语言使用JNI实现的接口.比如windows环境的dll文件.举例:Object.hashcode() 位运算 << n:左移 ...

  7. TCP通讯模型简单示例

    1. TCP通讯模型 2. 服务器端 ① 创建socket,用函数socket() ② 绑定IP地址.端口号等信息到socket上,用函数bind() ③ 设置允许的最大连接数,用函数listen() ...

  8. sql CET实现循环

    表结构 CREATE TABLE city( id INT IDENTITY(1,1) PRIMARY KEY, NAME NVARCHAR(100), ParentID INT , Parents ...

  9. Electron、Node.js、JavaScript、JQuery、Vue.js、Angular.js,layui,bootstrap

    转载:https://blog.csdn.net/meplusplus/article/details/79033786 layui :是基于jquery库的封装开发. bootstrap:同样基于 ...

  10. hive on hbase

    },{NAME },{NAME } put 'ccc20180710','ooccpp.com','f1:c1','name1' put 'ccc20180710','ooccpp.com','f1: ...