diff org.eclipse.jface/src/org/eclipse/jface/wizard/IWizard.d @ 12:bc29606a740c

Added dwt-addons in original directory structure of eclipse.org
author Frank Benoit <benoit@tionex.de>
date Sat, 14 Mar 2009 18:23:29 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.jface/src/org/eclipse/jface/wizard/IWizard.d	Sat Mar 14 18:23:29 2009 +0100
@@ -0,0 +1,241 @@
+/*******************************************************************************
+ * 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 org.eclipse.jface.wizard.IWizard;
+
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.jface.wizard.IWizardPage;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.jface.dialogs.IDialogSettings;
+
+import java.lang.all;
+import java.util.Set;
+
+/**
+ * Interface for a wizard.  A wizard maintains a list of wizard pages,
+ * stacked on top of each other in card layout fashion.
+ * <p>
+ * The class <code>Wizard</code> provides an abstract implementation
+ * of this interface. However, clients are also free to implement this
+ * interface if <code>Wizard</code> does not suit their needs.
+ * </p>
+ * @see Wizard
+ */
+public interface IWizard {
+    /**
+     * Adds any last-minute pages to this wizard.
+     * <p>
+     * This method is called just before the wizard becomes visible, to give the
+     * wizard the opportunity to add any lazily created pages.
+     * </p>
+     */
+    public void addPages();
+
+    /**
+     * Returns whether this wizard could be finished without further user
+     * interaction.
+     * <p>
+     * The result of this method is typically used by the wizard container to enable
+     * or disable the Finish button.
+     * </p>
+     *
+     * @return <code>true</code> if the wizard could be finished,
+     *   and <code>false</code> otherwise
+     */
+    public bool canFinish();
+
+    /**
+     * Creates this wizard's controls in the given parent control.
+     * <p>
+     * The wizard container calls this method to create the controls
+     * for the wizard's pages before the wizard is opened. This allows
+     * the wizard to size correctly; otherwise a resize may occur when
+     * moving to a new page.
+     * </p>
+     *
+     * @param pageContainer the parent control
+     */
+    public void createPageControls(Composite pageContainer);
+
+    /**
+     * Disposes of this wizard and frees all SWT resources.
+     */
+    public void dispose();
+
+    /**
+     * Returns the container of this wizard.
+     *
+     * @return the wizard container, or <code>null</code> if this
+     *   wizard has yet to be added to a container
+     */
+    public IWizardContainer getContainer();
+
+    /**
+     * Returns the default page image for this wizard.
+     * <p>
+     * This image can be used for pages which do not
+     * supply their own image.
+     * </p>
+     *
+     * @return the default page image
+     */
+    public Image getDefaultPageImage();
+
+    /**
+     * Returns the dialog settings for this wizard.
+     * <p>
+     * The dialog store is used to record state between
+     * wizard invocations (for example, radio button selections,
+     * last directory, etc.).
+     * </p>
+     *
+     * @return the dialog settings, or <code>null</code> if none
+     */
+    public IDialogSettings getDialogSettings();
+
+    /**
+     * Returns the successor of the given page.
+     * <p>
+     * This method is typically called by a wizard page
+     * </p>
+     *
+     * @param page the page
+     * @return the next page, or <code>null</code> if none
+     */
+    public IWizardPage getNextPage(IWizardPage page);
+
+    /**
+     * Returns the wizard page with the given name belonging to this wizard.
+     *
+     * @param pageName the name of the wizard page
+     * @return the wizard page with the given name, or <code>null</code> if none
+     */
+    public IWizardPage getPage(String pageName);
+
+    /**
+     * Returns the number of pages in this wizard.
+     *
+     * @return the number of wizard pages
+     */
+    public int getPageCount();
+
+    /**
+     * Returns all the pages in this wizard.
+     *
+     * @return a list of pages
+     */
+    public IWizardPage[] getPages();
+
+    /**
+     * Returns the predecessor of the given page.
+     * <p>
+     * This method is typically called by a wizard page
+     * </p>
+     *
+     * @param page the page
+     * @return the previous page, or <code>null</code> if none
+     */
+    public IWizardPage getPreviousPage(IWizardPage page);
+
+    /**
+     * Returns the first page to be shown in this wizard.
+     *
+     * @return the first wizard page
+     */
+    public IWizardPage getStartingPage();
+
+    /**
+     * Returns the title bar color for this wizard.
+     *
+     * @return the title bar color
+     */
+    public RGB getTitleBarColor();
+
+    /**
+     * Returns the window title string for this wizard.
+     *
+     * @return the window title string, or <code>null</code> for no title
+     */
+    public String getWindowTitle();
+
+    /**
+     * Returns whether help is available for this wizard.
+     * <p>
+     * The result of this method is typically used by the container to
+     * show or hide the Help button.
+     * </p>
+     *
+     * @return <code>true</code> if help is available,
+     *   and <code>false</code> if this wizard is helpless
+     */
+    public bool isHelpAvailable();
+
+    /**
+     * Returns whether this wizard needs Previous and Next buttons.
+     * <p>
+     * The result of this method is typically used by the container.
+     * </p>
+     *
+     * @return <code>true</code> if Previous and Next buttons are required,
+     *   and <code>false</code> if none are needed
+     */
+    public bool needsPreviousAndNextButtons();
+
+    /**
+     * Returns whether this wizard needs a progress monitor.
+     * <p>
+     * The result of this method is typically used by the container.
+     * </p>
+     *
+     * @return <code>true</code> if a progress monitor is required,
+     *   and <code>false</code> if none is needed
+     */
+    public bool needsProgressMonitor();
+
+    /**
+     * Performs any actions appropriate in response to the user
+     * having pressed the Cancel button, or refuse if canceling
+     * now is not permitted.
+     *
+     * @return <code>true</code> to indicate the cancel request
+     *   was accepted, and <code>false</code> to indicate
+     *   that the cancel request was refused
+     */
+    public bool performCancel();
+
+    /**
+     * Performs any actions appropriate in response to the user
+     * having pressed the Finish button, or refuse if finishing
+     * now is not permitted.
+     *
+     * Normally this method is only called on the container's
+     * current wizard. However if the current wizard is a nested wizard
+     * this method will also be called on all wizards in its parent chain.
+     * Such parents may use this notification to save state etc. However,
+     * the value the parents return from this method is ignored.
+     *
+     * @return <code>true</code> to indicate the finish request
+     *   was accepted, and <code>false</code> to indicate
+     *   that the finish request was refused
+     */
+    public bool performFinish();
+
+    /**
+     * Sets or clears the container of this wizard.
+     *
+     * @param wizardContainer the wizard container, or <code>null</code>
+     */
+    public void setContainer(IWizardContainer wizardContainer);
+}