# HG changeset patch
# User Frank Benoit
+ * This class is intended to be the base for any trim contributions.
+ *
+ * For example: If the implementation is constructing a {@link ToolBar} and
+ * the orientation were to change from horizontal to vertical it would have
+ * to
+ * The sides can be one of:
+ * dispose
its old ToolBar and create a new one with the
+ * correct orientation.
+ *
+ *
+ *
+ *
+ * @param parent
+ * The parent to (re)create the widget under
+ *
+ * @param oldSide
+ * The previous side ({@link DWT#DEFAULT} on the initial fill)
+ * @param newSide
+ * The current side
+ */
+ public abstract void fill(Composite parent, int oldSide, int newSide);
+
+ /* (non-Javadoc)
+ * @see dwtx.jface.menus.IWidget#dispose()
+ */
+ public abstract void dispose();
+
+ /* (non-Javadoc)
+ * @see dwtx.jface.menus.IWidget#fill(dwt.widgets.Composite)
+ */
+ public void fill(Composite parent) {
+ }
+
+ /* (non-Javadoc)
+ * @see dwtx.jface.menus.IWidget#fill(dwt.widgets.Menu, int)
+ */
+ public void fill(Menu parent, int index) {
+ }
+
+ /* (non-Javadoc)
+ * @see dwtx.jface.menus.IWidget#fill(dwt.widgets.ToolBar, int)
+ */
+ public void fill(ToolBar parent, int index) {
+ }
+
+ /* (non-Javadoc)
+ * @see dwtx.jface.menus.IWidget#fill(dwt.widgets.CoolBar, int)
+ */
+ public void fill(CoolBar parent, int index) {
+ }
+}
diff -r 5802cda3813d -r f25582573129 dwtx/jface/menus/IWidget.d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwtx/jface/menus/IWidget.d Thu Apr 03 20:41:52 2008 +0200
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 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
+ * Provides a hook by which third-party code can contribute DWT widgets to a
+ * menu, tool bar or status line. This can be used, for example, to add a combo
+ * box to the status line, or a "Location" bar to the tool bar.
+ *
+ * It is possible for fill and dispose to be called multiple times for a single
+ * instance of
+ * Clients may implement, but must not extend.
+ *
+ * A piece of state carrying a single {@link String}.
+ *
+ * If this state is registered using {@link INamedHandleStateIds#NAME} or
+ * {@link INamedHandleStateIds#DESCRIPTION}, then this allows the handler to
+ * communicate a textual change for a given command. This is typically used by
+ * graphical applications to allow more specific text to be displayed in the
+ * menus. For example, "Undo" might become "Undo Typing" through the use of a
+ * {@link TextState}.
+ *
+ * Clients may instantiate this class, but must not extend.
+ * IWidget
.
+ * -1
+ * to insert at the end
+ */
+ public void fill(Menu parent, int index);
+
+ /**
+ * Fills the given tool bar with controls representing this contribution
+ * item.
+ *
+ * @param parent
+ * the parent tool bar
+ * @param index
+ * the index where the controls are inserted, or -1
+ * to insert at the end
+ */
+ public void fill(ToolBar parent, int index);
+
+ /**
+ * Fills the given cool bar with controls representing this contribution
+ * item.
+ *
+ * @param parent
+ * the parent cool bar
+ * @param index
+ * the index where the controls are inserted, or -1
+ * to insert at the end
+ */
+ public void fill(CoolBar parent, int index);
+}
diff -r 5802cda3813d -r f25582573129 dwtx/jface/menus/TextState.d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwtx/jface/menus/TextState.d Thu Apr 03 20:41:52 2008 +0200
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 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