You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by me...@apache.org on 2001/01/17 23:23:40 UTC
cvs commit: jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build BuildData.java BuildStateMachine.java CompileStep.java FinishStep.java JARStep.java JavaDocStep.java OptionalStep.java ProjectTypeStep.java ProjectSetupStep.java
metasim 01/01/17 14:23:40
Modified: src/antidote/org/apache/tools/ant/gui/wizard/build
ProjectSetupStep.java
Added: src/antidote/org/apache/tools/ant/gui/wizard/build
BuildData.java BuildStateMachine.java
CompileStep.java FinishStep.java JARStep.java
JavaDocStep.java OptionalStep.java
ProjectTypeStep.java
Log:
Added more panels to build wizard, and created state machine framework.
Revision Changes Path
1.2 +80 -8 jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/ProjectSetupStep.java
Index: ProjectSetupStep.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/ProjectSetupStep.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ProjectSetupStep.java 2001/01/16 18:35:40 1.1
+++ ProjectSetupStep.java 2001/01/17 22:23:38 1.2
@@ -58,20 +58,42 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridBagLayout;
-import org.apache.tools.ant.gui.acs.*;
+import java.util.*;
/**
* Build file wizard step for naming the project and
* selecting what features are desired.
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
* @author Simeon Fitch
*/
public class ProjectSetupStep extends AbstractWizardStep {
+ /** ID for compile option. */
+ public static final String COMPILE_OPTION = "compile";
+ /** ID for JAR option. */
+ public static final String JAR_OPTION = "jar";
+ /** ID for JavaDoc option. */
+ public static final String JAVADOC_OPTION = "javadoc";
+
+ /** Available options as an array. */
+ public static final String[] OPTIONS = {
+ COMPILE_OPTION,
+ JAR_OPTION,
+ JAVADOC_OPTION
+ };
+
+ /** Array of the option selections. */
+ private JCheckBox[] _selections = null;
+
+
/** Name of the project. */
private JTextField _name = null;
+ /**
+ * Initialize the screen widgets.
+ *
+ */
protected void init() {
setLayout(new BorderLayout());
@@ -82,11 +104,21 @@
p.add(new JLabel(getResources().getString(getID() + ".nameLabel")));
p.add(_name);
- p = new JPanel(new GridBagLayout());
- p.setBorder(BorderFactory.createTitledBorder(
- getResources().getString(getID() + ".optionsLabel")));
+ p = new JPanel(null);
+ p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
+ p.setBorder(BorderFactory.createCompoundBorder(
+ BorderFactory.createTitledBorder(
+ getResources().getString(getID() + ".optionsLabel")),
+ BorderFactory.createEmptyBorder(5, 10, 5, 10)));
add(p, BorderLayout.CENTER);
+ _selections = new JCheckBox[OPTIONS.length];
+ for(int i = 0; i < OPTIONS.length; i++) {
+ _selections[i] = new JCheckBox(
+ getResources().getString(getID() + "." + OPTIONS[i] + ".label"));
+ _selections[i].setSelected(true);
+ p.add(_selections[i]);
+ }
}
/**
@@ -95,8 +127,17 @@
*
*/
public void updateDisplay() {
- ACSProjectElement project = (ACSProjectElement) getDataModel();
- _name.setText(project.getName());
+ // Name.
+ BuildData data = (BuildData) getDataModel();
+ _name.setText(data.getProjectName());
+
+ // Steps.
+ List steps = data.getOptionalSteps();
+ if(steps != null) {
+ for(int i = 0; i < _selections.length; i++) {
+ _selections[i].setSelected(steps.contains(OPTIONS[i]));
+ }
+ }
}
/**
@@ -105,8 +146,39 @@
*
*/
public void updateDataModel() {
- ACSProjectElement project = (ACSProjectElement) getDataModel();
- project.setName(_name.getText());
+ // Name.
+ BuildData data = (BuildData) getDataModel();
+ data.setProjectName(_name.getText());
+
+ // Steps.
+ List steps = new ArrayList();
+ for(int i = 0; i < _selections.length; i++) {
+ if(_selections[i].isSelected()) {
+ steps.add(OPTIONS[i]);
+ }
+ }
+
+ data.setOptionalSteps(steps);
}
+ /**
+ * Get the id of the next step.
+ *
+ * @return ID of next step.
+ */
+ public String getNext() {
+ return ((BuildStateMachine)getDataModel().getStateMachine()).
+ getNext(this, getDataModel());
+ }
+
+ /**
+ * Get the id of the previous step.
+ *
+ * @return Previous step.
+ */
+ public String getPrevious() {
+ return ((BuildStateMachine)getDataModel().getStateMachine()).
+ getPrevious(this, getDataModel());
+ }
}
+
1.1 jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/BuildData.java
Index: BuildData.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* 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 APACHE SOFTWARE FOUNDATION 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 software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.gui.wizard.build;
import org.apache.tools.ant.gui.wizard.*;
import org.apache.tools.ant.gui.core.ResourceManager;
import org.apache.tools.ant.gui.acs.*;
import java.util.*;
/**
* Data model for the build wizard.
*
* @version $Revision: 1.1 $
* @author Simeon Fitch
*/
public class BuildData implements WizardData {
/** Wizard resources. */
private ResourceManager _resources = new ResourceManager(
"org.apache.tools.ant.gui.resources.buildFileWizard");
private StateMachine _stateMachine = new BuildStateMachine();
private String _name = null;
private boolean _isNewProject = true;
private List _optionalSteps = null;
/**
* Default ctor.
*
*/
public BuildData() {
//_project = ACSFactory.getInstance().createProject();
_optionalSteps = Arrays.asList(ProjectSetupStep.OPTIONS);
}
/**
* Get access to the resources for the wizard.
*
* @return Wizard resources.
*/
public ResourceManager getResources() {
return _resources;
}
/**
* Get the class the determines what the next step should be.
*
* @return State machine.
*/
public StateMachine getStateMachine() {
return _stateMachine;
}
/**
* Get the project name.
*
* @param name Project name.
*/
public void setProjectName(String name) {
_name = name;
}
/**
* Set the project name.
*
* @return Project name.
*/
public String getProjectName() {
return _name;
}
/**
* Set whether or not a new project is being created.
*
* @param isNew True if new project, false if importing a project.
*/
public void setNewProject(boolean isNew) {
_isNewProject = isNew;
}
/**
* Determine if we are creating a new project.
*
* @return True if new project, false if importing a project.
*/
public boolean isNewProject() {
return _isNewProject;
}
/**
* Set the set of optional steps (as IDs) that should be executed.
*
* @param steps Set of optional step IDs.
*/
public void setOptionalSteps(List steps) {
_optionalSteps = steps;
}
/**
* Get the set of optional steps (as IDs) that should be executed.
*
* @return Set of optional step IDs.
*/
public List getOptionalSteps() {
return _optionalSteps;
}
}
1.1 jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/BuildStateMachine.java
Index: BuildStateMachine.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* 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 APACHE SOFTWARE FOUNDATION 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 software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.gui.wizard.build;
import org.apache.tools.ant.gui.wizard.*;
import org.apache.tools.ant.gui.core.ResourceManager;
import java.util.*;
/**
* State machine defining the step ordering for the build wizard.
*
* @version $Revision: 1.1 $
* @author Simeon Fitch
*/
public class BuildStateMachine extends DefaultStateMachine {
private List _optionals = Arrays.asList(ProjectSetupStep.OPTIONS);
/**
* Get the next step.
*
* @param curr The current step.
* @param data The current state of the wizard.
* @return The ID of next step, or null if there currently isn't one.
*/
public String getNext(ProjectSetupStep curr, WizardData data) {
return getFollowingID(super.getNext(curr, data), data, +1);
}
/**
* Get the next step.
*
* @param curr The current step.
* @param data The current state of the wizard.
* @return The ID of next step, or null if there currently isn't one.
*/
public String getNext(OptionalStep curr, WizardData data) {
return getFollowingID(super.getNext(curr, data), data, +1);
}
/**
* Get the previous step.
*
* @param curr The current step.
* @param data The current state of the wizard.
* @return The ID of previous step, or null if there currently isn't one.
*/
public String getPrevious(OptionalStep curr, WizardData data) {
return getFollowingID(super.getPrevious(curr, data), data, -1);
}
/**
* Get the previous step.
*
* @param curr The current step.
* @param data The current state of the wizard.
* @return The ID of previous step, or null if there currently isn't one.
*/
public String getPrevious(FinishStep curr, WizardData data) {
return getFollowingID(super.getPrevious(curr, data), data, -1);
}
/**
* Figure out which ID should follow the given one based on the current
* state setting of the optional steps.
*
* @param curr ID of the current step.
* @param data State data.
* @param direction +1 for next, -1 for previous.
* @return The ID to follow, or null if none.
*/
private String getFollowingID(String curr, WizardData data, int direction) {
String follow = curr;
List steps = getStepList(data);
List setting = ((BuildData)data).getOptionalSteps();
while(follow != null && _optionals.contains(follow) &&
!setting.contains(follow)) {
int index = steps.indexOf(follow) + direction;
if(index >= 0 && index < steps.size()) {
follow = (String) steps.get(index);
}
else {
follow = null;
}
}
return follow;
}
}
1.1 jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/CompileStep.java
Index: CompileStep.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* 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 APACHE SOFTWARE FOUNDATION 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 software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.gui.wizard.build;
import org.apache.tools.ant.gui.wizard.AbstractWizardStep;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
*
*
* @version $Revision: 1.1 $
* @author Simeon Fitch
*/
public class CompileStep extends AbstractWizardStep implements OptionalStep {
/**
* Initialize the display.
*
*/
protected void init() {
}
/**
* Called when the step should refresh its display based on the
* current model setting.
*
*/
public void updateDisplay() {
BuildData data = (BuildData) getDataModel();
}
/**
* Called when the step should update the data model based on the
* settings of its widgets.
*
*/
public void updateDataModel() {
BuildData data = (BuildData) getDataModel();
}
/**
* Get the id of the next step.
*
* @return ID of next step.
*/
public String getNext() {
return ((BuildStateMachine)getDataModel().getStateMachine()).
getNext(this, getDataModel());
}
/**
* Get the id of the previous step.
*
* @return Previous step.
*/
public String getPrevious() {
return ((BuildStateMachine)getDataModel().getStateMachine()).
getPrevious(this, getDataModel());
}
}
1.1 jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/FinishStep.java
Index: FinishStep.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* 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 APACHE SOFTWARE FOUNDATION 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 software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.gui.wizard.build;
import org.apache.tools.ant.gui.wizard.InstructionStep;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
*
*
* @version $Revision: 1.1 $
* @author Simeon Fitch
*/
public class FinishStep extends InstructionStep {
/**
* Called when the step should refresh its display based on the
* current model setting.
*
*/
public void updateDisplay() {
BuildData data = (BuildData) getDataModel();
}
/**
* Called when the step should update the data model based on the
* settings of its widgets.
*
*/
public void updateDataModel() {
BuildData data = (BuildData) getDataModel();
}
/**
* Get the id of the next step.
*
* @return ID of next step.
*/
public String getNext() {
return ((BuildStateMachine)getDataModel().getStateMachine()).
getNext(this, getDataModel());
}
/**
* Get the id of the previous step.
*
* @return Previous step.
*/
public String getPrevious() {
return ((BuildStateMachine)getDataModel().getStateMachine()).
getPrevious(this, getDataModel());
}
}
1.1 jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/JARStep.java
Index: JARStep.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* 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 APACHE SOFTWARE FOUNDATION 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 software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.gui.wizard.build;
import org.apache.tools.ant.gui.wizard.AbstractWizardStep;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
*
*
* @version $Revision: 1.1 $
* @author Simeon Fitch
*/
public class JARStep extends AbstractWizardStep implements OptionalStep {
/**
* Initialize the display.
*
*/
protected void init() {
}
/**
* Called when the step should refresh its display based on the
* current model setting.
*
*/
public void updateDisplay() {
BuildData data = (BuildData) getDataModel();
}
/**
* Called when the step should update the data model based on the
* settings of its widgets.
*
*/
public void updateDataModel() {
BuildData data = (BuildData) getDataModel();
}
/**
* Get the id of the next step.
*
* @return ID of next step.
*/
public String getNext() {
return ((BuildStateMachine)getDataModel().getStateMachine()).
getNext(this, getDataModel());
}
/**
* Get the id of the previous step.
*
* @return Previous step.
*/
public String getPrevious() {
return ((BuildStateMachine)getDataModel().getStateMachine()).
getPrevious(this, getDataModel());
}
}
1.1 jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/JavaDocStep.java
Index: JavaDocStep.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* 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 APACHE SOFTWARE FOUNDATION 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 software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.gui.wizard.build;
import org.apache.tools.ant.gui.wizard.AbstractWizardStep;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
*
*
* @version $Revision: 1.1 $
* @author Simeon Fitch
*/
public class JavaDocStep extends AbstractWizardStep implements OptionalStep {
/**
* Initialize the display.
*
*/
protected void init() {
}
/**
* Called when the step should refresh its display based on the
* current model setting.
*
*/
public void updateDisplay() {
BuildData data = (BuildData) getDataModel();
}
/**
* Called when the step should update the data model based on the
* settings of its widgets.
*
*/
public void updateDataModel() {
BuildData data = (BuildData) getDataModel();
}
/**
* Get the id of the next step.
*
* @return ID of next step.
*/
public String getNext() {
return ((BuildStateMachine)getDataModel().getStateMachine()).
getNext(this, getDataModel());
}
/**
* Get the id of the previous step.
*
* @return Previous step.
*/
public String getPrevious() {
return ((BuildStateMachine)getDataModel().getStateMachine()).
getPrevious(this, getDataModel());
}
}
1.1 jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/OptionalStep.java
Index: OptionalStep.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* 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 APACHE SOFTWARE FOUNDATION 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 software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.gui.wizard.build;
import org.apache.tools.ant.gui.wizard.WizardStep;
/**
* A tagging interface for optional steps to make virtual dispatching easier.
*
* @version $Revision: 1.1 $
* @author Simeon Fitch
*/
interface OptionalStep extends WizardStep {
}
1.1 jakarta-ant/src/antidote/org/apache/tools/ant/gui/wizard/build/ProjectTypeStep.java
Index: ProjectTypeStep.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* 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 APACHE SOFTWARE FOUNDATION 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 software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.gui.wizard.build;
import org.apache.tools.ant.gui.wizard.AbstractWizardStep;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import org.apache.tools.ant.gui.acs.*;
import java.util.*;
/**
* Step for selecting whether a new project is being created, or
* if an existing one is being imported.
*
* @version $Revision: 1.1 $
* @author Simeon Fitch
*/
public class ProjectTypeStep extends AbstractWizardStep {
private JRadioButton _isNew = null;
private JRadioButton _isImport = null;
/**
* Initialize the display.
*
*/
protected void init() {
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
ButtonGroup group = new ButtonGroup();
_isNew = new JRadioButton(
getResources().getString(getID() + ".isNewLabel"));
group.add(_isNew);
add(_isNew);
_isImport = new JRadioButton(
getResources().getString(getID() + ".isImportLabel"));
group.add(_isImport);
add(_isImport);
// XXX Not implemented yet.
_isImport.setEnabled(false);
_isImport.setToolTipText("Not implemented yet.");
}
/**
* Called when the step should refresh its display based on the
* current model setting.
*
*/
public void updateDisplay() {
BuildData data = (BuildData) getDataModel();
_isNew.setSelected(data.isNewProject());
}
/**
* Called when the step should update the data model based on the
* settings of its widgets.
*
*/
public void updateDataModel() {
BuildData data = (BuildData) getDataModel();
data.setNewProject(_isNew.isSelected());
}
}