langtools/make/tools/anttasks/SelectToolTask.java
author mchung
Sat, 17 Jun 2017 11:50:42 -0700
changeset 45670 2b0b8cd704d4
parent 42827 36468b5fa7f4
permissions -rw-r--r--
8182416: Clean up module-info.java like move requires transitive adjacent to exports Reviewed-by: alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
     1
/*
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33362
diff changeset
     2
 * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
     4
 *
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    10
 *
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    15
 * accompanied this code).
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    16
 *
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
    23
 * questions.
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    24
 */
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    25
12085
ce2780cb121f 7150579: Moved ant code into a separate package, anttasks.
ohrstrom
parents: 5520
diff changeset
    26
package anttasks;
ce2780cb121f 7150579: Moved ant code into a separate package, anttasks.
ohrstrom
parents: 5520
diff changeset
    27
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    28
import java.awt.GridBagConstraints;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    29
import java.awt.GridBagLayout;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    30
import java.awt.event.ActionEvent;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    31
import java.awt.event.ActionListener;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    32
import java.awt.event.FocusEvent;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    33
import java.awt.event.FocusListener;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    34
import java.awt.event.ItemEvent;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    35
import java.awt.event.ItemListener;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    36
import java.io.BufferedReader;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    37
import java.io.BufferedWriter;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    38
import java.io.File;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    39
import java.io.FileReader;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    40
import java.io.FileWriter;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    41
import java.io.IOException;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    42
import java.io.Reader;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    43
import java.io.Writer;
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    44
import java.util.EnumSet;
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    45
import java.util.Properties;
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
    46
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    47
import javax.swing.JButton;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    48
import javax.swing.JCheckBox;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    49
import javax.swing.JComboBox;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    50
import javax.swing.JDialog;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    51
import javax.swing.JLabel;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    52
import javax.swing.JOptionPane;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    53
import javax.swing.JPanel;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    54
import javax.swing.JTextField;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    55
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    56
import javax.swing.SwingUtilities;
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
    57
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    58
import org.apache.tools.ant.BuildException;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    59
import org.apache.tools.ant.Project;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    60
import org.apache.tools.ant.Task;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    61
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    62
/**
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    63
 * Task to allow the user to control langtools tools built when using NetBeans.
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    64
 *
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    65
 * There are two primary modes.
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    66
 * 1) Property mode. In this mode, property names are provided to get values
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    67
 * that may be specified by the user, either directly in a GUI dialog, or
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    68
 * read from a properties file. If the GUI dialog is invoked, values may
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    69
 * optionally be set for future use.
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    70
 * 2) Setup mode. In this mode, no property names are provided, and the GUI
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    71
 * is invoked to allow the user to set or reset values for use in property mode.
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    72
 */
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
    73
public class SelectToolTask extends Task {
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    74
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    75
    enum ToolChoices {
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    76
        NONE(""),
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33362
diff changeset
    77
        JAVAC("javac"),
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    78
        JAVADOC("javadoc"),
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    79
        JAVAH("javah"),
33362
65ec6de1d6b4 8134254: JShell API/tool: REPL for Java into JDK9
jlahoda
parents: 27546
diff changeset
    80
        JAVAP("javap"),
65ec6de1d6b4 8134254: JShell API/tool: REPL for Java into JDK9
jlahoda
parents: 27546
diff changeset
    81
        JSHELL("jshell");
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    82
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    83
        String toolName;
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    84
        boolean bootstrap;
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    85
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    86
        ToolChoices(String toolName) {
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    87
            this(toolName, false);
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    88
        }
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    89
20266
d5e2fc28504e 8025139: javac patch for using bootstrap compiler for debugging is not working properly
vromero
parents: 19935
diff changeset
    90
        ToolChoices(String toolName, boolean bootstrap) {
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    91
            this.toolName = toolName;
20266
d5e2fc28504e 8025139: javac patch for using bootstrap compiler for debugging is not working properly
vromero
parents: 19935
diff changeset
    92
            this.bootstrap = bootstrap;
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    93
        }
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    94
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    95
        @Override
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    96
        public String toString() {
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    97
            return toolName;
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    98
        }
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
    99
    }
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   100
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   101
    /**
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   102
     * Set the location of the private properties file used to keep the retain
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   103
     * user preferences for this repository.
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
   104
     * @param propertyFile the private properties file
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   105
     */
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   106
    public void setPropertyFile(File propertyFile) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   107
        this.propertyFile = propertyFile;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   108
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   109
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   110
    /**
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   111
     * Set the name of the property which will be set to the name of the
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   112
     * selected tool, if any. If no tool is selected, the property will
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   113
     * remain unset.
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
   114
     * @param toolProperty the tool name property
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   115
     */
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   116
    public void setToolProperty(String toolProperty) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   117
        this.toolProperty = toolProperty;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   118
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   119
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   120
    /**
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   121
     * Set the name of the property which will be set to the execution args of the
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   122
     * selected tool, if any. The args default to an empty string.
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
   123
     * @param argsProperty the execution args property value
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   124
     */
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   125
    public void setArgsProperty(String argsProperty) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   126
        this.argsProperty = argsProperty;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   127
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   128
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   129
    /**
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   130
     * Specify whether or not to pop up a dialog if the user has not specified
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   131
     * a default value for a property.
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
   132
     * @param askIfUnset a boolean flag indicating to prompt the user or not
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   133
     */
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   134
    public void setAskIfUnset(boolean askIfUnset) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   135
        this.askIfUnset = askIfUnset;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   136
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   137
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   138
    @Override
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   139
    public void execute() {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   140
        Project p = getProject();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   141
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   142
        Properties props = readProperties(propertyFile);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   143
        toolName = props.getProperty("tool.name");
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   144
        if (toolName != null) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   145
            toolArgs = props.getProperty(toolName + ".args", "");
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   146
        }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   147
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   148
        if (toolProperty == null ||
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   149
            askIfUnset && (toolName == null
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   150
                || (argsProperty != null && toolArgs == null))) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   151
            showGUI(props);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   152
        }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   153
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   154
        // finally, return required values, if any
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   155
        if (toolProperty != null && !(toolName == null || toolName.equals(""))) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   156
            p.setProperty(toolProperty, toolName);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   157
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   158
            if (argsProperty != null && toolArgs != null)
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   159
                p.setProperty(argsProperty, toolArgs);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   160
        }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   161
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   162
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   163
    void showGUI(Properties fileProps) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   164
        Properties guiProps = new Properties(fileProps);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   165
        JOptionPane p = createPane(guiProps);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   166
        p.createDialog("Select Tool").setVisible(true);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   167
