Search in sources :

Example 1 with EditorMultiPartStackState

use of org.eclipse.che.ide.api.parts.EditorMultiPartStackState in project che by eclipse.

the class EditorAgentImpl method getState.

@Override
public JsonObject getState() {
    JsonObject state = Json.createObject();
    EditorMultiPartStackState stacks = null;
    try {
        stacks = editorMultiPartStack.getState();
    } catch (IllegalStateException ignore) {
    }
    if (stacks != null) {
        state.put("FILES", storeEditors(stacks));
    }
    EditorPartPresenter activeEditor = getActiveEditor();
    if (activeEditor != null) {
        state.put("ACTIVE_EDITOR", activeEditor.getEditorInput().getFile().getLocation().toString());
    }
    return state;
}
Also used : EditorMultiPartStackState(org.eclipse.che.ide.api.parts.EditorMultiPartStackState) JsonObject(elemental.json.JsonObject) EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Aggregations

JsonObject (elemental.json.JsonObject)1 EditorPartPresenter (org.eclipse.che.ide.api.editor.EditorPartPresenter)1 EditorMultiPartStackState (org.eclipse.che.ide.api.parts.EditorMultiPartStackState)1