diff dwtx/jface/action/IContributionManagerOverrides.d @ 16:e0f0aaf75edd

PopupDialog, bindings and actions
author Frank Benoit <benoit@tionex.de>
date Tue, 01 Apr 2008 08:00:31 +0200
parents
children 46a6e0e6ccd4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwtx/jface/action/IContributionManagerOverrides.d	Tue Apr 01 08:00:31 2008 +0200
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation 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:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module dwtx.jface.action.IContributionManagerOverrides;
+
+import dwtx.jface.action.IContributionItem;
+
+import dwt.dwthelper.utils;
+
+/**
+ * This interface is used by instances of <code>IContributionItem</code>
+ * to determine if the values for certain properties have been overriden
+ * by their manager.
+ * <p>
+ * This interface is internal to the framework; it should not be implemented outside
+ * the framework.
+ * </p>
+ *
+ * @since 2.0
+ */
+public interface IContributionManagerOverrides {
+    /**
+     * Id for the enabled property. Value is <code>"enabled"</code>.
+     *
+     * @since 2.0
+     */
+    public const static String P_ENABLED = "enabled"; //$NON-NLS-1$
+
+    /**
+     * Find out the enablement of the item
+     * @param item the contribution item for which the enable override value is
+     * determined
+     * @return <ul>
+     *              <li><code>bool.TRUE</code> if the given contribution item should be enabled</li>
+     *              <li><code>bool.FALSE</code> if the item should be disabled</li>
+     *              <li><code>null</code> if the item may determine its own enablement</li>
+     *          </ul>
+     * @since 2.0
+     */
+    public ValueWrapperBool getEnabled(IContributionItem item);
+
+    /**
+     * This is not intended to be called outside of the workbench. This method
+     * is intended to be deprecated in 3.1.
+     *
+     * TODO deprecate for 3.1
+     * @param item the contribution item for which the accelerator value is determined
+     * @return the accelerator
+     */
+    public ValueWrapperInt getAccelerator(IContributionItem item);
+
+    /**
+     * This is not intended to be called outside of the workbench. This method
+     * is intended to be deprecated in 3.1.
+     *
+     * TODO deprecate for 3.1
+     * @param item the contribution item for which the accelerator text is determined
+     * @return the text for the accelerator
+     */
+    public String getAcceleratorText(IContributionItem item);
+
+    /**
+     * This is not intended to be called outside of the workbench. This method
+     * is intended to be deprecated in 3.1.
+     *
+     * TODO deprecate for 3.1
+     * @param item the contribution item for which the text is determined
+     * @return the text
+     */
+    public String getText(IContributionItem item);
+}