📄 customereditor.java
字号:
package myrcp.intro;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.EditorPart;
public class CustomerEditor extends EditorPart {
public static final String ID = "myrcp.editor"; //$NON-NLS-1$
private Customer customer;
private Text text;
/**
* Create contents of the editor part
* @param parent
*/
public void createPartControl(Composite parent) {
//Composite container = new Composite(parent, SWT.NONE);
text = new Text(parent,SWT.NONE);
text.setText(customer.getName());
//
}
public void setFocus() {
// Set the focus
}
public void doSave(IProgressMonitor monitor) {
// Do the Save operation
}
public void doSaveAs() {
// Do the Save As operation
}
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
// Initialize the editor part
if(input instanceof CustomerEditorInput){
customer=((CustomerEditorInput)input).getCustomer();
this.setSite(site);
this.setInput(input);
}
}
public boolean isDirty() {
return false;
}
public boolean isSaveAsAllowed() {
return false;
}
// private void initializeToolBar() {
// IToolBarManager toolBarManager = getEditorSite().getActionBars().getToolBarManager();
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -