001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS <http://nuxeo.com> and others
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Jean-Marc Orliaguet, Chalmers
011 *
012 * $Id$
013 */
014
015package org.nuxeo.theme;
016
017import org.nuxeo.common.xmap.annotation.XNode;
018import org.nuxeo.common.xmap.annotation.XObject;
019import org.nuxeo.runtime.api.Framework;
020import org.nuxeo.theme.types.Type;
021import org.nuxeo.theme.types.TypeFamily;
022
023@XObject("shortcut")
024public final class ShortcutType implements Type {
025
026    @XNode("@key")
027    private String key;
028
029    private String target;
030
031    public TypeFamily getTypeFamily() {
032        return TypeFamily.SHORTCUT;
033    }
034
035    public String getTypeName() {
036        return key;
037    }
038
039    public String getKey() {
040        return key;
041    }
042
043    public String getTarget() {
044        return target;
045    }
046
047    public void setKey(final String key) {
048        this.key = key;
049    }
050
051    @XNode("@target")
052    public void setTarget(final String target) {
053        this.target = Framework.expandVars(target);
054    }
055
056}