Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a7c4d66f481fc51e62fe9dd902f16f22491f7739 (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
/*****************************************************************************
 * 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 v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
 *****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.configuration.handler;

import java.util.Map;

import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.css.Attribute;
import org.eclipse.papyrus.infra.gmfdiag.css.Declaration;
import org.eclipse.papyrus.infra.gmfdiag.css.Ruleset;
import org.eclipse.papyrus.infra.gmfdiag.css.Stylesheet;
import org.eclipse.swt.widgets.Shell;


public class EditStyleHandler extends AbstractStyleHandler {

	@Override
	protected AbstractStyleDialog createStyleDialog(Shell shell, Map<Declaration, Boolean> declarations, Map<Attribute, Boolean> conditions, String selectorName, View context) {
		return new StyleEditionDialog(shell, conditions, declarations, selectorName, context);
	}

	@Override
	protected Ruleset getRuleset(AbstractStyleDialog dialog) {
		Ruleset ruleset = ((StyleEditionDialog) dialog).getSelectedRuleset();
		ruleset.getSelectors().clear();
		ruleset.getProperties().clear();
		return ruleset;
	}

	@Override
	protected Stylesheet getStyleSheet(AbstractStyleDialog dialog, View contextView) {
		return ((StyleEditionDialog) dialog).getStylesheet();
	}

}

Back to the top