mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-01 01:25:34 +00:00
eclipse plugin: fix the editor when eclipse has lost focus...
...and no default workbench page available
This commit is contained in:
parent
83f876b27f
commit
93df96c6a0
@ -21,7 +21,6 @@ import org.eclipse.ui.texteditor.AbstractTextEditor;
|
|||||||
import org.eclipse.ui.texteditor.IDocumentProvider;
|
import org.eclipse.ui.texteditor.IDocumentProvider;
|
||||||
import org.eclipse.ui.texteditor.ITextEditor;
|
import org.eclipse.ui.texteditor.ITextEditor;
|
||||||
|
|
||||||
import wesnoth_eclipse_plugin.Activator;
|
|
||||||
import wesnoth_eclipse_plugin.Logger;
|
import wesnoth_eclipse_plugin.Logger;
|
||||||
|
|
||||||
public class EditorUtils
|
public class EditorUtils
|
||||||
@ -48,8 +47,7 @@ public class EditorUtils
|
|||||||
|
|
||||||
public static IEditorPart getEditedFile()
|
public static IEditorPart getEditedFile()
|
||||||
{
|
{
|
||||||
return Activator.getDefault().getWorkbench().
|
return WorkspaceUtils.getWorkbenchWindow().getPages()[0].getActiveEditor();
|
||||||
getActiveWorkbenchWindow().getPages()[0].getActiveEditor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void openEditor(IFile file, boolean activatePage)
|
public static void openEditor(IFile file, boolean activatePage)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user