eclipse RCP
通過RCP創建的view,怎樣直接顯示出來
摘要: 新創建的VIEW已經加到透視圖中,但是打開程序時就是不顯示相應的視圖.
解決方法:
原來是設置了這個導致的
configurer.setSaveAndRestore(true);
閱讀全文
posted @
2012-06-08 11:25 Ke 閱讀(2416) |
評論 (4) 編輯
RCP開發---Log4j配置
摘要: 在啟動RCP的插件中的start方法里:
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
Properties prop = new Properties();
try {
prop.load(Activator.class.getResourceAsStream("log4j.properties")); //$NON-NLS-1$
} catch (IOException e) {
// e.printStackTrace();
}
PropertyConfigurator.configure(prop);
}
閱讀全文
posted @
2012-04-28 17:56 Ke 閱讀(970) |
評論 (0) 編輯
SWT的SHELL樣式
摘要: SWT.BORDER //建立一個有邊框但沒有標題欄的窗口
SWT.CLOSE //建立一個只有關閉按鈕的窗口
SWT.MIN //建立一個不能最大化的窗口
SWT.MAX, //建立一個可以最大化最小化的窗口
SWT.NO_TRIM //建立一個沒有任何邊界和標題欄的窗口
SWT.RESIZE //建立一個可以改變大小的窗口
SWT.TITLE //建立一個沒有標題欄圖標,沒有關閉按鈕的窗口
SWT.ON_TOP //建立一個總是在上的窗口,注意:此屬性最好與CLOSE、MIN、MAX一起使用。
SWT.TOOL //建立一個類似工具欄的窗口
SWT.APPLICATION_MODAL //建立一個APPLICATION模態窗口
閱讀全文
posted @
2010-07-16 15:26 Ke 閱讀(6874) |
評論 (4) 編輯
透視圖的標簽改成波浪形
摘要: PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.DOCK_PERSPECTIVE_BAR, IWorkbenchPreferenceConstants.TOP_RIGHT);
PlatformUI.getPreferenceStore().setDefault(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false);
閱讀全文
posted @
2009-07-28 09:39 Ke 閱讀(336) |
評論 (0) 編輯
解決在eclipse項目中使用utf-8字符時導出錯誤
摘要: 在eclipse項目中使用utf-8字符可能會造成導出時產生錯誤,程序不能正常運行
我以前網上找到的辦法都不好,解決的辦法其實十分簡單
在build.properties文件中加入
javacDefaultEncoding.. = UTF-8
閱讀全文
posted @
2009-07-28 09:17 Ke 閱讀(513) |
評論 (0) 編輯
往Eclipse RCP視圖中添加右鍵彈出菜單(轉)
摘要: 一個TreeViewer 必須繼承ViewPart方法,并且重寫其中的createPartControl(Composite parent)類
閱讀全文
posted @
2009-07-27 13:50 Ke 閱讀(2265) |
評論 (0) 編輯
其它線程訪問UI線程
摘要: Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
... ...
}
});
閱讀全文
posted @
2009-07-16 11:52 Ke 閱讀(234) |
評論 (0) 編輯
Eclipse切換界面顯示的語言
摘要: -nl "zh_CN" 簡體中文
-nl "zh_TW" 繁體中文
-nl "en_US" 英文
閱讀全文
posted @
2009-06-20 14:42 Ke 閱讀(1646) |
評論 (0) 編輯
rcp添加jar文件
摘要: 1.把jar文件放到項目目錄下 2.在plugin.xml中,runtime頁面,class-path節中,點add,選擇剛才的jar包
閱讀全文
posted @
2009-04-30 09:52 Ke 閱讀(324) |
評論 (0) 編輯
窗口居中顯示代碼
摘要: //窗口居中
Shell shell = getWindowConfigurer().getWindow().getShell();
Rectangle screenSize = Display.getDefault().getClientArea();
Rectangle frameSize = shell.getBounds();
shell.setLocation((screenSize.width - frameSize.width)/2, (screenSize.height - frameSize.height)/2);
閱讀全文
posted @
2008-12-05 23:40 Ke 閱讀(388) |
評論 (0) 編輯