2011-04-12 51 views

回答

1

像这样的事情会是这个任务的典型代码:

String fileContents = ...; 
IFile file = ...; 
file.create(new ByteArrayInputStream(fileContents.getBytes()), true, null); 
FileEditorInput input = new FileEditorInput(file); 
PlatformUI.getWorkbench().getActiveWorkbenchWindow(). 
    getActivePage().openEditor(input, THE_EDITOR_ID);