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包裹 ...
随机推荐
- ssh 远程登录TX2
TX2 端SSH操作 安装: sudo apt-get install openssh-server 确认sshserver是否启动: ps -e |grep ssh 如果看到sshd那说明ssh-s ...
- mysql 5.7.22 解压缩安装
1.下载地址:https://dev.mysql.com/downloads/mysql/5.7.html#downloads 直接点击下载项 下载后: 2.可以把解压的内容随便放到一个目录,我的是如 ...
- requirejs重点
1.shim:用于配置不是通过define函数包装的文件,导出什么东西,如果这个文件不再baseURL目录下的话,需要在paths中配置文件目录.并且paths中的键名.shim中的键名.requir ...
- Largest Submatrix of All 1’s(思维+单调栈)
Given a m-by-n (0,1)-matrix, of all its submatrices of all 1's which is the largest? By largest we m ...
- 关于Ehcache缓存中timeToLiveSeconds和timeToIdleSeconds
[From] http://blog.csdn.net/vtopqx/article/details/8522333 闲来无事测试了下Ehcache与MemCache比较,在此发现了Ehcache中一 ...
- Q205 同构字符串
给定两个字符串 s 和 t,判断它们是否是同构的. 如果 s 中的字符可以被替换得到 t ,那么这两个字符串是同构的. 所有出现的字符都必须用另一个字符替换,同时保留字符的顺序.两个字符不能映射到同一 ...
- 转 LIST INCARNATION OF DATABASE
incarnation在英文中是“化身”的意思. 那么在oracle中,它又是什么意思呢?有什么作用呢? 我们看一些基本概念 Current Incarnation(当前化身):数据库当前正在使用的化 ...
- 转帖 JS的基础语法2
条件语句(if.switch). 循环语句(while.do…while. for … in).跳转语句(break,continue) 1.条件语句 Ø if语句 javascrip中的if语句 v ...
- nyoj 983 ——首尾相连数组的最大子数组和——————【最大子串和变形】
首尾相连数组的最大子数组和 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 给定一个由N个整数元素组成的数组arr,数组中有正数也有负数,这个数组不是一般的数组,其首 ...
- SpringBoot | 第三十章:Spring-data-jpa的集成和使用
前言 在前面的第九章:Mybatis-plus的集成和使用章节中,介绍了使用ORM框架mybatis-plus进行数据库的访问.今天,我们来简单学习下如何使用spring-data-jpa进行数据库的 ...