Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c69c5eaa7b8f8129ac0684f220fd90ec8497187d (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*****************************************************************************
 * Copyright (c) 2012 CEA LIST.
 *
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *  Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.dev.view.services.edit.request.helper;

import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
import org.eclipse.papyrus.dev.view.services.edit.request.view.RequestView;

/**
 *
 * We use this advice to know the request sended to the service edit
 *
 */
public class ViewEditHelperAdvice implements IEditHelperAdvice {

	public ICommand getBeforeEditCommand(final IEditCommandRequest request) {
		RequestView view = RequestView.INSTANCE;
		if (view != null) {
			view.addRequest(request);
		}
		return null;
	}

	public ICommand getAfterEditCommand(final IEditCommandRequest request) {
		// nothing to do
		return null;
	}

	public void configureRequest(final IEditCommandRequest request) {
		// nothing to do
	}

	public boolean approveRequest(final IEditCommandRequest request) {
		return true;
	}

}

Back to the top