• 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. Django / Python 链接MySQL数据库

    https://www.cnblogs.com/wupeiqi/articles/5237704.html python (Django)中使用MySQL 首先python3中没有 MySQLdb 需 ...

  2. [USACO08MAR]跨河River Crossing dp

    题目描述 Farmer John is herding his N cows (1 <= N <= 2,500) across the expanses of his farm when ...

  3. 19.Longest Substring Without Repeating Characters(长度最长的不重复子串)

    Level:   Medium 题目描述: Given a string, find the length of the longest substring without repeating cha ...

  4. 使用css实现垂直居中

    vartical-align vartical-align可以设置行内元素和表格单元格(table-cell)垂直对方式,所以如果元素是行内元素或者表格的话,可以直接应用这个属性对内容进行对齐设置.如 ...

  5. spring读取配置文件,且获取bean实例

    import org.springframework.beans.factory.BeanFactory;import org.springframework.beans.factory.xml.Xm ...

  6. spring boot app

    一个demo  可以参考一下 AppConfig @Configuration @ComponentScan(basePackages = { "org.whm.test" }) ...

  7. POJ 1000 A+B

    #include <stdio.h> int main() { int a,b; scanf("%d %d",&a, &b); printf(" ...

  8. 读经典——《CLR via C#》(Jeffrey Richter著) 笔记_引用类型和值类型(二)

    [引用类型和值类型的区别] //引用类型(由于使用了‘class’) class SomeRef { public Int32 x; } //值类型(由于使用了‘struct’) struct Som ...

  9. FileLoadException: 未能加载文件或程序集"aliyun-net-sdk-cf, Version=1.0.0.0,

    清理缓存解决 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files C:\Windows\Microsoft. ...

  10. IP 地址分类

    1.1 网络IP地址分类 网络通讯过程中数据封装与解封过程(网际互联通讯过程) TCP/IP模型 1)应用层 总结记录一些常见网络协议以及对应的端口号(FTP HTTP telnet) 2)主机到主机 ...