001: /*******************************************************************************
002: * Copyright (c) 2004, 2005 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.wizards;
011:
012: import org.eclipse.core.runtime.CoreException;
013: import org.eclipse.core.runtime.IAdaptable;
014: import org.eclipse.jface.resource.ImageDescriptor;
015: import org.eclipse.jface.viewers.IStructuredSelection;
016: import org.eclipse.ui.IWorkbenchPartDescriptor;
017: import org.eclipse.ui.IWorkbenchWizard;
018:
019: /**
020: * Base interface for all wizards defined via workbench extension points.
021: * <p>
022: * This interface is not intended to be implemented by clients.
023: * </p>
024: *
025: * @since 3.1
026: */
027: public interface IWizardDescriptor extends IWorkbenchPartDescriptor,
028: IAdaptable {
029:
030: /**
031: * Answer the selection for the reciever based on whether the it can handle
032: * the selection. If it can return the selection. If it can handle the
033: * adapted to IResource value of the selection. If it satisfies neither of
034: * these conditions return an empty IStructuredSelection.
035: *
036: * @return IStructuredSelection
037: * @param selection
038: * IStructuredSelection
039: */
040: IStructuredSelection adaptedSelection(IStructuredSelection selection);
041:
042: /**
043: * Return the description.
044: *
045: * @return the description
046: */
047: String getDescription();
048:
049: /**
050: * Return the tags associated with this wizard.
051: *
052: * @return the tags associated with this wizard
053: */
054: String[] getTags();
055:
056: /**
057: * Create a wizard.
058: *
059: * @return the wizard
060: * @throws CoreException thrown if there is a problem creating the wizard
061: */
062: IWorkbenchWizard createWizard() throws CoreException;
063:
064: /**
065: * Return the description image for this wizard.
066: *
067: * @return the description image for this wizard or <code>null</code>
068: */
069: public ImageDescriptor getDescriptionImage();
070:
071: /**
072: * Return the help system href for this wizard.
073: *
074: * @return the help system href for this wizard or <code>null</code>
075: */
076: String getHelpHref();
077:
078: /**
079: * Return the category for this wizard.
080: *
081: * @return the category or <code>null</code>
082: */
083: IWizardCategory getCategory();
084:
085: /**
086: * Answer <code>true</code> if this wizard is able to finish without
087: * loading any pages. This is a hint to any
088: * {@link org.eclipse.jface.wizard.WizardSelectionPage} or container that
089: * may contain this wizard to allow the finish button to be pressed without
090: * actually entering the wizard. If this occurs the
091: * {@link org.eclipse.jface.wizard.IWizard#performFinish()} method should be
092: * invoked by the containing wizard without creating any pages.
093: *
094: * @return <code>true</code> if this wizard can finish immediately
095: */
096: boolean canFinishEarly();
097:
098: /**
099: * Answer <code>true</code> if this wizard has any pages. This is a
100: * hint to any {@link org.eclipse.jface.wizard.WizardSelectionPage} or
101: * container that may contain this wizard that they should enable the "Next"
102: * button, if appropriate.
103: *
104: * @return <code>true</code> if this wizard has wizard pages
105: */
106: boolean hasPages();
107: }
|