001    /*
002     * Copyright 2002-2004 the original author or authors.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005     * use this file except in compliance with the License. You may obtain a copy of
006     * the License at
007     *
008     * http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012     * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013     * License for the specific language governing permissions and limitations under
014     * the License.
015     */
016    package org.springframework.richclient.dialog;
017    
018    import java.awt.Image;
019    
020    import javax.swing.Icon;
021    
022    import org.springframework.binding.value.PropertyChangePublisher;
023    import org.springframework.richclient.core.Guarded;
024    import org.springframework.richclient.core.Message;
025    import org.springframework.richclient.factory.ControlFactory;
026    
027    /**
028     * DialogPages are used to combine several controls in one Dialog which acts as
029     * a container. Different implementations are available to create tabs/trees or
030     * wizard-like sequences.
031     *
032     * @author Keith Donald
033     */
034    public interface DialogPage extends ControlFactory, Messagable, Guarded, PropertyChangePublisher {
035    
036            public static final String DESCRIPTION_PROPERTY = "description";
037    
038            public static final String PAGE_COMPLETE_PROPERTY = "pageComplete";
039    
040            /**
041             * Returns this page's name.
042             *
043             * @return the name of this page
044             */
045            public String getId();
046    
047            /**
048             * Returns this dialog page's title.
049             *
050             * @return the title of this dialog page, or <code>null</code> if none
051             */
052            public String getTitle();
053    
054            /**
055             * Returns this dialog page's description text.
056             *
057             * @return the description text for this dialog page, or <code>null</code>
058             * if none
059             */
060            public String getDescription();
061    
062            /**
063             * Returns the current message for this dialog page.
064             *
065             * @return the message, or <code>null</code> if none
066             */
067            public Message getMessage();
068    
069            /**
070             * Returns this dialog page's image.
071             *
072             * @return the image for this dialog page, or <code>null</code> if none
073             */
074            public Image getImage();
075    
076            /**
077             * Returns this dialog page's icon.
078             *
079             * @return the icon for this dialog page, or <code>null</code> if none
080             */
081            public Icon getIcon();
082    
083            /**
084             * Notifies that help has been requested for this dialog page.
085             */
086            public void performHelp();
087    
088            /**
089             * Sets the visibility of this dialog page.
090             *
091             * @param visible <code>true</code> to make this page visible, and
092             * <code>false</code> to hide it
093             */
094            public void setVisible(boolean visible);
095    
096            /**
097             * Returns the visibility of this dialog page.
098             *
099             * @return <code>true</code> this page is visible, or <code>false</code>
100             * if this page is hidden
101             */
102            public boolean isVisible();
103    
104            /**
105             * Returns whether this page is complete or not.
106             * <p>
107             * This information is typically to decide when it is okay to submit a form.
108             * </p>
109             *
110             * @return <code>true</code> if this page is complete, and
111             * <code>false</code> otherwise
112             */
113            public boolean isPageComplete();
114    
115    }