锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
http://liugang594.javaeye.com/category/24822
http://wokanxing.info/2007/05/undo-support-in-rcp/(user:eagle00001)
涓銆丒clipse Product瀵煎嚭浜у搧鍙戠敓涓枃涔辯爜瑙e喅鏂規硶錛?br /> 鍦╞uild.properties鏂囦歡涓姞涓?#8220;javacDefaultEncoding..=UTF-8”銆?/p>
浜屻佽rcp寮鍙戠殑浜у搧鎴栨彃浠跺湪姣忔鍚姩紼嬪簭鏃朵繚鎸佹渶鍚庨鍑虹姸鎬侊紝濡備綍瀹炵幇?
鍦ˋpplicationWorkbenchAdvisor.class綾諱腑閲嶆瀯
public void initialize(IWorkbenchConfigurer configurer) {
...
//浠ヤ笅鏄柊澧炰唬鐮?br />
//鏄惁淇濆瓨鏈鍚庣▼搴忕獥鍙g姸鎬?br />
configurer.setSaveAndRestore(true);
...
}
涓夈丒clispe Application鏍峰紡璁劇疆(鍨冨溇鍥炴敹鍣ㄦ樉紺恒佺壒鏁堟晥鏋溿乼ab欏甸潰嫻佺嚎鏄劇ず)?
鍦ˋpplicationWorkbenchAdvisor涓坊鍔?/p>
public void initialize(IWorkbenchConfigurer configurer) {
IPreferenceStore preStore = PlatformUI.getPreferenceStore();
//鏄劇ず鐗規晥
//preStore.setDefault(IWorkbenchPreferenceConstants.ENABLE_ANIMATIONS, true);
//涓嶆樉紺轟紶緇焧ab鏍峰紡
preStore.setDefault(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false);
//鍦ㄧ姸鎬佹爮鏄惁鏄劇ず鍨冨溇鍥炴敹鍣ㄥ姛鑳?br />
preStore.setDefault(IWorkbenchPreferenceConstants.SHOW_MEMORY_MONITOR, true);
}
鍥涖?涓篈ction娣誨姞Command鍛戒護銆佸湪Command鍛戒護binding蹇嵎閿佸茍鍦≒referencePage緋葷粺灞炴т腑緇熶竴璁劇疆Command鍜?nbsp; Key鐨勬槧灝勩?nbsp;
plugin.xml鏂囦歡璁劇疆Section濡備笅鎵紺猴細
//澹版槑搴旂敤'棣栭夐」'閰嶇疆欏甸潰
<extension
point="org.eclipse.ui.preferencePages">
//棣栭夐」涓鑸郴緇熷弬鏁拌緗?br />
<page
class="rcpdemo.preferences.GeneralPreferencePage"
id="rcpdemo.preferences.GeneralPreferencePage"
name="General">
</page>
//鍦ㄩ閫夐」欏甸潰涓坊鍔犲簲鐢ㄥ叏灞Action蹇嵎閿緗〉闈?br />
<page
class="org.eclipse.ui.internal.keys.NewKeysPreferencePage"
id="rcpdemo.preferences.keys"
name="Keys"/>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="rcpdemo.preferences.PreferenceInitializer">
</initializer>
</extension>
//澹版槑action鍛戒護
<extension
point="org.eclipse.ui.commands">
//鍛戒護鍒嗙被鐩綍澹版槑
<category
description="Generic Commands Category"
id="rcpdemo.genericCmdCategory"
name="甯哥敤鍛戒護鐩綍"/>
/**鍛戒護澹版槑:id瀵瑰簲鐩稿簲Action綾諱腑鐨勫敮涓鏍囧織id.
* 娉ㄦ剰錛氶氳繃鏄犲皠浜唊ey鐨凙ction鍦ˋpplicationActionBarAdvisor.java涓殑makeActions鏂?nbsp;
* 娉曚腑涓瀹氳閫氳繃register鏂規硶娉ㄥ唽璇ction.
*/
<command
categoryId="rcpdemo.genericCmdCategory"
description="CustomerViewActionCommand"
id="rcpdemo.actions.CustomerViewAction"
name="瀹㈡埛瑙嗗浘鍛戒護"/>
//key緇戝畾commandId鎸囧畾鐨凜ommand.keySequence鎸囧畾鍛戒護蹇嵎閿?鍏朵腑
//M鏄閿洏鍔熻兘閿法緋葷粺騫沖彴鐨勯氱敤澶勭悊(M1錛欳trl;M2: Shift;M3:Alt).
<keyBinding
commandId="rcpdemo.actions.CustomerViewAction"
keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration"
keySequence="M1+M2+A"/>
<keyBinding
commandId="org.eclipse.ui.file.exit"
keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration"
keySequence="M1+Q"/>
</extension>
浜斻丷CP涓竴浜涘彲閲嶇敤鐨凙ctions銆乸ages銆乿iews銆?br />
1.閲嶇敤鐨凙ctions鍙湪ActionFactory綾諱腑鎵懼埌銆?br />
2.閲嶇敤鐨刾ages銆乿iews鍙湪ExtensionFactory綾諱腑鎵懼埌銆?br />
<extension point="org.eclipse.ui.views">
<view
class="org.eclipse.ui.ExtensionFactory:progressView"
icon="icons/progress.gif"
id="org.eclipsercp.hyperbola.views.progress"
name="Progress"/>
</extension>
浠ヤ笂鏄湪plug-in.xml涓紩鐢ㄧ殑閰嶇疆淇℃伅銆傚叾涓璿iew鑺傜偣鐨刢lass灞炴?
"org.eclipse.ui.ExtensionFactory:progressView"
-----'org.eclipse.ui.ExtensionFactory':ExtensionFactory綾昏礬寰勩?br />
-----'progressView':ExtensionFactory綾諱腑瀵瑰簲闈欐佺啛鎮夊紁ropressView.