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/10 21:46:52 UTC
cvs commit: jakarta-ant/src/antidote/org/apache/tools/ant/gui/command NewProjectCmd.java LoadFileCmd.java
metasim 01/01/10 12:46:52
Modified: src/antidote/org/apache/tools/ant/gui/command
LoadFileCmd.java
Added: src/antidote/org/apache/tools/ant/gui/command
NewProjectCmd.java
Log:
Added full support for multiple projects open at the same time. Each project
appears as an entry in the "Projects" menu.
Revision Changes Path
1.9 +3 -3 jakarta-ant/src/antidote/org/apache/tools/ant/gui/command/LoadFileCmd.java
Index: LoadFileCmd.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/command/LoadFileCmd.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- LoadFileCmd.java 2001/01/08 19:43:22 1.8
+++ LoadFileCmd.java 2001/01/10 20:46:51 1.9
@@ -54,7 +54,7 @@
package org.apache.tools.ant.gui.command;
import org.apache.tools.ant.gui.core.AppContext;
import org.apache.tools.ant.gui.event.ErrorEvent;
-import org.apache.tools.ant.gui.event.ProjectSelectedEvent;
+import org.apache.tools.ant.gui.event.NewProjectEvent;
import org.apache.tools.ant.gui.acs.ACSProjectElement;
import java.io.File;
import java.io.IOException;
@@ -62,7 +62,7 @@
/**
* Command for reading in a build file and initializing the data model.
*
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
* @author Simeon Fitch
*/
public class LoadFileCmd extends AbstractCommand {
@@ -104,7 +104,7 @@
ACSProjectElement project =
getContext().getProjectManager().open(_file);
getContext().getEventBus().postEvent(
- new ProjectSelectedEvent(getContext(), project));
+ new NewProjectEvent(getContext(), project));
}
catch(Exception ex) {
String message = getContext().getResources().getMessage(
1.1 jakarta-ant/src/antidote/org/apache/tools/ant/gui/command/NewProjectCmd.java
Index: NewProjectCmd.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.command;
import org.apache.tools.ant.gui.core.AppContext;
/**
* Command for creating a new project.
*
* @version $Revision: 1.1 $
* @author Simeon Fitch
*/
public class NewProjectCmd extends AbstractCommand {
/**
* Standard ctor.
*
* @param context Application context.
*/
public NewProjectCmd(AppContext context) {
super(context);
}
/**
* Display a dialog asking the user to select a file to open.
* If one is selected then an event is posted requesting the open
* operation be completed.
*
*/
public void run() {
/*
FileFilter filter = new XMLFileFilter(getContext().getResources());
JFileChooser chooser = new JFileChooser();
chooser.addChoosableFileFilter(filter);
int val = chooser.showOpenDialog(getContext().getParentFrame());
if(val == JFileChooser.APPROVE_OPTION) {
File selected = chooser.getSelectedFile();
getContext().getEventBus().postEvent(
new OpenRequestEvent(getContext(), selected));
}
*/
}
}