<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    大夢想家

    5年開發(fā)工程師,2年實施經(jīng)理,X年售前顧問,......
    數(shù)據(jù)加載中……
    一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~



    我用代碼硬生生的把Eclipse-RCP丑陋的Coolbar替換掉了,但是不爽的是,Viewer上使用的是CTabFolder,而這個CTabFolder的產(chǎn)生,我沒有辦法操控,希望有高手指點(diǎn)。
    修改代碼如下:
     1package test;
     2
     3import org.eclipse.swt.SWT;
     4import org.eclipse.swt.graphics.Point;
     5import org.eclipse.swt.layout.FillLayout;
     6import org.eclipse.swt.widgets.Composite;
     7import org.eclipse.swt.widgets.Shell;
     8import org.eclipse.ui.application.ActionBarAdvisor;
     9import org.eclipse.ui.application.IActionBarConfigurer;
    10import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
    11import org.eclipse.ui.application.WorkbenchWindowAdvisor;
    12import org.eclipse.ui.internal.WindowTrimProxy;
    13import org.eclipse.ui.internal.WorkbenchMessages;
    14import org.eclipse.ui.internal.WorkbenchWindowConfigurer;
    15import org.eclipse.ui.internal.layout.TrimLayout;
    16
    17import com.hexapixel.widgets.generic.ColorCache;
    18import com.hexapixel.widgets.ribbon.RibbonTab;
    19import com.hexapixel.widgets.ribbon.RibbonTabFolder;
    20
    21public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
    22
    23    private TrimLayout defaultLayout;
    24    private Composite topComposite;
    25    private WindowTrimProxy topCompositeTrim;
    26    private Composite pageComposite;
    27    
    28    public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
    29        super(configurer);
    30    }

    31
    32    public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
    33        return new ApplicationActionBarAdvisor(configurer);
    34    }

    35    
    36    public void preWindowOpen() {
    37        IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
    38        configurer.setInitialSize(new Point(400300));
    39        configurer.setShowCoolBar(false);
    40        configurer.setShowStatusLine(false);
    41        configurer.setTitle("Hello RCP");
    42    }

    43
    44    @Override
    45    public void createWindowContents(Shell shell) {
    46        shell.setBackground(ColorCache.getInstance().getColor(182206238));
    47        // TODO Auto-generated method stub
    48        defaultLayout = new TrimLayout();
    49        defaultLayout.setSpacing(2222);
    50        defaultLayout.setMargins(22);
    51        shell.setLayout(defaultLayout);
    52        
    53        //topComposite
    54        topComposite = new Composite(shell, SWT.None);
    55        topComposite.setLayout(new FillLayout(SWT.VERTICAL)); 
    56        topComposite.setBackground(ColorCache.getInstance().getColor(182206238));
    57        
    58            final RibbonTabFolder ftf = new RibbonTabFolder(topComposite, SWT.NONE);
    59            RibbonTab ft0 = new RibbonTab(ftf, "Home");
    60            RibbonTab ft1 = new RibbonTab(ftf, "Insert");
    61            new RibbonTab(ftf, "Page Layout");
    62            new RibbonTab(ftf, "References");
    63        
    64        topCompositeTrim = new WindowTrimProxy(topComposite,"org.eclipse.ui.internal.WorkbenchWindow.topBar", WorkbenchMessages.TrimCommon_Main_TrimName, SWT.NONE, true);
    65        
    66        
    67        
    68        
    69        pageComposite = (Composite) ((WorkbenchWindowConfigurer) getWindowConfigurer()).createPageComposite(shell);
    70        setLayoutDataForContents();
    71    }

    72
    73    private void setLayoutDataForContents() {
    74        updateLayoutDataForContents();
    75        
    76    }

    77
    78    private void updateLayoutDataForContents() {
    79        if (defaultLayout == null{
    80            return;
    81        }

    82        defaultLayout.addTrim(SWT.TOP, topCompositeTrim);
    83        topComposite.setVisible(true);
    84        
    85        pageComposite.setBackground(ColorCache.getInstance().getColor(182206238));
    86        defaultLayout.setCenterControl(pageComposite);
    87        
    88    }

    89    
    90}

    91



    客戶虐我千百遍,我待客戶如初戀!

    posted on 2007-10-09 11:52 阿南 閱讀(3833) 評論(11)  編輯  收藏 所屬分類: Eclipse-RCP

    評論

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-09 12:03 千里冰封

    不錯,挺好看的,我還是喜歡swing
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-09 12:03 千里冰封

    不錯,挺好看的,我還是喜歡swing
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-09 12:11 阿南

    本地化有時候也不是什么好事!
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-09 13:05 交口稱贊

    樓主這么用累不?
    不如直接用swing得了

    好像有人用swing實現(xiàn)了rcp
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-09 13:14 阿南

    哎~等著IBM繼續(xù)開源一點(diǎn)吧~
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~[未登錄] 2007-10-09 14:23 test

    估計得修改eclipse底層了
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-09 16:51 Pande

    自定義一個org.eclipse.ui.presentationFactories擴(kuò)展點(diǎn)就行了
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-09 17:29 Pande

    這和本地化不本地化沒有絲毫關(guān)系!!!
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-09 17:33 阿南

    謝謝提醒~
    請問,上面的那塊灰色的區(qū)域怎么修改阿?
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-09 18:33 Pande

    你是不是不想要View的Title?

    用addStandaloneView(id, false)就行了

    如果用org.eclipse.ui.presentationFactories,你可以完全控制圍繞View或者Editor的Trimming的,寫一個StackPresentation的子類。eclipse.org的cvs里有例子的。好像是Project org.eclipse.ui.examples.presetation. 有興趣可以看看。

    其實Eclipse RCP是非常靈活的,Rich Client Platform這本書的第18和19章講得很詳細(xì),你可以參考。只要你愿意,可以很方便的定制RCP程序的每一處細(xì)節(jié)。

    費(fèi)事的是Design,實現(xiàn)是很簡單。
      回復(fù)  更多評論    

    # re: 一個使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ 2007-10-16 13:12 翔南

    沒見過的東東!
    學(xué)習(xí)啦 呵呵
      回復(fù)  更多評論    
    主站蜘蛛池模板: 水蜜桃视频在线观看免费| 亚洲中文字幕无码久久精品1| 亚洲AV成人无码久久精品老人| 无码免费又爽又高潮喷水的视频 | 亚洲av激情无码专区在线播放 | 日韩伦理片电影在线免费观看| 亚洲一区二区三区首页| 久久精品国产这里是免费| 国产精品高清视亚洲一区二区| 最近免费中文字幕大全免费版视频| 久久精品国产亚洲沈樵| 最新亚洲成av人免费看| 女性无套免费网站在线看| 亚洲人成电影网站色| 毛片a级毛片免费播放下载| 亚洲欧美日韩国产成人| 免费观看的毛片手机视频| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 日本特黄a级高清免费大片| www.亚洲成在线| 国产精品成人免费综合| 在线观看亚洲专区| 中文字幕无码精品亚洲资源网| 亚洲人成网站在线观看播放动漫| 毛片免费全部免费观看| 久久人午夜亚洲精品无码区 | 毛色毛片免费观看| 亚洲AV无码国产精品永久一区| 亚洲国产香蕉人人爽成AV片久久| 亚洲欧洲尹人香蕉综合| 免费看a级黄色片| 亚洲免费视频一区二区三区| 亚洲成AV人片在| 91网站免费观看| 产传媒61国产免费| 亚洲av中文无码乱人伦在线r▽| 老湿机一区午夜精品免费福利| 国产午夜亚洲精品理论片不卡 | 国产免费午夜a无码v视频| 亚洲免费视频一区二区三区| 亚洲精品中文字幕乱码影院|