我使用的是Eclipse 3.4,在網(wǎng)上找了很多資料來(lái)解決這個(gè)問題,主要是兩個(gè)方法:配置文件法和硬編碼法。我經(jīng)過(guò)仔細(xì)測(cè)試,反正是沒有搞定通過(guò)配置文件來(lái)設(shè)置波浪線外形,也許是Eclipse版本的問題吧。
方法1:
我們可以通過(guò)配置文件的方式來(lái)更改產(chǎn)品的樣式。(注:這種方法我經(jīng)過(guò)測(cè)試是不可以的,但是網(wǎng)上大量的都是這種方法,姑且放到這里)
首先,在plugin.xml中對(duì)org.eclipse.core.runtime.products擴(kuò)展點(diǎn)的屬性進(jìn)行更改,如下:
1 <extension
2 id="product"
3 point="org.eclipse.core.runtime.products">
4 <product
5 <!--[if !vml]-->
<!--[endif]--> application="cn.blogjava.youxia.rcp_start.application"
6 <!--[if !vml]-->
<!--[endif]--> name="第一個(gè)RCP程序">
7 <!--[if !vml]-->
<!--[endif]--> <property
8 <!--[if !vml]-->
<!--[endif]--> name="preferenceCustomization"
9 <!--[if !vml]-->
<!--[endif]--> value="plugin_customization.ini"/>
10 <!--[if !vml]-->
<!--[endif]--> </product>
11 <!--[if !vml]-->
<!--[endif]--></extension>
2 id="product"
3 point="org.eclipse.core.runtime.products">
4 <product
5 <!--[if !vml]-->

6 <!--[if !vml]-->

7 <!--[if !vml]-->

8 <!--[if !vml]-->

9 <!--[if !vml]-->

10 <!--[if !vml]-->

11 <!--[if !vml]-->

可見,我們?yōu)槲覀兊漠a(chǎn)品添加了一個(gè)prefereneCustomization屬性,該屬性的值為plugin_customization.ini文件,在該文件中,我們可以配置我們的樣式。在這里,它的內(nèi)容如下:
1 <!--[if !vml]-->
<!--[endif]-->org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
2 <!--[if !vml]-->
<!--[endif]-->org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight

2 <!--[if !vml]-->

事實(shí)上,在這個(gè)文件中可以定義的參數(shù)有上百個(gè),可以查看Eclipse的文檔。
方法2:
采用硬編碼實(shí)現(xiàn),重載ApplicationWorkbenchAdvisor類的initialize()接口,代碼如下:
@Override
publicvoid initialize(IWorkbenchConfigurer configurer) {
super.initialize(configurer);
//設(shè)置標(biāo)簽頁(yè)弧線型外觀
PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false);
}
|
IWorkbenchPreferenceConstants常見屬性
屬 性 名
|
屬 性 說(shuō) 明
|
EDITOR_MINIMUM_CHARACTERS
|
但很多編輯器重疊時(shí),設(shè)置編輯器標(biāo)題文字的最短長(zhǎng)度。默認(rèn)為8個(gè)字符
|
SHOW_PROGRESS_ON_STARTUP
|
設(shè)置啟動(dòng)時(shí)是否顯示進(jìn)度條。默認(rèn)值false
|
DOCK_PERSPECTIVE_BAR
|
設(shè)置透視圖標(biāo)題欄停泊位置。默認(rèn)值為TOP_RIGHT,還可以設(shè)置為TOP_LEFT、LEFT
|
SHOW_TEXT_ON_PERSPECTIVE_BAR
|
設(shè)置透視圖是否顯示標(biāo)題文本。默認(rèn)值為true
|
SHOW_INTRO
|
啟動(dòng)時(shí)是否顯示歡迎畫面。默認(rèn)值為true
|