定制Eclipse IDE之功能篇(二)

ResourcesPlugin.getPlugin().getPluginPreferences().setValue("encoding", "UTF-8");
二、默认显示行号
.png)
EditorsPlugin.getDefault().getPreferenceStore().setValue("lineNumberRuler", "true");
.png)
Combo combo = (Combo)control;
combo.removeAll();
for (int i = 0; i < list.size(); i++) {
DeviceInfo obj=list.get(i);
combo.add(obj.getName()); //label
combo.setData(i +"", obj.getSerialNumber()); //value
}
String key = "" + comboDevice.getSelectionIndex();
String value= String.valueOf(comboDevice.getData(key));
PrintWriter pw = new PrintWriter(new FileWriter(filePath));
pw.print(content);
pw.close();
OutputStreamWriter outputStream = new OutputStreamWriter(new FileOutputStream(filePath), "UTF-8");
outputStream.write(content);
outputStream.close();
import java.io.PrintStream;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleFactory;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream; public class ConsoleFactory implements IConsoleFactory { static MessageConsole console = new MessageConsole("console log",null); public void openConsole() {
showConsole();
} public static void showConsole() {
if (console != null) {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] existing = manager.getConsoles();
boolean exists = false;
for (int i = 0; i < existing.length; i++) {
if (console == existing[i])
exists = true;
}
if (!exists) {
manager.addConsoles(new IConsole[] { console });
}
manager.showConsoleView(console); MessageConsoleStream stream = console.newMessageStream();
System.setOut(new PrintStream(stream));
}
} public static void closeConsole() {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
if (console != null) {
manager.removeConsoles(new IConsole[] { console });
}
} public static MessageConsole getConsole() {
return console;
}
}

.png)
UIJob jobH = new UIJob("hide quick access") {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IWorkbenchWindow window = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow();
if (window == null)
return Status.CANCEL_STATUS;
if (window instanceof WorkbenchWindow) {
MTrimBar topTrim = ((WorkbenchWindow) window).getTopTrim();
for (MTrimElement element : topTrim.getChildren()) {
if ("SearchField".equals(element.getElementId())) {
Control contorl = (Control) element.getWidget();
contorl.setVisible(false);
break;
}
}
}
return Status.OK_STATUS;
}
};
jobH.schedule(0L);

.png)
.png)

本文地址 :http://www.cnblogs.com/lovesong/p/4694522.html
定制Eclipse IDE之功能篇(二)的更多相关文章
- 定制Eclipse IDE之功能篇(一)
上文回顾:定制Eclipse IDE之界面篇 这一篇文章将记录一些Eclipse插件拓展(extension),简单讲述常用拓展的用法,但可能不会那么详细. 我的主要插件的拓展如下: 一.or ...
- 定制Eclipse IDE之插件篇(一)
上文回顾:定制Eclipse IDE之功能篇(二) 在这篇文章中,我会将我定制eclipse用到的其他插件罗列出来. 一.汉化插件 Eclipse本身是英文显示的,我们能够通过插件汉化. 1. 选择 ...
- 定制Eclipse IDE之插件篇(二)
上文回顾:定制Eclipse IDE之插件篇(一) 延续上一篇的插件篇,这一篇将会讲到一个最关键的插件aptana. 一.aptana插件 官方的解释我就不说了,从下面图可以看到插件提供了什么功能,列 ...
- 定制Eclipse IDE之杂症篇
上文回顾:定制Eclipse IDE之插件篇(二) 该篇将讲述在开发Eclipse 插件过程发生的疑难杂症.不谈功能,只说病症. 前言.拿哪个Eclipse作为定制的基础? 我建议是你用哪个Eclip ...
- 定制Eclipse IDE之界面篇
为什么要定制IDE? 在工作时候,当公司有了自己的框架,给自己开放人员用,甚至是可以卖的时候,我们可以做成一个产品,而这个产品将包括框架本身.文档.工具.教程等等.工具之中最重要的莫过于开发 ...
- 使用Eclipse Memory Analyzer Tool(MAT)分析线上故障(一) - 视图&功能篇
Eclipse Memory Analyzer Tool(MAT)相关文章目录: 使用Eclipse Memory Analyzer Tool(MAT)分析线上故障(一) - 视图&功能篇 使 ...
- Maven、gradle、Ant、Eclipse IDE
Maven.gradle.Ant.Eclipse IDE之间的关系 http://wenku.baidu.com/view/d33208810912a21615792910.html?from=sea ...
- Eclipse IDE for C/C++ Developers安装配置详解
Eclipse IDE for C/C++ Developers安装配置详解(转) 转自:http://hi.baidu.com/ltb6w/item/986532efd712460f570f1ddc ...
- eclipse ide for java ee developers 开发环境搭建(j2ee)
转载自:http://www.iteye.com/topic/982182 真的是一片很不错的文章啊! 使用eclipse真的有年头了,相信java程序员没有不知道它的,最近在给团队中新来的应届生做指 ...
随机推荐
- 设置让TortoiseGit记住账号和密码
方法一:在"C:\Documents and Settings\Administrator\.gitconfig" 文件 或 "项目/.git/config"文 ...
- Unity 3D制作2D游戏的几种方法
1.使用本身UGUI. 2.把摄像机的投影改为正交投影,不考虑Z轴. 3.使用Untiy自身的2D模式. 4.使用2D TooKit插件.
- 网络通信之Socket与LocalSocket的比较
Socket与LocalSocket都可以实现网络通信,两个有什么区别呢? LocalSocket其通信方式与Socket差不多,只是LocalSocket没有跨越网络边界. 于是,思考到一个问题:a ...
- web框架--bottle
安装 2 3 4 pip install bottle easy_install bottle apt-get install python-bottle wget http://bottlepy.o ...
- Javascript编程风格
Douglas Crockford是Javascript权威,Json格式就是他的发明. 去年11月他有一个演讲(Youtube),谈到了好的Javascript编程风格是什么.我非常推荐这个演讲,它 ...
- CompressHelper
public static string CompressString(string unCompressedString) { byte[] bytData = System.Text.Encodi ...
- Android Studio导入项目非常慢的解决办法
问题 Android Studio目前已经更新到2.0 Preview 6了,作为Google大力推崇的开发工具,相对于Eclipse ADT有着不可比拟的优势.然而在实际使用时,依然有不少不爽的地方 ...
- Node.js系列基础学习-----回调函数,异步
Node.js基础学习 Node.js回调函数 Node.js异步编程的直接体现就是回调,异步编程依托回调来实现,但不是异步.回调函数在完成任务后就会被调用,Node有很多的回调函数,其所有的API都 ...
- 【原创】Kakfa utils源代码分析(一)
Kafka.utils,顾名思义,就是一个工具套件包,里面的类封装了很多常见的功能实现——说到这里,笔者有一个感触:当初为了阅读Kafka源代码而学习了Scala语言,本以为Kafka的实现会用到很多 ...
- Json字符串反序列化
using DevComponents.DotNetBar; using MyControl; using Newtonsoft.Json; using System; using System.Co ...