ruper2/src/java/eclipse/org/krysalis/ruper2/eclipse/plugin/ui RuperPage1.java,NONE,1.1 RuperWizard.java,NONE,1.1

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/eclipse/org/krysalis/ruper2/eclipse/plugin/ui
In directory sc8-pr-cvs1:/tmp/cvs-serv15861/src/java/eclipse/org/krysalis/ruper2/eclipse/plugin/ui

Added Files:
	RuperPage1.java RuperWizard.java 
Log Message:
browser - still testing

--- NEW FILE: RuperPage1.java ---
/*****************************************************************************
 * Copyright (C) The Krysalis project. All rights reserved.                  *
 * ------------------------------------------------------------------------- *
 * This software is published under the terms of the Krysalis Patchy         *
 * Software License version 1.1_01, a copy of which has been included        *
 * at the bottom of this file.                                               *
 *****************************************************************************/
package org.krysalis.ruper2.eclipse.plugin.ui;

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.help.WorkbenchHelp;
import org.krysalis.version.eclipse.constraint.util.IConstraintConstants;
import org.krysalis.version.eclipse.util.MessageUtil;

/**
 * This class is the only page of the Constraint file resource creation wizard.  
 * It subclasses the standard file resource creation page class, 
 * and consequently inherits the file resource creation functionality.
 *
 * This page provides users with the choice of creating sample headings for
 * sections and subsections.  Additionally, the option is presented to open
 * the file immediately for editing after creation.
 */
public class RuperPage1 extends WizardPage implements Listener 
{
	private static final String PAGE_NAME	= "Ruper Page 1";
	private IWorkbench m_workbench;
	private IStructuredSelection m_selection;
	
	// widgets
	private Button constraintCheckbox;
	private Button openFileCheckbox;

	// constants
	private static int nameCounter = 1;
	/**
	 * Creates the page for the Constraint creation wizard.
	 *
	 * @param workbench  the workbench on which the page should be created
	 * @param selection  the current selection
	 */
	public RuperPage1(IWorkbench workbench, IStructuredSelection selection)
	{
		super(RuperPage1.PAGE_NAME); //$NON-NLS-1$
		this.m_selection = selection;
		setTitle(MessageUtil.getString("Create_Constraint_File")); //$NON-NLS-1$
		setDescription(MessageUtil.getString("Create_a_new_Constraint_file_resource")); //$NON-NLS-1$
		m_workbench = workbench;
	}
	/** (non-Javadoc)
	 * Method declared on IDialogPage.
	 */
	public void createControl(Composite parent)
	{
		Composite composite = (Composite) getControl();

		WorkbenchHelp.setHelp(composite, IConstraintConstants.CREATION_WIZARD_PAGE_CONTEXT);

		GridData data = (GridData) composite.getLayoutData();


		setPageComplete(validatePage());

	}
	
	private boolean validatePage() {
		boolean valid = true;
		// TODO check all the elements to see if they are valid
		return valid;
	}
	
	/**
	 */
	public boolean finish()
	{
		// TODO finish work
		return true;
	}
	
	public void handleEvent(Event e)
	{
		Widget source = e.widget;

		//handle listener events
		//setPageComplete(validatePage());
	}
}

--- NEW FILE: RuperWizard.java ---
/*****************************************************************************
 * Copyright (C) The Krysalis project. All rights reserved.                  *
 * ------------------------------------------------------------------------- *
 * This software is published under the terms of the Krysalis Patchy         *
 * Software License version 1.1_01, a copy of which has been included        *
 * at the bottom of this file.                                               *
 *****************************************************************************/
package org.krysalis.ruper2.eclipse.plugin.ui;

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IWorkbench;
import org.krysalis.ruper2.eclipse.util.RuperEclipseConstants;
import org.krysalis.version.eclipse.util.MessageUtil;

/**
 */
public class RuperWizard extends Wizard
{
	private IStructuredSelection selection;
	private IWorkbench workbench;
	private RuperPage1 ruperPage1;
	/** (non-Javadoc)
	 * Method declared on Wizard.
	 */
	public void addPages()
	{
		ruperPage1 = new RuperPage1(workbench, selection);
		addPage(ruperPage1);
	}
	/** (non-Javadoc)
	 * Method declared on INewWizard
	 */
	public void init(IWorkbench workbench, IStructuredSelection selection)
	{
		this.workbench = workbench;
		this.selection = selection;
		setWindowTitle(MessageUtil.getString(RuperEclipseConstants.RUPER)); //$NON-NLS-1$
		//setDefaultPageImageDescriptor();
	}
	/** (non-Javadoc)
	 * Method declared on IWizard
	 */
	public boolean performFinish()
	{
		return ruperPage1.finish();
	}
}
/*
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2002-2003  Nicola Ken Barozzi.  All rights reserved.

This Licence is compatible with the BSD licence as described and 
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.

3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
   "This product includes software developed for project 
	Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.

4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].

5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name,
without prior written permission of Nicola Ken Barozzi.

6. This software may contain voluntary contributions made by many 
individuals, who decided to donate the code to this project in
respect of this licence.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED.  IN NO EVENT SHALL THE KRYSALIS PROJECT OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================*/



-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.