外掛程式開發語句段總結

2021-08-29 14:52:15 字數 1277 閱讀 7191

//各種**editor:

//從texteditor繼承,呼叫setsourceviewerconfiguration,

//並傳進去乙個從sourceviewerconfiguration 繼承的配置類,

//就可以實現

public class sourceeditortest extends texteditor

//...................

}class sourceviewerconfigurationtest extends sourceviewerconfiguration

public static ieditorpart findeditor(ifile file)

}return null;

}

//得到工作區中所有工程的方法:

iproject projects = resourcesplugin.getworkspace().getroot()

.getprojects();

//這在開發自己的工程嚮導的時候很有用處。

//工程特有檔案判斷方法

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);

//建立資料夾的方法:

ifolder folder = project.getfolder("myfold");

if (folder!=null && !folder.exists())

folder.create(false, true, null);

jquery外掛程式開發總結

類級別 就是給jquery本身加方法 物件級別 就是給jquery物件加方法 jquery.myalert function jquery function jquery 呼叫 mydiv pluginname dom pluginname options 傳引數,進行初始化 dom pluginn...

jQuery外掛程式開發總結

jquery外掛程式開發兩個底層方法 jquery.extend deep target object1 objectn 將兩個或更多物件的內容合併到第乙個物件。當我們提供兩個或多個物件給 extend 物件的所有屬性都新增到目標物件 target引數 目標物件 第乙個引數 將被修改,並且將通過 e...

js jQuery外掛程式開發總結

最近開發了用了jquery,也玩了玩jquery的外掛程式。上次使用jquery是一年前,從沒弄過jquery外掛程式,下次在用jquery也不知道是什麼時候,不如現在總結一下。再從聰明的腦袋也抗不如歲月的沖刷,總結,總結,總結 1,外掛程式的定義 首先,何為外掛程式?外掛程式是一種遵循一定規範的應...