27546
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   168
        ToolChoices tool = (ToolChoices)toolChoice.getSelectedItem();
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   169
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33362
diff changeset
   170
        toolName = tool.toolName;
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   171
        toolArgs = argsField.getText();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   172
        if (defaultCheck.isSelected()) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   173
            if (toolName.equals("")) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   174
                fileProps.remove("tool.name");
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   175
                fileProps.remove("tool.bootstrap");
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   176
            } else {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33362
diff changeset
   177
                fileProps.remove("tool.bootstrap");
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   178
                fileProps.put("tool.name", toolName);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   179
                fileProps.put(toolName + ".args", toolArgs);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   180
            }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   181
            writeProperties(propertyFile, fileProps);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   182
        }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   183
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   184
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   185
    JOptionPane createPane(final Properties props) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   186
        JPanel body = new JPanel(new GridBagLayout());
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   187
        GridBagConstraints lc = new GridBagConstraints();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   188
        lc.insets.right = 10;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   189
        lc.insets.bottom = 3;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   190
        GridBagConstraints fc = new GridBagConstraints();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   191
        fc.gridx = 1;
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   192
        fc.gridwidth = GridBagConstraints.NONE;
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   193
        fc.insets.bottom = 3;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   194
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   195
        JPanel toolPane = new JPanel(new GridBagLayout());
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   196
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   197
        JLabel toolLabel = new JLabel("Tool:");
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   198
        body.add(toolLabel, lc);
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   199
        EnumSet<ToolChoices> toolChoices = toolProperty == null ?
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   200
                EnumSet.allOf(ToolChoices.class) : EnumSet.range(ToolChoices.JAVAC, ToolChoices.JAVAP);
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
   201
        toolChoice = new JComboBox<>(toolChoices.toArray());
27546
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   202
        ToolChoices tool = toolName != null ? ToolChoices.valueOf(toolName.toUpperCase()) : null;
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   203
        if (toolName != null) {
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   204
            toolChoice.setSelectedItem(tool);
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   205
        }
