use of org.eclipse.che.ide.api.parts.EditorPartStack in project che by eclipse.
the class EditorAgentImpl method restoreSplit.
private List<Promise<Void>> restoreSplit(JsonObject files, EditorPartStack editorPartStack, Map<EditorPartPresenter, EditorPartStack> activeEditors) {
JsonObject splitFirst = files.getObject("SPLIT_FIRST");
String direction = files.getString("DIRECTION");
double size = files.getNumber("SIZE");
EditorPartStack split = editorMultiPartStack.split(editorPartStack, new Constraints(Direction.valueOf(direction), null), size);
List<Promise<Void>> restoreFirst = restore(splitFirst, editorPartStack, activeEditors);
JsonObject splitSecond = files.getObject("SPLIT_SECOND");
List<Promise<Void>> restoreSecond = restore(splitSecond, split, activeEditors);
List<Promise<Void>> result = new ArrayList<>();
result.addAll(restoreFirst);
result.addAll(restoreSecond);
return result;
}
use of org.eclipse.che.ide.api.parts.EditorPartStack in project che by eclipse.
the class OrionEditorPresenter method updateTabReference.
private void updateTabReference(File file, Path oldPath) {
final PartPresenter activePart = editorMultiPartStackPresenter.getActivePart();
final EditorPartStack activePartStack = editorMultiPartStackPresenter.getPartStackByPart(activePart);
if (activePartStack == null) {
return;
}
final EditorTab editorTab = activePartStack.getTabByPath(oldPath);
if (editorTab != null) {
editorTab.setFile(file);
}
}
use of org.eclipse.che.ide.api.parts.EditorPartStack in project che by eclipse.
the class ReopenClosedFileAction method updateInPerspective.
/** {@inheritDoc} */
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
EditorPartStack currentPartStack = getEditorPane(event);
EditorPartPresenter lastClosed = currentPartStack.getLastClosed();
event.getPresentation().setEnabled(lastClosed != null);
}
use of org.eclipse.che.ide.api.parts.EditorPartStack in project che by eclipse.
the class EditorMultiPartStackPresenter method removePart.
/** {@inheritDoc} */
@Override
public void removePart(PartPresenter part) {
EditorPartStack editorPartStack = getPartStackByPart(part);
if (editorPartStack == null) {
return;
}
editorPartStack.removePart(part);
if (editorPartStack.getActivePart() == null) {
removePartStack(editorPartStack);
}
}
use of org.eclipse.che.ide.api.parts.EditorPartStack in project che by eclipse.
the class EditorMultiPartStackPresenter method setActivePart.
/** {@inheritDoc} */
@Override
public void setActivePart(@NotNull PartPresenter part) {
activeEditor = part;
EditorPartStack editorPartStack = getPartStackByPart(part);
if (editorPartStack != null) {
activeEditorPartStack = editorPartStack;
editorPartStack.setActivePart(part);
}
}
Aggregations