?? showselection.java
字號:
package test.actions;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.w3c.dom.NamedNodeMap;
@SuppressWarnings("restriction")
public class ShowSelection implements ListenerShowSelection{
private TableViewer tableViewer;
private ElementImpl ei;
public ShowSelection(TableViewer tableViewer,ElementImpl ei){
this.tableViewer=tableViewer;
this.ei=ei;
}
public ShowSelection(){
}
public String showSelection(IWorkbenchPart sourcepart, ISelection selection) {
PropertyFactory pf=new PropertyFactory();
tableViewer.setInput(pf.showSelection(ei));
String tagName=pf.getTagName();
return tagName;
}
public void changeSelection(String property,String valueName) {
NamedNodeMap pro=SampleAction.ei.getAttributes();
for (int j=0;j<pro.getLength();j++){
if(property.equals(pro.item(j).getNodeName().trim())){
SampleAction.ei.getAttributes().item(j).setNodeValue(valueName);
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -