0

如何使用 Eclipse 设置 ExtJS 自动完成支持?

有几种方法可以使用 Eclipse 设置 ExtJS 内容辅助。我尝试了几种方法,我自己的问题的答案包含最理想的方法。

因为当我尝试使用 Eclipse 的 extjs 插件时,我遇到了严重的问题。在某些时候,我的笔记本电脑(带有 16Gig ram 的 i7!)在打开几个 JS 文件后变得无响应。这很糟糕。

我希望这可以帮助某人避免这种头痛!

4

1 回答 1

0
How to setup

1. Install the Spket plugin for eclipse
 1.1 First in Eclipse menu go to Help -> Install New Software
 1.2 Click add button to add the update site and fill the URL field with one of the following links.(If one doesnt work, use the other)
        URLs : 
                1.  http://www.spket.com/update
                2.  http://www.agpad.com/update/

     then fill the name field with something like "spket", after that click ok.

 1.3 If Eclipse can find Spket, it will show the list of items as below. Select all items listed and click next.
 1.4 When prompted to accept the terms, select "I accept the terms..." , and click "Next"
 1.5 While downloading and installing, a warining message will appear, click "OK"
 1.6 When prompted to restart the IDE, click "Restart"

Spket安装站点

2. Create Spket profile for ExtJS for content assist
 2.1 In Eclipse menu go to Windows -> Preferences -> Select "Spket" -> JavaScript Profiles
 2.2 Click "New" to add a new profile.
        Fill the name with "ExtJS" and click "OK"
 2.3 Select the profile that you have created and add the relevant JS files.        
    2.3.1 There are two ways to add the JavaScripts to profile.
        2.3.1.1 "JSB" file approach
            ExtJs 3.X.X and 4.X.X comes with a JSB file that has all the information about the java script files comes wiht them.
            This file is generated by the JSBuilder packaging tool developed by sencha.
                For 
                    3.X.X ---> ext.jsb2
                    4.X.X ---> sdk.jsb3

        2.3.1.2 Folder containing the JS files approach(I prefer this way, because you can add more .js files to the folder with out creating new profile for each and also can remove files that are not required)
                ** If you are using the ExtJs 5.X.X or above, you wont find the "JSB" file inside the distribution.

 2.4 Click "Add file" and select the relevant JSB file or Click "Add Folder" and select the folder containing ExtJS distribution.               
 2.5 After creating the profile successfully, set the "ExtJS" profile as default profile by selecting the profile and clicking the default.

3. Set Spket as default JS editor.
    3.1 In Eclipse menu go to Window -> Preferences -> General -> Editors -> File Associations
    3.2 Select *.js from the file types and select "Spket JavaScript Editor" from the Associated editors section and click default.

4. Now open a JavaScript file and test if content assist is available for ExtJS.    

 Note:
 This approach works flawlessly with ExtJS 5.1.0 in Eclipse Luna 4.4.2 and STS 3.6.4 
于 2015-05-11T08:22:38.337 回答