KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > action > AbstractGroupMarker


1 /*******************************************************************************
2  * Copyright (c) 2000, 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 package org.eclipse.jface.action;
12
13 import org.eclipse.core.runtime.Assert;
14
15 /**
16  * Abstract superclass for group marker classes.
17  * <p>
18  * This class is not intended to be subclassed outside the framework.
19  * </p>
20  */

21 public abstract class AbstractGroupMarker extends ContributionItem {
22     /**
23      * Constructor for use by subclasses.
24      */

25     protected AbstractGroupMarker() {
26     }
27
28     /**
29      * Create a new group marker with the given name.
30      * The group name must not be <code>null</code> or the empty string.
31      * The group name is also used as the item id.
32      *
33      * @param groupName the name of the group
34      */

35     protected AbstractGroupMarker(String JavaDoc groupName) {
36         super(groupName);
37         Assert.isTrue(groupName != null && groupName.length() > 0);
38     }
39
40     /**
41      * Returns the group name.
42      *
43      * @return the group name
44      */

45     public String JavaDoc getGroupName() {
46         return getId();
47     }
48
49     /**
50      * The <code>AbstractGroupMarker</code> implementation of this <code>IContributionItem</code>
51      * method returns <code>true</code> iff the id is not <code>null</code>. Subclasses may override.
52      */

53     public boolean isGroupMarker() {
54         return getId() != null;
55     }
56 }
57
Popular Tags