42827
36468b5fa7f4 8181370: Convert anonymous inner classes into lambdas/method references
mcimadamore
parents: 36526
diff changeset
   206
        toolChoice.addItemListener(e -> {
36468b5fa7f4 8181370: Convert anonymous inner classes into lambdas/method references
mcimadamore
parents: 36526
diff changeset
   207
            ToolChoices tool1 = (ToolChoices)e.getItem();
36468b5fa7f4 8181370: Convert anonymous inner classes into lambdas/method references
mcimadamore
parents: 36526
diff changeset
   208
            argsField.setText(getDefaultArgsForTool(props, tool1));
36468b5fa7f4 8181370: Convert anonymous inner classes into lambdas/method references
mcimadamore
parents: 36526
diff changeset
   209
            if (toolProperty != null)
36468b5fa7f4 8181370: Convert anonymous inner classes into lambdas/method references
mcimadamore
parents: 36526
diff changeset
   210
                okButton.setEnabled(tool1 != ToolChoices.NONE);
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   211
        });
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   212
        fc.anchor = GridBagConstraints.EAST;
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   213
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   214
        GridBagConstraints toolConstraint = new GridBagConstraints();
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   215
        fc.anchor = GridBagConstraints.WEST;
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   216
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   217
        toolPane.add(toolChoice, toolConstraint);
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   218
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   219
        body.add(toolPane, fc);
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   220
27546
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   221
        argsField = new JTextField(getDefaultArgsForTool(props, tool), 40);
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   222
        if (toolProperty == null || argsProperty != null) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   223
            JLabel argsLabel = new JLabel("Args:");
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   224
            body.add(argsLabel, lc);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   225
            body.add(argsField, fc);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   226
            argsField.addFocusListener(new FocusListener() {
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
   227
                @Override
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   228
                public void focusGained(FocusEvent e) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   229
                }
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
   230
                @Override
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   231
                public void focusLost(FocusEvent e) {
19935
8f2c828192c3 8024414: javac, should facilitate the use of the bootstrap compiler for debugging
mcimadamore
parents: 13631
diff changeset
   232
                    String toolName = ((ToolChoices)toolChoice.getSelectedItem()).toolName;
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   233
                    if (toolName.length() > 0)
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   234
                        props.put(toolName + ".args", argsField.getText());
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   235
                }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   236
            });
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   237
        }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   238
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   239
        defaultCheck = new JCheckBox("Set as default");
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   240
        if (toolProperty == null)
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   241
            defaultCheck.setSelected(true);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   242
        else
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   243
            body.add(defaultCheck, fc);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   244
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   245
        final JOptionPane p = new JOptionPane(body);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   246
        okButton = new JButton("OK");
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   247
        okButton.setEnabled(toolProperty == null || (toolName != null && !toolName.equals("")));
42827
36468b5fa7f4 8181370: Convert anonymous inner classes into lambdas/method references
mcimadamore
parents: 36526
diff changeset
   248
        okButton.addActionListener(e -> {
36468b5fa7f4 8181370: Convert anonymous inner classes into lambdas/method references
mcimadamore
parents: 36526
diff changeset
   249
            JDialog d = (JDialog) SwingUtilities.getAncestorOfClass(JDialog.class, p);
36468b5fa7f4 8181370: Convert anonymous inner classes into lambdas/method references
mcimadamore
parents: 36526
diff changeset
   250
            d.setVisible(false);
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   251
        });
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   252
        p.setOptions(new Object[] { okButton });
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   253
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   254
        return p;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   255
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   256
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   257
    Properties readProperties(File file) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   258
        Properties p = new Properties();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   259
        if (file != null && file.exists()) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   260
            Reader in = null;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   261
            try {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   262
                in = new BufferedReader(new FileReader(file));
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   263
                p.load(in);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   264
                in.close();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   265
            } catch (IOException e) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   266
                throw new BuildException("error reading property file", e);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   267
            } finally {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   268
                if (in != null) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   269
                    try {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   270
                        in.close();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   271
                    } catch (IOException e) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   272
                        throw new BuildException("cannot close property file", e);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   273
                    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   274
                }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   275
            }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   276
        }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   277
        return p;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   278
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   279
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   280
    void writeProperties(File file, Properties p) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   281
        if (file != null) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   282
            Writer out = null;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   283
            try {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   284
                File dir = file.getParentFile();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   285
                if (dir != null && !dir.exists())
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   286
                    dir.mkdirs();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   287
                out = new BufferedWriter(new FileWriter(file));
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   288
                p.store(out, "langtools properties");
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   289
                out.close();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   290
            } catch (IOException e) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   291
                throw new BuildException("error writing property file", e);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   292
            } finally {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   293
                if (out != null) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   294
                    try {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   295
                        out.close();
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   296
                    } catch (IOException e) {
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   297
                        throw new BuildException("cannot close property file", e);
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   298
                    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   299
                }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   300
            }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   301
        }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   302
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   303
27546
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   304
    String getDefaultArgsForTool(Properties props, ToolChoices tool) {
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   305
        if (tool == null)
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   306
            return "";
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33362
diff changeset
   307
        String toolName = tool.toolName;
27546
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   308
        return toolName.equals("") ? "" : props.getProperty(toolName + ".args", "");
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   309
    }
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   310
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   311
    // Ant task parameters
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   312
    private boolean askIfUnset;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   313
    private String toolProperty;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   314
    private String argsProperty;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   315
    private File propertyFile;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   316
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   317
    // GUI components
26268
620556167c08 8038732: [javadoc] NetBeans IDE target does not build doclets
ksrini
parents: 20266
diff changeset
   318
    private JComboBox<?> toolChoice;
1873
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   319
    private JTextField argsField;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   320
    private JCheckBox defaultCheck;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   321
    private JButton okButton;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   322
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   323
    // Result values for the client
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   324
    private String toolName;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   325
    private String toolArgs;
658385834998 6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
diff changeset
   326
}