eclipse
TextEditor editor; ... Method method = AbstractTextEditor.class.getDeclaredMethod("getSourceViewer", null); method.setAccessible(true); ISourceViewer viewer = method.invoke(editor, null); StyledText text = viewer.getTextWidget(); StyleRang…
TextEditor editor; ... editor.getDocumentProvider().getDocument(editor.getEditorInput()).set("...");
IFile file; ... file.delete(true, false, null);
IProject project; ... project.delete(true, true, null);
IFile file; ... IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), file);
// プロジェクトに新しいファイルを作成する。 private IFile createFile(IProject project, String path, String content) throws CoreException { IFile file = project.getFile(path); InputStream io = new ByteArrayInputStream(content.getBytes()); f…
import org.eclipse.core.resources.*; ... public IProject createProject(String name) throws CoreException { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); project.create(null); project.open(null); return proje…