001: /*
002: * This file is part of the Echo Web Application Framework (hereinafter "Echo").
003: * Copyright (C) 2002-2005 NextApp, Inc.
004: *
005: * Version: MPL 1.1/GPL 2.0/LGPL 2.1
006: *
007: * The contents of this file are subject to the Mozilla Public License Version
008: * 1.1 (the "License"); you may not use this file except in compliance with
009: * the License. You may obtain a copy of the License at
010: * http://www.mozilla.org/MPL/
011: *
012: * Software distributed under the License is distributed on an "AS IS" basis,
013: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
014: * for the specific language governing rights and limitations under the
015: * License.
016: *
017: * Alternatively, the contents of this file may be used under the terms of
018: * either the GNU General Public License Version 2 or later (the "GPL"), or
019: * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
020: * in which case the provisions of the GPL or the LGPL are applicable instead
021: * of those above. If you wish to allow use of your version of this file only
022: * under the terms of either the GPL or the LGPL, and not to allow others to
023: * use your version of this file under the terms of the MPL, indicate your
024: * decision by deleting the provisions above and replace them with the notice
025: * and other provisions required by the GPL or the LGPL. If you do not delete
026: * the provisions above, a recipient may use your version of this file under
027: * the terms of any one of the MPL, the GPL or the LGPL.
028: */
029:
030: package nextapp.echo2.webcontainer.command;
031:
032: import nextapp.echo2.app.Command;
033:
034: /**
035: * A Web Application Container-specific <code>Command</code> to
036: * open a new browser window displaying a specific URI.
037: * This action may not be performed on a client if the client has
038: * pop-up blocking enabled.
039: */
040: public class BrowserOpenWindowCommand implements Command {
041:
042: private String uri;
043: private String features;
044: private String name;
045: private boolean replace;
046:
047: /**
048: * Creates a new <code>BrowserOpenWindowCommand</code>.
049: *
050: * @param uri the target URI
051: * @param name the window name (may be null)
052: * @param features the 'features' string which will be used to configure the
053: * new browser window (may be null)
054: */
055: public BrowserOpenWindowCommand(String uri, String name,
056: String features) {
057: this (uri, name, features, false);
058: }
059:
060: /**
061: * Creates a new <code>BrowserOpenWindowCommand</code>.
062: *
063: * @param uri the target URI
064: * @param name the window name (may be null)
065: * @param features the 'features' string which will be used to configure the
066: * new browser window (may be null)
067: * @param replace a flag indicating whether the new URI should replace the
068: * previous URI in the window's history. This flag is only relevant
069: * when using this command to replace a browser window.
070: */
071: public BrowserOpenWindowCommand(String uri, String name,
072: String features, boolean replace) {
073: super ();
074: this .uri = uri;
075: this .name = name;
076: this .features = features;
077: }
078:
079: /**
080: * Returns the 'features' string which will be used to configure the
081: * new browser window.
082: *
083: * @return features the 'features' string
084: */
085: public String getFeatures() {
086: return features;
087: }
088:
089: /**
090: * Returns the window name.
091: *
092: * @return the window name
093: */
094: public String getName() {
095: return name;
096: }
097:
098: /**
099: * Returns the target URI.
100: *
101: * @return the target URI
102: */
103: public String getUri() {
104: return uri;
105: }
106:
107: /**
108: * Determines if the new URI should replace the old one in the history.
109: *
110: * @return true if the new URI should replace the old one in the history
111: */
112: public boolean isReplace() {
113: return replace;
114: }
115: }
|