annotate dwtx/jface/action/AbstractGroupMarker.d @ 90:7ffeace6c47f

Update 3.4M7 to 3.4
author Frank Benoit <benoit@tionex.de>
date Sun, 06 Jul 2008 23:30:07 +0200
parents ea8ff534f622
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1 /*******************************************************************************
90
7ffeace6c47f Update 3.4M7 to 3.4
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
2 * Copyright (c) 2000, 2008 IBM Corporation and others.
16
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3 * All rights reserved. This program and the accompanying materials
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4 * are made available under the terms of the Eclipse Public License v1.0
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
5 * which accompanies this distribution, and is available at
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
6 * http://www.eclipse.org/legal/epl-v10.html
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
7 *
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
8 * Contributors:
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
9 * IBM Corporation - initial API and implementation
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
10 * Port to the D programming language:
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
11 * Frank Benoit <benoit@tionex.de>
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
12 *******************************************************************************/
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
13 module dwtx.jface.action.AbstractGroupMarker;
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
14
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
15 import dwtx.jface.action.ContributionItem;
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
16
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
17 import dwtx.core.runtime.Assert;
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
18
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
19 import dwt.dwthelper.utils;
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
20
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
21 /**
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
22 * Abstract superclass for group marker classes.
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
23 * <p>
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
24 * This class is not intended to be subclassed outside the framework.
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
25 * </p>
90
7ffeace6c47f Update 3.4M7 to 3.4
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
26 * @noextend This class is not intended to be subclassed by clients.
16
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
27 */
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
28 public abstract class AbstractGroupMarker : ContributionItem {
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
29 /**
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
30 * Constructor for use by subclasses.
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
31 */
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
32 protected this() {
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
33 }
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
34
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
35 /**
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
36 * Create a new group marker with the given name.
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
37 * The group name must not be <code>null</code> or the empty string.
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
38 * The group name is also used as the item id.
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
39 *
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
40 * @param groupName the name of the group
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
41 */
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
42 protected this(String groupName) {
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
43 super(groupName);
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
44 Assert.isTrue(groupName !is null && groupName.length > 0);
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
45 }
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
46
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
47 /**
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
48 * Returns the group name.
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
49 *
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
50 * @return the group name
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
51 */
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
52 public String getGroupName() {
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
53 return getId();
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
54 }
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
55
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
56 /**
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
57 * The <code>AbstractGroupMarker</code> implementation of this <code>IContributionItem</code>
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
58 * method returns <code>true</code> iff the id is not <code>null</code>. Subclasses may override.
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
59 */
43
ea8ff534f622 Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents: 16
diff changeset
60 public override bool isGroupMarker() {
16
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
61 return getId() !is null;
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
62 }
e0f0aaf75edd PopupDialog, bindings and actions
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
63 }