के साथ एक नया ग्रहण संपादक कैसे खोलें मैं उपरोक्त प्रोग्रामेटिक रूप से करना चाहता हूं।
मैंने How to get cursor position in an eclipse TextEditor और Eclipse-plugin how to get current text editor corsor position पर देखा तो मुझे पता है कि वर्तमान खुले संपादक से कर्सर ऑफ़सेट कैसे प्राप्त होता है। हालांकि, मैं कर्सर ऑफ़सेट को एक नए संपादक में सेट करने की कोशिश कर रहा हूं जो प्रोग्राम द्वारा मेरे द्वारा प्रोग्राम किया गया है।
एक विशिष्ट कर्सर ऑफसेट स्थिति
तरह से मैं इस समय अपने नए संपादक को खोलने कर रहा हूँ इस प्रकार है:
IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = win.getActivePage();
if (page != null) {
IEditorPart editor = page.getActiveEditor();
if (editor != null) {
IEditorInput input = editor.getEditorInput();
if (input instanceof IFileEditorInput) {
String fileLocation = ((IFileEditorInput) input).getFile().getLocation().toOSString();
String newFileLocartion = generateNewFileLocation(fileLocation);
File file = new File(newFileLocartion);
IFileStore fileStore = EFS.getLocalFileSystem().getStore(file.toURI());
try {
IDE.openEditorOnFileStore(page, fileStore);
} catch (PartInitException e) {
// TODO error handling
}
}
}
}
एक विशिष्ट ऑफसेट में खोलने के लिए नए संपादक सेट खोलने के लिए एक रास्ता है (यह मानते हुए मैं पहले से ही जानता है में ऑफसेट अग्रिम)?
धन्यवाद!