惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
月光博客
月光博客
V
Visual Studio Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Recorded Future
Recorded Future
C
Check Point Blog
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
F
Full Disclosure
The Cloudflare Blog
Y
Y Combinator Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
AI
AI
N
News and Events Feed by Topic
T
Tor Project blog
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

博客园 - Android,服务端,移动互联网

每周感悟【2013年7月28日】 每周感悟【2013年7月21日】 Android客户端打包方案分享 转载:Endianness一点通 xmlBeans problem (From xmlBeans FAQ) 转载:JavaSE的线程synchronized关键字的用法 解决 java.lang.NoClassDefFoundError: org /apache/xmlbeans/XmlException 转载:写得蛮好的linux学习笔记 GMF中定制自己的outline 获取EObject对象的反向引用对象 转载两篇文章之二(从程序员到CTO所要培养的六种能力)作者:阿蒙 原文:http://blog.csdn.net/harrymeng/archive/2007/02/07/1503931.aspx 转载两篇文章之一(35 岁前程序员要规划好的四件事)原文:http://blog.csdn.net/oiio/archive/2007/02/12/1508001.aspx Eclipse Modeling Projects覆盖的工业标准 Eclipse中加入自己的菜单项和工具栏项 GMF中控制Figure的大小和位置 在eclipse中获得当前所有打开的editor实例列表 关于EMF模型的操作,赶紧记下来 测试一下Windows live writer How to get projects list in eclipse
关于解决eclipse中的插件依赖
Android,服务端,移动互联网 · 2007-01-10 · via 博客园 - Android,服务端,移动互联网

在eclipse插件开发过程中有时会遇到插件循环依赖的问题,其实本可以避免的,但谁也不能保证当初的设计会有问题。俺就遇到了这个问题,不过有一种解决办法就是通过写扩展点。

比如插件A和插件B,A是项目中所有插件的核心,所有的插件必须依赖于插件A,所有插件都使用A提供的接口和服务。但有时为了降低插件的耦合性,或者保持插件的独立性,一些个性的操作接口,都应该尽量定义在每个插件中,尽量不要定义在A中。比如,在插件B中定义了一个个性wizard,但是A要实例化这个wizard,问什么不在B中直接实例化?唉!不是说了嘛,设计失误,没辙B要使用A中的接口,而A要实例化B中的类,循环了!这可咋办?想来想去,只好在A中写个CoreWizard扩展点,在B中需要A来实例化的wizard只要继承A中的CoreWizard,并且在B中plugin.xml里面实现CoreWizard扩展点,这样A就可以把B中的wizard通过扩展点加载当成自己的CoreWizard来处理。具体实现如下:

A中定义扩展点:

<extension-point id="coreWizards" name="coreWizards" schema="schema/coreWizards.exsd"/>

并实现类CoreWizard.java

public class CoreWizard extends Wizard implements INewWizard{
private String wizardID = null;
@Override
public boolean performFinish() {
// TODO Auto-generated method stub
return false;
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
// TODO Auto-generated method stub
}public String getWizardID() {
return wizardID;
}
public void setWizardID(String wizardID) {
this.wizardID = wizardID;
}

B中实现扩展点:

<extension
point="coreWizards">
<coreWizards
class="com.mytest.wizards.TemplateCreateWizard"
wizardID
="com.mytest.wizards.TemplateCreateWizardID"/>
</extension>

类com.mytest.wizards.TemplateCreateWizard继承了A中的类CoreWizard。

加载扩展点:

public static CoreWizard getCoreWizard() {
        String project 
= "projectA";
        String ID 
= "coreWizards";
        String attr 
= "class";
        String attr1 
= "wizardID";
        String wizardID 
= null;
        String wizardClass 
= null;
        
        IExtensionPoint extPoint 
= Platform.getExtensionRegistry().getExtensionPoint(project, ID);
        IConfigurationElement[] extensions 
= null;
        
        
if (null != extPoint) {
            extensions 
= extPoint.getConfigurationElements();
            
for (int i = 0; i < extensions.length; i++) {
                IConfigurationElement ic 
= extensions[i];
                wizardID 
= ic.getAttribute(attr1);
                wizardClass 
= ic.getAttribute(attr);
                CoreWizard ss 
= null;
                ss 
= (CoreWizard) ic.createExecutableExtension(attr);
                
return ss.getClass().newInstance();    
            }
        }
return null;
 }

通过上面的方法就可以获得CoreWizard的实例,实际上也就是TemplateCreateWizard类的实例。