菜单详解http://www.itpub.net/showthread.php?threadid=1226436
1.给edit里写东西
public void run(IAction action) {
IEditorReference[] editors = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
int length = editors.length;
TextFileDocumentProvider tfdp = null;
FileEditorInput input = null;
System.out.println("editos amount is -->"+length);
for (int i = 0; i < length; ++i){
IEditorPart editor = editors[i].getEditor(false);
input = (FileEditorInput)editor.getEditorInput();
tfdp = ((TextFileDocumentProvider)((ITextEditor)editor).getDocumentProvider());//.connectToXCDE(input);
MessageDialog.openInformation(shell, "Ex", "Test Action was executed.");
String path = input.getFile().getFullPath().toString();
System.out.println("path--------------------->"+path);
IDocument document = tfdp.getDocument(input);
try {
document.replace(2, 6, "zouweizouwei");
} catch (BadLocationException e) {
e.printStackTrace();
}
}
}
2.视图(view)里打开东西
2.1 打开本地的文件,参考了挂eclipse线程的机制
private static void openlocalFiles(IWorkbenchPage page,String filterPath) {
IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(filterPath));
System.out.println("fileStore.getName()===>"+fileStore.getName());
// fileStore = fileStore.getChild(names[i]);
IFileInfo fetchInfo = fileStore.fetchInfo();
if (!fetchInfo.isDirectory() && fetchInfo.exists()) {
//IWorkbenchPage page = window.getActivePage();
try {
IDE.openEditorOnFileStore(page, fileStore);
} catch (PartInitException e) {
String msg = NLS.bind(IDEWorkbenchMessages.OpenLocalFileAction_message_errorOnOpen, fileStore.getName());
IDEWorkbenchPlugin.log(msg,e.getStatus());
MessageDialog.open(MessageDialog.ERROR,new Shell(), IDEWorkbenchMessages.OpenLocalFileAction_title, msg, SWT.SHEET);
}
}
}
2.2 打开工作视图中的文件
IDE.openEditor(page, file);
JD-Eclipse 很好的反编译plugins
一类,已在哪些地方引用?
ctrl+Shift+g
2010.1.14
eclipse 规定display 与其上的控件必需在一个thread上,所以用display.asyncExec(eclipse插件开发笔记 wizards)
如果不同编辑器对应的模型实在是整不一起去还可以用适配器,当模型变化时,编辑器肯定会收到通知,这样就更新编辑器了
2010.1.15
想出一个很好的方法去查看eclipse 的相关功能点:alt+shilf+F1,alt+shilf+F2设断点,然后调试。
newWizard加入一些文件和jar到classpath里已解决。
GMF的一个操作视频
关键字: gmf demo video 视频
视频地址:
http://www.eclipse.org/gmf/tutorial/viewlets/tutorial.html
GMF的mindMap、TaiPan等demo的CVS下载地址:
:pserver:anonymous@dev.eclipse.org:/cvsroot/modeling
-------------------------------------
将应用默认使用XP风格
文章分类:Java编程 关键字: 将应用默认使用xp风格
从http://www.eclipse.org/swt/javaw.exe.manifest这个链接上下载javaw.exe.manifest文件,放在jre下的bin目录里面就OK了
http://msdn.microsoft.com/en-us/library/ms997646.aspx这里有解释
OverrideMethodsAction
刷新文件
IResource res = ResourcesPlugin.getWorkspace().getRoot();
try {
res.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
2010.02.02
eclipse 取图片的几种方法.
1.直接在xml里配
2.Activor里有getImageDescriptor(String path);更好的是通过其写一个缓冲类。
3. URL url = FileLocator.find(Platform.getBundle("org.zte.conn"),
new Path(path), null);
ImageDescriptor contributedImageDescriptor= ImageDescriptor.createFromURL(url);
IFile eclipseFile = ResourcesPlugin.getWorkspace().getRoot().getProject("project").getFile(new Path("folder/file.txt"));
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
图片在树里要从小到大,不然会很不好看,会接伸
new Image(Display.getCurrent(), getClass().getResourceAsStream("/org/zw/bpel/image/remove.gif"))
2010.03.10
public Object execute(ExecutionEvent event) throws ExecutionException {
IStructuredSelection selection = (IStructuredSelection) HandlerUtil
.getActiveMenuSelection(event);
HandlerUtil.getActiveShell(event)
IStructuredSelection selection = (IStructuredSelection) HandlerUtil
.getActiveSite(event).getSelectionProvider().getSelection();
IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IPreferenceStore store = ClassFTPPlugin.getDefault().getPreferenceStore();
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
Object active_part = HandlerUtil.getActivePart(event);
Object editor = HandlerUtil.getActiveEditor(event);
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
Object active_part = HandlerUtil.getActivePart(event);
Object editor = HandlerUtil.getActiveEditor(event);
// Check to see if the command was fired from the Editor..
if(active_part == editor)
{
Object obj = HandlerUtil.getActiveEditor(event).getEditorInput();
if(obj instanceof IFileEditorInput)
{
IFileEditorInput f = (IFileEditorInput) obj;
IFile file= f.getFile();
System.out.println(file.getProjectRelativePath());
IFile[] files = new IFile[]{file};
得到eclipse的版本号
EclipseVersionRetriever.getMajorVersionNumber() >= 3
ve里边很好的dialog
IStructuredSelection selection = (IStructuredSelection) HandlerUtil
.getActiveSite(event).getSelectionProvider().getSelection();
Object obj = selection.getFirstElement();
if(obj instanceof IProject){
ImageDialog image = new ImageDialog(window.getShell(),(IProject)obj);
image.open();}
分享到:
相关推荐
《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》既包含了开发Eclipse插件的基础理论,也涵盖了大量关于Eclipse插件开发的细节。 《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》不仅适用于Eclipse插件...
《Eclipse插件开发》由浅入深、有重点、有针对性地介绍了Eclipse插件开发技术,全书分为4篇共24章。第一篇介绍Eclipse平台界面开发的基础知识,包括SWT控件的使用、界面布局、事件处理等内容;第二篇是插件开发核心...
《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》既包含了开发Eclipse插件的基础理论,也涵盖了大量关于Eclipse插件开发的细节。 《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》不仅适用于Eclipse插件...
它对Eclipse插件开发进行了全程详细指导,内容不仅包括Eclipse使用入门、Eclipse基础结构、SWT、JFace、操作、视图、透视图、标记、性质、构建器等插件开发必备知识,还介绍了实现帮助系统、国际化、创建扩展点、...
本书是一本由两位长期从事Java商业...本书既包含了开发Eclipse插件的基础理论,也涵盖了大量关于Eclipse插件开发的细节。 本书不仅适用于Eclipse插件开发的初学者,对于Eclipse商业软件开发人员也有很高的参考价值。
《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》既包含了开发Eclipse插件的基础理论,也涵盖了大量关于Eclipse插件开发的细节。 《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》不仅适用于Eclipse插件...
《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》既包含了开发Eclipse插件的基础理论,也涵盖了大量关于Eclipse插件开发的细节。 《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》不仅适用于Eclipse插件...
9.4 使用插件开发环境...... 227 9.4.1 PDE视图和编辑器..... 227 9.4.2 管理运行时环境和开发环境..... 230 9.4.3 创建并运行插件..... 231 9.5 练习概述...... 232 9.6 本章小结...... 233 9.7 参考文献...... ...
01第一篇 开发基础(封面).pdf ... 12 第9章 Eclipse插件体系结构.pdf 13 第10章 开发第一个插件项目.pdf 14 第11章 操作(Actions).pdf 15 第12章 视图(views).pdf 16 第13章 编辑器(Editors).pdf
更难能可贵的是,Eclipse是一个开放源代码的项目,任何人都可以下载Eclipse的源代码,并且在此基础上开发自己的功能插件。也就是说未来只要有人需要,就会有建立在Eclipse之上的COBOL,Perl,Python等语言的开发插件...
“插件开发篇”介绍了Eclipse插件开发的各个步骤,并给出了一个基于数据库开发和面向对象分析设计的完整插件实例;“Web开发篇”以Tomcat+Lomboz+Hibernate为开发环境,详述了其下载、安装、配置和开发的全过程。 ...
“插件开发篇”介绍了Eclipse插件开发的各个步骤,并给出了一个基于数据库开发和面向对象分析设计的完整插件实例;“Web开发篇”以Tomcat+Lomboz+Hibernate为开发环境,详述了其下载、安装、配置和开发的全过程。 ...
“插件开发篇”介绍了Eclipse插件开发的各个步骤,并给出了一个基于数据库开发和面向对象分析设计的完整插件实例;“Web开发篇”以Tomcat+Lomboz+Hibernate为开发环境,详述了其下载、安装、配置和开发的全过程。 ...
“插件开发篇”介绍了Eclipse插件开发的各个步骤,并给出了一个基于数据库开发和面向对象分析设计的完整插件实例;“Web开发篇”以Tomcat+Lomboz+Hibernate为开发环境,详述了其下载、安装、配置和开发的全过程。 ...
9.4 使用插件开发环境...... 227 9.4.1 PDE视图和编辑器..... 227 9.4.2 管理运行时环境和开发环境..... 230 9.4.3 创建并运行插件..... 231 9.5 练习概述...... 232 9.6 本章小结...... 233 9.7 ...
“插件开发篇”介绍了eclipse插件开发的各个步骤,并给出了一个基于数据库开发和面向对象分析设计的完整插件实例;“web开发篇”以tomcat+lomboz+struts+hibernate为开发环境,详述了其下载、安装、配置和开发的全...
插件开发篇详细讲解了Eclipse插件开发的各个步骤;RCP开发篇给出了一个基于数据库开发和面向对象分析设计的完整RCP项目实例;[1] Hibernate为开发环境,详述了其下载、安装、配置和开发的全过程。本书以SWT/JFace、...
9.4 使用插件开发环境...... 227 9.4.1 PDE视图和编辑器..... 227 9.4.2 管理运行时环境和开发环境..... 230 9.4.3 创建并运行插件..... 231 9.5 练习概述...... 232 9.6 本章小结...... 233 9.7 ...
“插件开发篇”介绍了Eclipse插件开发的各个步骤,并给出了一个基于数据库开发和面向对象分析设计的完整插件实例;“Web开发篇”以Tomcat+Lomboz+Struts+Hibernate为开发环境,详述了其下载、安装、配置和开发的全...
“插件开发篇”介绍了Eclipse插件开发的各个步骤,并给出了一个基于数据库开发和面向对象分析设计的完整插件实例;“Web开发篇”以Tomcat+Lomboz+Struts+Hibernate为开发环境,详述了其下载、安装、配置和开发的全...