/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Task to allow the user to control langtools tools built when using NetBeans.
*
* There are two primary modes.
* 1) Property mode. In this mode, property names are provided to get values
* that may be specified by the user, either directly in a GUI dialog, or
* read from a properties file. If the GUI dialog is invoked, values may
* optionally be set for future use.
* 2) Setup mode. In this mode, no property names are provided, and the GUI
* is invoked to allow the user to set or reset values for use in property mode.
*/
/**
* Set the location of the private properties file used to keep the retain
* user preferences for this repository.
*/
this.propertyFile = propertyFile;
}
/**
* Set the name of the property which will be set to the name of the
* selected tool, if any. If no tool is selected, the property will
* remain unset.
*/
this.toolProperty = toolProperty;
}
/**
* Set the name of the property which will be set to the execution args of the
* selected tool, if any. The args default to an empty string.
*/
this.argsProperty = argsProperty;
}
/**
* Specify whether or not to pop up a dialog if the user has not specified
* a default value for a property.
*/
this.askIfUnset = askIfUnset;
}
public void execute() {
Project p = getProject();
}
if (toolProperty == null ||
}
// finally, return required values, if any
}
}
if (defaultCheck.isSelected()) {
} else {
}
}
}
if (true || toolProperty == null) {
// include empty value in setup mode
}
public void itemStateChanged(ItemEvent e) {
if (toolProperty != null)
}
});
public void focusGained(FocusEvent e) {
}
public void focusLost(FocusEvent e) {
}
});
}
if (toolProperty == null)
defaultCheck.setSelected(true);
else
public void actionPerformed(ActionEvent e) {
d.setVisible(false);
}
});
return p;
}
Properties p = new Properties();
try {
} catch (IOException e) {
throw new BuildException("error reading property file", e);
} finally {
try {
} catch (IOException e) {
throw new BuildException("cannot close property file", e);
}
}
}
}
return p;
}
try {
} catch (IOException e) {
throw new BuildException("error writing property file", e);
} finally {
try {
} catch (IOException e) {
throw new BuildException("cannot close property file", e);
}
}
}
}
}
}
// Ant task parameters
private boolean askIfUnset;
// GUI components
// Result values for the client
}