Eclipse Common API
Platform runtime |
Defines the extension point and plug-in model. It dynamically discovers plug-ins and maintains information about the plug-ins and their extension points in a platform registry. Plug-ins are started up when required according to user operation of the platform. The runtime is implemented using the OSGi framework. |
Resource management (workspace) |
Defines API for creating and managing resources (projects, files, and folders) that are produced by tools and kept in the file system. |
Workbench UI |
Implements the user cockpit for navigating the platform. It defines extension points for adding UI components such as views or menu actions. It supplies additional toolkits (JFace and SWT) for building user interfaces. The UI services are structured so that a subset of the UI plug-ins can be used to build rich client applications that are independent of the resource management and workspace model. IDE-centric plug-ins define additional functionality for navigating and manipulating resources. |
Help system |
Defines extension points for plug-ins to provide help or other documentation as browsable books. |
Team support |
Defines a team programming model for managing and versioning resources. |
Debug support |
Defines a language independent debug model and UI classes for building debuggers and launchers. |
Other utilities |
Other utility plug-ins supply functionality such as searching and comparing resources, performing builds using XML configuration files, and dynamically updating the platform from a server. |
- PlatformUI
public static IWorkbench getWorkbench() {
if (Workbench.getInstance() == null) {
// app forgot to call createAndRunWorkbench beforehand
throw new IllegalStateException(WorkbenchMessages.PlatformUI_NoWorkbench);
}
return Workbench.getInstance();
}public static Display createDisplay() {
return Workbench.createDisplay();
}public static IPreferenceStore getPreferenceStore() {
return PrefUtil.getAPIPreferenceStore();
}- IWorkbench
public interfaceIWorkbench extends IAdaptable, IServiceLocator {
public Display getDisplay();
public IProgressService getProgressService();
public void addWorkbenchListener(IWorkbenchListener listener);
public void removeWorkbenchListener(IWorkbenchListener listener);
public void addWindowListener(IWindowListener listener);
public void removeWindowListener(IWindowListener listener);
public boolean close();
public IWorkbenchWindow getActiveWorkbenchWindow();
public IEditorRegistry getEditorRegistry();
public IWorkbenchOperationSupport getOperationSupport();
public IPerspectiveRegistry getPerspectiveRegistry();
public PreferenceManager getPreferenceManager();
public IPreferenceStore getPreferenceStore();
public ISharedImages getSharedImages();
public int getWorkbenchWindowCount();
public IWorkbenchWindow[] getWorkbenchWindows();
public IWorkingSetManager getWorkingSetManager();
public ILocalWorkingSetManager createLocalWorkingSetManager();
public IWorkbenchWindow openWorkbenchWindow(String perspectiveId,
IAdaptable input) throws WorkbenchException;
public IWorkbenchWindow openWorkbenchWindow(IAdaptable input)
throws WorkbenchException;
public boolean restart();
public IWorkbenchPage showPerspective(String perspectiveId,
IWorkbenchWindow window) throws WorkbenchException;
public IWorkbenchPage showPerspective(String perspectiveId,
IWorkbenchWindow window, IAdaptable input)
throws WorkbenchException;
public IDecoratorManager getDecoratorManager();
public boolean saveAllEditors(boolean confirm);
public IElementFactory getElementFactory(String factoryId);
IWorkbenchActivitySupport getActivitySupport();
IWorkbenchCommandSupport getCommandSupport();
IWorkbenchContextSupport getContextSupport();
public IThemeManager getThemeManager();
public IIntroManager getIntroManager();
public IWorkbenchHelpSystem getHelpSystem();
public IWorkbenchBrowserSupport getBrowserSupport();
public boolean isStarting();
public boolean isClosing();
public IExtensionTracker getExtensionTracker();
public IViewRegistry getViewRegistry();
public IWizardRegistry getNewWizardRegistry();
public IWizardRegistry getImportWizardRegistry();
public IWizardRegistry getExportWizardRegistry();
public boolean saveAll(IShellProvider shellProvider,
IRunnableContext runnableContext, ISaveableFilter filter,
boolean confirm);
public IShellProvider getModalDialogShellProvider();
}- IWorkbenchWindow
public interfaceIWorkbenchWindow 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();
}- Platform
public final class Platform {
public static final String PI_RUNTIME = "org.eclipse.core.runtime";
public static final String PT_APPLICATIONS = "applications";
public static final String PT_ADAPTERS = "adapters";
public static final String PT_PREFERENCES = "preferences";
public static final String PT_PRODUCT = "products";
public static final String OPTION_STARTTIME = PI_RUNTIME + "/starttime";
public static final String PREF_PLATFORM_PERFORMANCE = "runtime.performance";
public static final String PREF_LINE_SEPARATOR = "line.separator";
public static final int MIN_PERFORMANCE = 1;
public static final int MAX_PERFORMANCE = 5;
public static final int PARSE_PROBLEM = 1;
public static final int PLUGIN_ERROR = 2;
public static final int INTERNAL_ERROR = 3;
public static final int FAILED_READ_METADATA = 4;
public static final int FAILED_WRITE_METADATA = 5;
public static final int FAILED_DELETE_METADATA = 6;
public static final String OS_WIN32 = "win32";
public static final String OS_LINUX = "linux";
public static final String OS_AIX = "aix";//$NON-NLS-1$
..............
private Platform() {
super();
}
public static IAdapterManager getAdapterManager() {
return InternalPlatform.getDefault().getAdapterManager();
} public static String[] getCommandLineArgs() {
return InternalPlatform.getDefault().getCommandLineArgs();
}
public static IContentTypeManager getContentTypeManager() {
return InternalPlatform.getDefault().getContentTypeManager();
}
public static String getDebugOption(String option) {
return InternalPlatform.getDefault().getOption(option);
}
public static IPath getLocation() throws IllegalStateException {
return InternalPlatform.getDefault().getLocation();
}
public static IPath getLogFileLocation() {
return InternalPlatform.getDefault().getMetaArea().getLogLocation();
}
public static Plugin getPlugin(String id) {
try {
IPluginRegistry registry = getPluginRegistry();
if (registry == null)
throw new IllegalStateException();
IPluginDescriptor pd = registry.getPluginDescriptor(id);
if (pd == null)
return null;
return pd.getPlugin();
} catch (CoreException e) {
// TODO log the exception
}
return null;
}
public static IPluginRegistry getPluginRegistry() {
Bundle compatibility = InternalPlatform.getDefault().getBundle(CompatibilityHelper.PI_RUNTIME_COMPATIBILITY);
if (compatibility == null)
throw new IllegalStateException(); Class oldInternalPlatform = null;
try {
oldInternalPlatform = compatibility.loadClass("org.eclipse.core.internal.plugins.InternalPlatform"); //$NON-NLS-1$
Method getPluginRegistry = oldInternalPlatform.getMethod("getPluginRegistry", null); //$NON-NLS-1$
return (IPluginRegistry) getPluginRegistry.invoke(oldInternalPlatform, null);
} catch (Exception e) {
//Ignore the exceptions, return null
}
return null; }
public static void removeLogListener(ILogListener listener) {
InternalPlatform.getDefault().removeLogListener(listener);
}
public static IExtensionRegistry getExtensionRegistry() {
return RegistryFactory.getRegistry();
}
public static IPath getStateLocation(Bundle bundle) {
return InternalPlatform.getDefault().getStateLocation(bundle);
}
public static long getStateStamp() {
return InternalPlatform.getDefault().getStateTimeStamp();
}
public static ILog getLog(Bundle bundle) {
return InternalPlatform.getDefault().getLog(bundle);
}
public static ResourceBundle getResourceBundle(Bundle bundle) throws MissingResourceException {
return InternalPlatform.getDefault().getResourceBundle(bundle);
}
public static String getResourceString(Bundle bundle, String value) {
return InternalPlatform.getDefault().getResourceString(bundle, value);
}
public static String getResourceString(Bundle bundle, String value, ResourceBundle resourceBundle) {
return InternalPlatform.getDefault().getResourceString(bundle, value, resourceBundle);
}
public static String getOSArch() {
return InternalPlatform.getDefault().getOSArch();
}
public static String getNL() {
return InternalPlatform.getDefault().getNL();
}
public static String getNLExtensions() {
return InternalPlatform.getDefault().getNLExtensions();
}
public static String getOS() {
return InternalPlatform.getDefault().getOS();
}
public static String getWS() {
return InternalPlatform.getDefault().getWS();
}ring[] getApplicationArgs() {
return InternalPlatform.getDefault().getApplicationArgs();
}
public static PlatformAdmin getPlatformAdmin() {
return InternalPlatform.getDefault().getPlatformAdmin();
}
public static Location getInstanceLocation() {
return InternalPlatform.getDefault().getInstanceLocation();
}
public static IBundleGroupProvider[] getBundleGroupProviders() {
return InternalPlatform.getDefault().getBundleGroupProviders();
}tic IPreferencesService getPreferencesService() {
return InternalPlatform.getDefault().getPreferencesService();
}
public static IProduct getProduct() {
return InternalPlatform.getDefault().getProduct();
}
public static void registerBundleGroupProvider(IBundleGroupProvider provider) {
InternalPlatform.getDefault().registerBundleGroupProvider(provider);
}
public static void unregisterBundleGroupProvider(IBundleGroupProvider provider) {
InternalPlatform.getDefault().unregisterBundleGroupProvider(provider);
}
public static Location getConfigurationLocation() {
return InternalPlatform.getDefault().getConfigurationLocation();
}
public static Location getUserLocation() {
return InternalPlatform.getDefault().getUserLocation();
}
public static Location getInstallLocation() {
return InternalPlatform.getDefault().getInstallLocation();
}
public static boolean isFragment(Bundle bundle) {
return InternalPlatform.getDefault().isFragment(bundle);
}
public static Bundle[] getFragments(Bundle bundle) {
return InternalPlatform.getDefault().getFragments(bundle);
}
public static Bundle getBundle(String symbolicName) {
return InternalPlatform.getDefault().getBundle(symbolicName);
}
public static Bundle[] getBundles(String symbolicName, String version) {
return InternalPlatform.getDefault().getBundles(symbolicName, version);
}
public static Bundle[] getHosts(Bundle bundle) {
return InternalPlatform.getDefault().getHosts(bundle);
}
public static boolean isRunning() {
return InternalPlatform.getDefault().isRunning();
}
public static String[] knownOSArchValues() {
return InternalPlatform.getDefault().knownOSArchValues();
}
public static String[] knownOSValues() {
return InternalPlatform.getDefault().knownOSValues();
}
public static Map knownPlatformLineSeparators() {
Map result = new HashMap();
result.put(LINE_SEPARATOR_KEY_MAC_OS_9, LINE_SEPARATOR_VALUE_CR);
result.put(LINE_SEPARATOR_KEY_UNIX, LINE_SEPARATOR_VALUE_LF);
result.put(LINE_SEPARATOR_KEY_WINDOWS, LINE_SEPARATOR_VALUE_CRLF);
return result;
}
public static String[] knownWSValues() {
return InternalPlatform.getDefault().knownWSValues();
}
public static boolean inDebugMode() {
return PlatformActivator.getContext().getProperty("osgi.debug") != null; //$NON-NLS-1$
}
public static boolean inDevelopmentMode() {
return PlatformActivator.getContext().getProperty("osgi.dev") != null; //$NON-NLS-1$
}
}- ResourcesPlugin
public final class ResourcesPlugin extends Plugin {
public static final String PT_NATURES = "natures";
public static final String PT_MARKERS = "markers";
public static final String PT_FILE_MODIFICATION_VALIDATOR = "fileModificationValidator"; //$NON-NLS-1$
public static final String PT_MOVE_DELETE_HOOK = "moveDeleteHook"; //$NON-NLS-1$
public static final String PT_TEAM_HOOK = "teamHook"; //$NON-NLS-1$
public static final String PT_REFRESH_PROVIDERS = "refreshProviders"; //$NON-NLS-1$
...........
public static final String PREF_ENCODING = "encoding"; //$NON-NLS-1$
public static final String PREF_APPLY_FILE_STATE_POLICY = PREF_DESCRIPTION_PREFIX + "applyfilestatepolicy"; //$NON-NLS-1$ private static Workspace workspace = null;
private ServiceRegistration<IWorkspace> workspaceRegistration;
public ResourcesPlugin() {
plugin = this;
}
private static void constructWorkspace() throws CoreException {
new LocalMetaArea().createMetaArea();
}
public static String getEncoding() {
String enc = getPlugin().getPluginPreferences().getString(PREF_ENCODING);
if (enc == null || enc.length() == 0) {
enc = System.getProperty("file.encoding"); //$NON-NLS-1$
}
return enc;
}
public static IWorkspace getWorkspace() {
if (workspace == null)
throw new IllegalStateException(Messages.resources_workspaceClosed);
return workspace;
}
public void stop(BundleContext context) throws Exception {
super.stop(context);
if (workspace == null)
return;
workspaceRegistration.unregister();
// save the preferences for this plug-in
getPlugin().savePluginPreferences();
workspace.close(null); // Forget workspace only if successfully closed, to
// make it easier to debug cases where close() is failing.
workspace = null;
workspaceRegistration = null;
}
public void start(BundleContext context) throws Exception {
super.start(context);
if (!new LocalMetaArea().hasSavedWorkspace()) {
constructWorkspace();
}
Workspace.DEBUG = ResourcesPlugin.getPlugin().isDebugging();
// Remember workspace before opening, to
// make it easier to debug cases where open() is failing.
workspace = new Workspace();
PlatformURLResourceConnection.startup(workspace.getRoot().getLocation());
initializePreferenceLookupOrder();
IStatus result = workspace.open(null);
if (!result.isOK())
getLog().log(result);
workspaceRegistration = context.registerService(IWorkspace.class, workspace, null);
}
private void initializePreferenceLookupOrder() {
PreferencesService service = PreferencesService.getDefault();
String[] original = service.getDefaultDefaultLookupOrder();
List<String> newOrder = new ArrayList<String>();
// put the project scope first on the list
newOrder.add(ProjectScope.SCOPE);
for (String entry : original)
newOrder.add(entry);
service.setDefaultDefaultLookupOrder(newOrder.toArray(new String[newOrder.size()]));
}
}- IWorkspace
public interface IWorkspace extends IAdaptable {
public static final int AVOID_UPDATE = 1;
public static final Object VALIDATE_PROMPT = FileModificationValidationContext.VALIDATE_PROMPT;
public static final String SERVICE_NAME = IWorkspace.class.getName();
public void addResourceChangeListener(IResourceChangeListener listener);
public void addResourceChangeListener(IResourceChangeListener listener, int eventMask);
public ISavedState addSaveParticipant(Plugin plugin, ISaveParticipant participant) throws CoreException;
public ISavedState addSaveParticipant(String pluginId, ISaveParticipant participant) throws CoreException;
public void build(int kind, IProgressMonitor monitor) throws CoreException;
public void build(IBuildConfiguration[] buildConfigs, int kind, boolean buildReferences, IProgressMonitor monitor) throws CoreException;
public void checkpoint(boolean build);
public IProject[][] computePrerequisiteOrder(IProject[] projects);
public final class ProjectOrder {
public ProjectOrder(IProject[] projects, boolean hasCycles, IProject[][] knots) {
this.projects = projects;
this.hasCycles = hasCycles;
this.knots = knots;
}
public IProject[] projects;
public boolean hasCycles;
public IProject[][] knots;
}
public ProjectOrder computeProjectOrder(IProject[] projects);
public IStatus copy(IResource[] resources, IPath destination, boolean force, IProgressMonitor monitor) throws CoreException;
public IStatus copy(IResource[] resources, IPath destination, int updateFlags, IProgressMonitor monitor) throws CoreException;
public IStatus delete(IResource[] resources, boolean force, IProgressMonitor monitor) throws CoreException;
public IStatus delete(IResource[] resources, int updateFlags, IProgressMonitor monitor) throws CoreException;
public void deleteMarkers(IMarker[] markers) throws CoreException;
public void forgetSavedTree(String pluginId);
public IFilterMatcherDescriptor[] getFilterMatcherDescriptors();
public IFilterMatcherDescriptor getFilterMatcherDescriptor(String filterMatcherId);
public IProjectNatureDescriptor[] getNatureDescriptors();
public IProjectNatureDescriptor getNatureDescriptor(String natureId);
public Map<IProject,IProject[]> getDanglingReferences();
public IWorkspaceDescription getDescription();
public IWorkspaceRoot getRoot();
public IResourceRuleFactory getRuleFactory();
public ISynchronizer getSynchronizer();
public boolean isAutoBuilding();
public boolean isTreeLocked();
public IProjectDescription loadProjectDescription(IPath projectDescriptionFile) throws CoreException;
public IProjectDescription loadProjectDescription(InputStream projectDescriptionFile) throws CoreException;
public IStatus move(IResource[] resources, IPath destination, boolean force, IProgressMonitor monitor) throws CoreException;
public IStatus move(IResource[] resources, IPath destination, int updateFlags, IProgressMonitor monitor) throws CoreException;
public IBuildConfiguration newBuildConfig(String projectName, String configName);
public IProjectDescription newProjectDescription(String projectName);
public void removeResourceChangeListener(IResourceChangeListener listener);
public void removeSaveParticipant(Plugin plugin);
public void removeSaveParticipant(String pluginId);
public void run(IWorkspaceRunnable action, ISchedulingRule rule, int flags, IProgressMonitor monitor) throws CoreException;
public void run(IWorkspaceRunnable action, IProgressMonitor monitor) throws CoreException;
public IStatus save(boolean full, IProgressMonitor monitor) throws CoreException;
public void setDescription(IWorkspaceDescription description) throws CoreException;
public void setWorkspaceLock(WorkspaceLock lock);
public String[] sortNatureSet(String[] natureIds);
public IStatus validateEdit(IFile[] files, Object context);
public IStatus validateFiltered(IResource resource);
public IStatus validateLinkLocation(IResource resource, IPath location);
public IStatus validateLinkLocationURI(IResource resource, URI location);
public IStatus validateName(String segment, int typeMask);
public IStatus validateNatureSet(String[] natureIds);
public IStatus validatePath(String path, int typeMask);
public IStatus validateProjectLocation(IProject project, IPath location);
public IStatus validateProjectLocationURI(IProject project, URI location);
public IPathVariableManager getPathVariableManager();
}- fsdg
Eclipse Common API的更多相关文章
- Atitit org.eclipse.jdt 的ast 架构 Eclipse JDT API spec
Atitit org.eclipse.jdt 的ast 架构 Eclipse JDT API spec 继承树1 Expression的子类1 获取子类2 继承树 Astnode>express ...
- atitit.eclipse有多少api 扩展点,以及扩展点的设计
atitit.eclipse有多少api 扩展点,以及扩展点的设计 不赞成使用的.作废的以及内部的扩展点 [扩展]页显示了几个你不应该在你的插件中使用的扩展点.在附表C.1的[描述]栏中,我们使用如 ...
- atitit.eclipse有多少api  扩展点,以及扩展点的设计
atitit.eclipse有多少api 扩展点,以及扩展点的设计 不赞成使用的.作废的以及内部的扩展点 [扩展]页显示了几个你不应该在你的插件中使用的扩展点.在附表C.1的[描写叙述]栏中.我们使 ...
- Eclipse 修改API
真机调试时报错,提示application api 21,device api 10 Automatic Target Mode: Unable to detect device compatibil ...
- 设置Eclipse中文API提示信息
准备工作:下载中文API到本机:http://download.java.net/jdk/jdk-api-localizations/jdk-api-zh-cn/publish/1.6.0/html_ ...
- 在eclipse中API的封装和调用
自己写的API的封装和调用:1.写好api的方法的实现类.2.抽取一个javadoc文档.file->Export->java->javadoc->finish->Yes ...
- 本地eclipse java api连接远程虚拟机HBase
1.本地与远程连通 无论是域名或者ip都可以,另外需保证HBase在虚拟机集群上正常运行. 2.本地要有一个跟远程相同的hadoop环境 当然不相同,只要兼容也可以,现采用hadoop-2.5.0-c ...
- 【异常】org.eclipse.jgit.api.errors.TransportException: git@xxx.xxx.xxx/base-config-center.git: channel is not opened.
一.异常原因 连不上git仓库,可能原因有: 1.)git仓库不存在 2)连接git仓库超时 二.对应的解决办法 1) 创建对应仓库 2) 2.1 换个服务性能更好的部署gitlab 2.2 可以研究 ...
- 如何使用Eclipse API 提供 org.eclipse.wst.wsdl 要解决阅读WSDL档?
相对而言.Eclipse API中国的数据是比较小的.但Eclipse的API提供了许多的.非常强大. 实例,eclipse的Eclipse API 提供 org.eclipse.wst.wsdl包裹 ...
随机推荐
- TX2 自制底板不识别USB
目的:解决自制的底板无法识别USB,使能3个UART接口,使能3个SPI接口. Jetpack版本:Jetpack-3.1 虚拟机:ubuntu14.04 使用dtb文件夹下的文件替换刷机包../64 ...
- 关于 FPDF、HTML2PDF里的中文、日文、韩文等双字节字符换行问题
最近使用 FPDF.HTML2PDF导出中文PDF,发现表格里的数据不会自动换行,格式乱了,看了一下手册,有个 functionCell()可以设置换行,但是设置了半天也没反应!最后搞了一个笨办法完美 ...
- Linux之旅
如今 linux 随着云服务的狂扫全球之势,对吾等准开发人员而言也不可继续视而不见了,硬着头皮调用情绪开始 Linux 之旅. 一.主机准备 既然 Linux,必然和日常工作的环境产生了“冲突”,经过 ...
- 怎样把ppt格式文件放到网页上?
方法一:把ppt文件的扩展名直接修改为pps,嵌入到网页中嵌入代码:缺点:这种方式浏览器会提示是打开,还是下载,选择打开的话会直接在浏览器中打开,并且客户端一定要安装Office PowerPoint ...
- 用淘宝镜像安装electron的方法
在网友那里看到的,命令如下,亲测安装electron 1.7.9 成功,关键是几秒钟就搞定了.今天是 11 Dec 2017. ELECTRON_MIRROR=http://npm.taobao.or ...
- 【总结】MYSQL注入
关于MYSQL注入的总结,网上的资料很多,这里和大家简单分享下自己实战中常用的思路和命令 0x00 UNION联合查询型注入常用语句 order by n //定字段,n为正整数 union se ...
- PHP房贷计算器代码,等额本息,等额本金
debx(); function debx() { $dkm = 240; //贷款月数,20年就是240个月 $dkTotal = 10000; //贷款总额 $dknl = 0.0515; //贷 ...
- PIE SDK地图平移校正
地图平移校正,当加载两幅空间参考一样的影像,其中一幅影像有点偏移,这时就以另一幅影像为基准将其进行平移校正,然后保存,再次加载就不会出现偏移了. 下面来介绍下实现的主要代码: 首先通过选中目录树中的要 ...
- vue 权限管理深度探究
实现思路如下:1.网页路由(route)中定义的每个路由都有meta属性,属性值防止可访问该路由的值.2.路由的全局前置守卫(beforeEach)会判断路由用户是否登录(未登录跳转至登录界面),以及 ...
- os.popen('python hello_out.py')中Python程序执行时默认的当前路径为MS-DOS CMD的默认路径
>>> import os >>> os.getcwd() 'D:\\pythonCode\\pp4e' >>> os.chdir('Stream ...