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

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

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

    如鵬網 大學生計算機學習社區

    CowNew開源團隊

    http://www.cownew.com 郵件請聯系 about521 at 163.com

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      363 隨筆 :: 2 文章 :: 808 評論 :: 0 Trackbacks

    1、從TextEditor繼承,調用setSourceViewerConfiguration,并傳進去一個從SourceViewerConfiguration 繼承的配置類,就可以實現各種代碼editor。
    2、swt盡量使用GridLayout布局(不是java.awt中的GridLayout,而是swt中的)和GridData域。文章:http://coolbear.yculblog.com/post.89429.html

    3、得到文件的編輯器的方法:
    ??? public static IEditorPart findEditor(IFile file){
    ??????? IEditorReference[] editors = getActivePage().getEditorReferences();;
    ??????? for (int i = 0; i < editors.length; i++) {
    ??????????? IEditorPart part = (IEditorPart)editors[i].getPart(false);
    ??????????? if (part != null ){
    ??????????????? IEditorInput input = part.getEditorInput();
    ??????????????? if(input instanceof FileEditorInput && ((FileEditorInput)input).getFile().equals(file))
    ??????????????????? return part;
    ??????????? }???????????????
    ??????? }
    ??????? return null;
    ??? }

    4、得到工作區中所有工程的方法:
    ??????? IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
    ??????????????? .getProjects();
    這在開發自己的工程向導的時候很有用處。
    5、工程特有文件判斷方法
    project.getFile("cownew.prj").exists();
    project.getDescription().hasNature();
    給工程增加Nature的方法:
    ?IProjectDescription desc = project.getDescription();
    String[] oldNatureIds = desc.getNatureIds();
    ??????????????? String[] newNatureIds? = new String[oldNatureIds.length +1];
    ??????????????? System.arraycopy(oldNatureIds, 0, newNatureIds, 0, oldNatureIds.length);
    ??????????????? newNatureIds[oldNatureIds.length] = "CowNewNature";
    ??????????????? desc.setNatureIds(newNatureIds);
    ??????????????? project.setDescription(desc, monitor);
    6、創建文件夾的方法:
    IFolder folder = project.getFolder("myfold");
    if (folder!=null && !folder.exists())
    ? folder.create(false, true, null);

    7、彈出包選擇對話框的方法:
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(
    ??????????????????? getShell(), new LabelProvider());
    ??????????? dialog.setIgnoreCase(false);
    dialog.setElements(getAllPackages().toArray());
    ??????????? String path = currentPackage();
    ?dialog.setInitialSelections(new Object[] { path });
    dialog.open();
    fPKName.setText((String) dialog.getFirstResult());

    public List getAllPackages() {
    ??????? List list = new ArrayList();
    ??????? IResource res = getFirstSelection();
    ??????? IProject project = res.getProject();
    ??????? File file = project.getFolder("src").getLocation().toFile();
    ??????? File[] fs = file.listFiles();
    ??????? for (int i = 0; i < fs.length; i++) {
    ??????????? if (fs[i].isDirectory())
    ??????????????? iterator("", fs[i], list);
    ??????? }
    ??????? Collections.sort(list);
    ??????? return list;
    ??? }
    8 objectClass="org.eclipse.core.resources.IFile"代表菜單應用到文件
    9 透視圖的的實現很簡單,就是在構造函數里邊打開一些視圖,使一些action(這樣菜單和按鈕也就都可用)可以用,比如:
    String editorArea = layout.getEditorArea();
    ??????? IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
    ??????????????? 0.30f, editorArea);
    ??????? left.addView(PACKAGE_VIEW_ID);
    ?layout.setEditorAreaVisible(true);
    ?layout.addShowViewShortcut(IDESystem.BUSINESSVIEW_ID);

    posted on 2006-07-21 00:33 CowNew開源團隊 閱讀(1275) 評論(1)  編輯  收藏

    評論

    # re: cownew開源-eclipse插件開發學習知識點筆記 2006-11-26 20:28 luckylq
    我是個新手
    請問怎么用SWT來做一個重主窗口一個Btton彈出對話框?
    謝謝
    可以發郵件給我嗎?My Email:luckylq3@163.com  回復  更多評論
      


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: av无码免费一区二区三区| 久别的草原电视剧免费观看| 无码人妻一区二区三区免费手机| 91亚洲精品第一综合不卡播放| 国产免费无码AV片在线观看不卡| 亚洲精品无码AV人在线播放| 中文字幕免费在线播放| 亚洲va久久久噜噜噜久久狠狠 | 色拍自拍亚洲综合图区| 久久久久成人精品免费播放动漫| 亚洲国产精品久久66| 久久久免费的精品| 亚洲女人初试黑人巨高清| 成人免费午夜无码视频| 亚洲av成人无码网站…| 亚洲欧洲久久av| a级毛片免费完整视频| 亚洲无线电影官网| 欧美三级在线电影免费| 亚洲精品色在线网站| 久久久亚洲精品蜜桃臀| 日韩精品无码免费一区二区三区 | 日韩精品在线免费观看| 亚洲免费观看网站| 国产一级高清视频免费看| 国产97视频人人做人人爱免费| 亚洲成AV人片在线观看WWW| 精品无码免费专区毛片| 亚洲国产精品美女久久久久| 亚洲区小说区图片区| 日韩毛片免费在线观看| 久久久久久毛片免费看| 亚洲美免无码中文字幕在线| 妞干网在线免费视频| 久久国产免费直播| 亚洲AV无码乱码麻豆精品国产| 亚洲Av无码国产情品久久| 一级特黄aa毛片免费观看| 看亚洲a级一级毛片| 久久精品国产亚洲av影院| 国产成人精品免费视频大全五级 |