Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3e54a979dd4dbef869d723e4f52f45846c222fc1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*****************************************************************************
 * Copyright (c) 2016 CEA LIST and others.
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Shuai Li (CEAL LIST) <shuai.li@cea.fr>
 *
 *****************************************************************************/
package org.eclipse.papyrus.editor;

import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage;
import org.eclipse.papyrus.infra.core.sasheditor.editor.IPageChangedListener;

public class PapyrusNavigationHistorySynchronizer implements IPageChangedListener {

	private final PapyrusMultiDiagramEditor myMultiDiagramEditor;

	public PapyrusNavigationHistorySynchronizer(PapyrusMultiDiagramEditor multiEditor) {
		myMultiDiagramEditor = multiEditor;
		//synchronizeNavigationHistory(); // Mark the first page when the editor is opened
	}

	@Override
	public void pageChanged(IPage newPage) {
		synchronizeNavigationHistory();
	}
	
	private void synchronizeNavigationHistory() {
		myMultiDiagramEditor.getSite().getPage().getNavigationHistory().markLocation(myMultiDiagramEditor);
	}
}

Back to the top