KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > menus > LocationElementToken


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  ******************************************************************************/

11
12 package org.eclipse.ui.internal.menus;
13
14 /**
15  * <p>
16  * This records enough information to create a child layout node. It is created
17  * by {@link LocationElementTokenizer}.
18  * </p>
19  * <p>
20  * Only intended for use within the <code>org.eclipse.jface.menus</code>
21  * package.
22  * </p>
23  * <p>
24  * <strong>PROVISIONAL</strong>. This class or interface has been added as
25  * part of a work in progress. There is a guarantee neither that this API will
26  * work nor that it will remain the same. Please do not use this API without
27  * consulting with the Platform/UI team.
28  * </p>
29  * <p>
30  * This class will eventually exist in <code>org.eclipse.jface.menus</code>.
31  * </p>
32  *
33  * @since 3.2
34  */

35 final class LocationElementToken {
36
37     /**
38      * The location at which the child element should be inserted; may be
39      * <code>null</code>.
40      */

41     private final SLocation location;
42
43     /**
44      * The identifier of the child element to be created; never
45      * <code>null</code>.
46      */

47     private final String JavaDoc id;
48
49     /**
50      * Constructs a new <code>LocationElementToken</code>.
51      *
52      * @param location
53      * The location leading up to this location element; may be
54      * <code>null</code>.
55      * @param id
56      * The identifier of this location element; must not be
57      * <code>null</code>.
58      */

59     LocationElementToken(final SLocation location, final String JavaDoc id) {
60         if (id == null) {
61             throw new NullPointerException JavaDoc("The id cannot be null"); //$NON-NLS-1$
62
}
63
64         this.location = location;
65         this.id = id;
66     }
67
68     /**
69      * Returns the identifier for this token.
70      *
71      * @return The identifier for this token; never <code>null</code>.
72      */

73     public final String JavaDoc getId() {
74         return id;
75     }
76
77     /**
78      * Returns the location for this token.
79      *
80      * @return The location for this token; may be <code>null</code>.
81      */

82     public final SLocation getLocation() {
83         return location;
84     }
85 }
86
Popular Tags