directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r619374 - /directory/studio/branches/studio-maven/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/AbstractWizardPage.java
Date Thu, 07 Feb 2008 11:50:08 GMT
Author: pamarcelot
Date: Thu Feb  7 03:50:05 2008
New Revision: 619374

URL: http://svn.apache.org/viewvc?rev=619374&view=rev
Log:
Added AbstractWizardPage class which shares methods for all the WizardPages.

Added:
    directory/studio/branches/studio-maven/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/AbstractWizardPage.java

Added: directory/studio/branches/studio-maven/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/AbstractWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-maven/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/AbstractWizardPage.java?rev=619374&view=auto
==============================================================================
--- directory/studio/branches/studio-maven/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/AbstractWizardPage.java
(added)
+++ directory/studio/branches/studio-maven/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/AbstractWizardPage.java
Thu Feb  7 03:50:05 2008
@@ -0,0 +1,90 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.schemaeditor.view.wizards;
+
+
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.WizardPage;
+
+
+/**
+ * This abstract class extends {@link WizardPage} and holds common methods
+ * for all our {@link WizardPage}s.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class AbstractWizardPage extends WizardPage
+{
+    /**
+     * Creates a new wizard page with the given name, title, and image.
+     *
+     * @param pageName the name of the page
+     * @param title the title for this wizard page,
+     *   or <code>null</code> if none
+     * @param titleImage the image descriptor for the title of this wizard page,
+     *   or <code>null</code> if none
+     */
+    protected AbstractWizardPage( String pageName, String title, ImageDescriptor titleImage
)
+    {
+        super( pageName, title, titleImage );
+    }
+
+
+    /**
+     * Creates a new wizard page with the given name, and
+     * with no title or image.
+     *
+     * @param pageName the name of the page
+     */
+    protected AbstractWizardPage( String pageName )
+    {
+        super( pageName );
+    }
+
+
+    /**
+     * Displays an error message and set the page status as incomplete
+     * if the message is not null.
+     *
+     * @param message
+     *      the message to display
+     */
+    protected void displayErrorMessage( String message )
+    {
+        setErrorMessage( message );
+        setPageComplete( message == null );
+    }
+
+
+    /**
+     * Displays a warning message and set the page status as complete.
+     *
+     * @param message
+     *      the message to display
+     */
+    protected void displayWarningMessage( String message )
+    {
+        setErrorMessage( null );
+        setMessage( message, DialogPage.WARNING );
+        setPageComplete( true );
+    }
+}



Mime
View raw message