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包裹 ...
随机推荐
- 网页footer背景(stick footer布局)
今天遇到了一个有意思的问题,想在网站的foot里面加入一张背景图片,并且在footer的底部写下一些内容于是乎在footer添加了background,并设置了footer的大小 先说一下开始的做法: ...
- css3中的display:-webkit-box的用法
一. css weui-media-box__desc { color: #999999; font-size: 13px; line-height: 1.2; overflow: hidden; t ...
- Flask 知识点
flask run时候端口占用的问题 终端 lsof -i:5000 kill <端口号> 强制删除 kill -s 9 <端口号> 给网页标题添加icon {% block ...
- Flask (五) RESTful API
RESTful API 什么是REST 一种软件架构风格.设计风格.而不是标准,只是提供了一组设计原则和约束条件.它主要用户客户端和服务器交互类的软件.基于这个风格设计的软件可以更简洁,更有层次,更易 ...
- mfix mpi并行死锁问题探究
目前还没找到具体原因,只能先记录一下.(问题原因找到了) 分别用ubuntu14.04和ubuntu16.04测试,用的是笔记本,笔记本为双核四线程,用2线程并行计算:发现ubuntu16.04会在0 ...
- opencv基本操作
src.convertTo(dst, type, scale, shift) 缩放并转换到另外一种数据类型: dst:目的矩阵 type:需要的输出矩阵类型,或者更明确的,是输出矩阵的深度,如果是负值 ...
- C++ 构造函数与默认构造函数
构造函数:C++用于构建类的新对象时需要调用的函数,该函数无返回类型!(注意:是“无”! 不是空!(void)). 默认构造函数:未提供显式初始值时,用来穿件对象的构造函数. 以上是二者的定义,但是单 ...
- C# 一些请求的基类(待补充)
using System.Runtime.Serialization; /// <summary> /// 通用分页请求类 /// </summary> [DataContra ...
- PIXI AnimatedSprite 及打字爆炸动画(5)
效果 : 消除字母 当前位置出现爆炸效果 这里使用到了AnimatedSprite 动画 Members An AnimatedSprite is a simple way to display a ...
- RedisClient 连接redis 提示 ERR Client sent AUTH, but no password is set