沙漠中的魚

          欲上天堂,先下地獄
          posts - 0, comments - 56, trackbacks - 0, articles - 119
            BlogJava :: 首頁 ::  :: 聯(lián)系 :: 聚合  :: 管理

          RCP視圖顯示位置設(shè)置

          Posted on 2012-03-12 14:25 沙漠中的魚 閱讀(548) 評論(0)  編輯  收藏 所屬分類: RCP開發(fā)
          在RCP有時候需要將視圖放在一邊,分上下顯示,但是在RCP沒有RIGHT_TOP和RIGHT_BOTTOM這樣的方位設(shè)置,我們可以通過添加視圖的關(guān)聯(lián)ID設(shè)置相對位置。如下代碼addView方法,createFolder也相同
              /**
               * Adds a view with the given compound id to this page layout.
               * See the {
          @link IPageLayout} type documentation for more details about compound ids.
               * The primary id must name a view contributed to the workbench's view extension point 
               * (named <code>"org.eclipse.ui.views"</code>).
               *
               * 
          @param viewId the compound view id
               * 
          @param relationship the position relative to the reference part;
               *  one of <code>TOP</code>, <code>BOTTOM</code>, <code>LEFT</code>,
               *  or <code>RIGHT</code>
               * 
          @param ratio a ratio specifying how to divide the space currently occupied by the reference part,
               *    in the range <code>0.05f</code> to <code>0.95f</code>.
               *    Values outside this range will be clipped to facilitate direct manipulation.
               *    For a vertical split, the part on top gets the specified ratio of the current space
               *    and the part on bottom gets the rest.
               *    Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
               *    and the part at right gets the rest.
               * 
          @param refId the id of the reference part; either a view id, a folder id,
               *   or the special editor area id returned by <code>getEditorArea</code>
               
          */
              
          public void addView(String viewId, int relationship, float ratio,
                      String refId);
          主站蜘蛛池模板: 托里县| 揭阳市| 沭阳县| 布拖县| 保康县| 宁海县| 类乌齐县| 木兰县| 沐川县| 科技| 和林格尔县| 莒南县| 福泉市| 沙洋县| 潮州市| 焦作市| 鹿邑县| 重庆市| 弥渡县| 珠海市| 大渡口区| 长沙市| 东丰县| 静安区| 庄河市| 当雄县| 长岛县| 正蓝旗| 鸡泽县| 习水县| 扬中市| 易门县| 高淳县| 洪雅县| 阳泉市| 金溪县| 揭东县| 金堂县| 延安市| 黔东| 肥乡县|