Skip to main content
summaryrefslogtreecommitdiffstats
blob: e4e13ada1beb9cc0932840ba93a36970065cace2 (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
/*******************************************************************************
 * Copyright (c) 2006 Sybase, Inc. 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:
 *     Sybase, Inc. - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.pagedesigner.actions.range;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jst.pagedesigner.PDPlugin;
import org.eclipse.jst.pagedesigner.viewer.DesignRange;

/**
 * @author mengbo
 * @version 1.5
 */
public class RangeStyleSupport {
	private static final String[] ActionLabel = new String[] {
			PDPlugin.getResourceString("RangeStyleSupport.ActionLabel.Bold"),//$NON-NLS-1$
			PDPlugin.getResourceString("RangeStyleSupport.ActionLabel.Italic"),//$NON-NLS-1$
			PDPlugin
					.getResourceString("RangeStyleSupport.ActionLabel.Underline"), }; //$NON-NLS-1$

	private static final String[] HtmlTag = new String[] { "STRONG", "I", "U", }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

	private static final String[] CSSProperty = new String[] {
			"font-weight", "font-style", "text-decoration", }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

	private static final String[] CSSValue = new String[] { "bolder", "italic", //$NON-NLS-1$ //$NON-NLS-2$
			"underline", }; //$NON-NLS-1$

	/**
	 * @param menu
	 * @param range
	 */
	public static void createRangeStyleActions(IMenuManager menu,
			DesignRange range) {
		for (int i = 0; i < ActionLabel.length; i++) {
			RangeStyleAction action = new RangeStyleAction(ActionLabel[i],
					range, HtmlTag[i], CSSProperty[i], CSSValue[i]);

			menu.add(action);
		}
	}
}

Back to the top