package testrcp.actions;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
import org.eclipse.ui.views.IViewDescriptor;
public class ActionManager {
public static IWorkbenchAction createHelloWorldAction(IWorkbenchWindow window) {
if(window == null)
throw new IllegalArgumentException();
IWorkbenchAction helloWorldAction = new HelloWorldAction(window);
return helloWorldAction;
}
/**获得plugin.xml文件中配置的视图信息*/
public static IWorkbenchAction createShowViewAction(IWorkbenchWindow window, String viewId) {
if(window == null)
throw new IllegalArgumentException();
IViewDescriptor desc = window.getWorkbench().getViewRegistry().find(viewId);
IWorkbenchAction action = new ShowViewAction(window, desc);
return action;
}
}
posted on 2008-12-05 23:45
Ke 阅读(421)
评论(0) 编辑 收藏 所属分类:
eclipse RCP