RCP開發:多出工具條一掃光

private static final String[] ACTIONSETID = new String[] { "org.eclipse.ant.ui.actionSet.presentation", //$NON-NLS-1$         "org.eclipse.debug.ui.breakpointActionSet",//$NON-NLS-1$          "org.eclipse.debug.ui.debugActionSet",//$NON-NLS-1$       

AST的一些概念(待續)

Eclipse AST是Eclipse JDT的一個重要組成部分,定義在org.eclipse.jdt.core.dom中,用來表示java語言中的所有文法結構。下面是api中一些核心類的概念:1.ASTNode類及其衍生類別 用於描述各種AST節點的類,每個AST節點表示一個Java來源程式中的一個文法結構,例如,類型、運算式、語句或聲明等。2.AST類 建立AST節點的工廠類,類中包含許多建立各類AST節點的Factory

MessageFormat的使用

我們可以在*.properties中配置一下模式(pattern)。eg: class.skeleton= public class {0} extends Trade '{\n\    \n\    \tpublic int init() throws Exception\n\    \t{\n\    \t\treturn 0;\n\    \t}\n\    \n\}\n'    測試代碼: public class MessageFormatDemo { /**  * @param

為何能夠為其它的WorkbenchPart貢獻右鍵菜單?

在前面兩篇博文中,已經言及,為視圖和編輯器貢獻右鍵菜單。根據見樣學樣法則。我們去看看這些WorkbenchPart內部作了什麼。比如,我們在自己的視圖或編輯器中這樣做。MenuManager menuMgr = new MenuManager("#popupMenu", "popupMenu"); //$NON-NLS-1$ //$NON-NLS-2$        menuMgr.setRemoveAllWhenShown(true);       

開啟多個視圖支援

首先需要將視圖擴充點的allowMultiple設定true。This allows multiple instances of a particular view to be created. They are disambiguated using the secondary id. If a secondary id is given, the view must allow multiple instances by having specified

擷取Bundle中的資源

直接看代碼InputStream is = EditorPlugin.getDefault().getBundle().getEntry("icons/project.gif").openStream();   protected IEntryDictionary importXMLEntryDictionary(            Bundle bundle, IEntryDictionary entryDictionary)    {        try        {       

擷取每個外掛程式(bunlde)的國際化檔案

擷取每個外掛程式(bunlde)的國際化檔案(plugin.properties或plugin_locale名稱.properties) 。比如plugin.properties或plugin_zh_CN.properties等檔案。  注意事項:   1.需要在MANI-INF下面的MANIFEST.MF中添加Bundle-Localization: plugin內容。      2.同時在bundle根目錄下必須有plugin.properties等檔案。   public

JDT學習之ICompilationUnit

ICompilationUnit表示Java源(.java)檔案。常用api1.getSource():擷取.java檔案內容1.產生編譯單元通過程式來產生編譯單元最簡單的方法是使用IPackageFragment.createCompilationUnit。指定編譯單元的名稱和內容。於是在包中建立了編譯單元,並返回新的ICompilationUnit。●copy.createImport:建立匯入●eg0:ICompilationUnit cu =

反編譯外掛程式jadclipse的安裝與配置

1.下載jadclipsehttp://jadclipse.sourceforge.net/wiki/index.php/Main_Page2.下載jadhttp://www.varaneckas.com/jad/3.安裝jadclipsePut the JadClipse JAR file into the plugins folder of your Eclipse installation.Restart Eclipse (eclipse -clean).Get Jad.Put the

JDT學習之IPackageFragmentRoot

JDT學習之IPackageFragmentRootIPackageFragmentRoot是一組IPackageFragment的根,代表源檔案夾,也可以是jar包或zip包。比如Java工程中建立的src檔案夾,某個依賴的jar檔案 (比如rt.jar檔案)。eg:if(obj instanceof IPackageFragmentRoot){IPackageFragmentRoot pckRoot = (IPackageFragmentRoot)

How do I enable global actions such as Cut, Paste, and Print in my editor?

FAQ How do I enable global actions such as Cut, Paste, and Print in my editor?如何在Editor啟用時關聯全域的Retarget Action?Your editor's IEditorActionBarContributor, defined in the editor definition in theplugin.xml file, is responsible for enabling global

JDT學習之SourceType

SourceType代表原始碼中的Class,Interface,Anonation,Enum等類型。直接看代碼eg:SourceType sType = (SourceType) type; System.out.println("名稱:" + sType.getElementName());if(sType.isClass()){sType.createMethod("public void v(){}", null, false,null);//建立方法sType.createField(

How do I hook into global actions, such as Copy and Delete?

 FAQ How do I hook into global actions, such as Copy and Delete?View中如何關聯關聯全域的Retarget Action。 Certain standard toolbar and menu entries can be shared among several views and editors. These actions are called eitherglobal or retargetable actions and

淺談EditPart的IEditorActionBarContributor

Editor與視圖的區別不僅在於那個經典的開啟-->修改-->儲存。它還體現在,視圖有自己的專屬的工具列,下拉式功能表,而編輯器是共用通用的功能表列和工具列。IEditorActionBarContributor類負責為一個或多個編輯器向主功能表列和工具列添加操作。通常是編輯器開啟時添加共用功能表列和工具列,編輯器關閉時(同一類型的全部關閉),dispose共用的功能表列和工具列。EditorActionBarContributor是IEditorActionBarContribut

外掛程式開發,為某個視圖貢獻右鍵菜單

廢話不說。直接看如何操作。以大家熟悉的Package Explore視圖為例。step1:建立一個org.eclipse.ui.popupMenus擴充點,在其下建立一個viewerContribution,id任意(注意保持唯一,不要和工作台和自己的viewerContribution重複),targetID設定為"org.eclipse.jdt.ui.PackageExplorer","org.eclipse.jdt.ui.PackageExplorer"就是Package

FAQ When should I use refreshLocal?

FAQ When should I use refreshLocal?From EclipsepediaJump to: navigation, searchResources become out of sync with the workspace if they are changed directly in the file system without using Eclipse workspace API.  If your plug-in changes files and

淺談MultiPageEditorActionBarContributor

MultiPageEditorActionBarContributor是多頁編輯器(MultiPageEditorPart)的EditorActionBarContributor實現。最近在重構一個GEF項目,將之前的單頁編輯器(EditorPart)重構為了多頁編輯器(MultiPageEditorPart),發現在切換頁面過程中之前的一系列Retarget

IBinding,IJavaElement,ASTNode等類的相互轉化

How to go from one of IBinding, IJavaElement, ASTNode to another?標籤:ast,jdt之間的相互轉化From an IBinding to its declaring ASTNodeorg.eclipse.jdt.core.dom.CompilationUnit.findDeclaringNode(IBinding)From an IBinding to an

編譯tomcat7.x源碼

step1:download apache tomcat sourceget source from http://tomcat.apache.org/download-70.cgistep2:將下載下來的apache-tomcat-7.0.27-src.zip解壓至某目錄下eg:tomcat7step3:檢查機器上是否安裝有apache

JDT:類型對話方塊的使用(FilteredTypesSelectionDialog)

在UI上的展現可能是這樣的:核心是JavaUI類的使用了,直接上代碼:public IType selectType() throws JavaModelException { Shell parent = window.getShell(); SelectionDialog dialog= JavaUI.createTypeDialog( parent, new ProgressMonitorDialog(parent),

總頁數: 61357 1 .... 21432 21433 21434 21435 21436 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.