mirror of https://github.com/acidanthera/audk.git
editable comment style
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1407 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6ae1510e52
commit
e3e8956d13
|
@ -29,7 +29,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
|
|||
private String startpath;
|
||||
private ModuleInfo mi;
|
||||
|
||||
private JButton moduleButton, goButton, msaEditorButton, criticButton;
|
||||
private JButton moduleButton, goButton, msaEditorButton, criticButton, specifyCommentButton;
|
||||
private JTextField moduletext;
|
||||
private JTextArea log;
|
||||
private JFileChooser fc;
|
||||
|
@ -57,6 +57,9 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
|
|||
criticButton = new JButton("Critic");
|
||||
criticButton.addActionListener(this);
|
||||
|
||||
specifyCommentButton = new JButton("Comment Style");
|
||||
specifyCommentButton.addActionListener(this);
|
||||
|
||||
moduletext = new JTextField(30);
|
||||
|
||||
filebox = new JCheckBox("Output to logfile", true);
|
||||
|
@ -90,7 +93,9 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
|
|||
|
||||
cst.gridx = 1;
|
||||
cst.gridy = 0;
|
||||
gridbag.setConstraints(criticButton, cst);
|
||||
gridbag.setConstraints(specifyCommentButton, cst);
|
||||
add(specifyCommentButton);
|
||||
//gridbag.setConstraints(criticButton, cst);
|
||||
//add(criticButton);
|
||||
|
||||
JPanel checkboxPanel = new JPanel();
|
||||
|
@ -199,6 +204,13 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
|
|||
println(en.getMessage());
|
||||
}
|
||||
}
|
||||
if ( e.getSource() == specifyCommentButton) {
|
||||
try { // input examine is not imposed but should be added
|
||||
MigrationTool.MIGRATIONCOMMENT = getInput("Please type in wanted comment style used by the tool\nbe sure to start with '//', or you won't enjoy the result");
|
||||
} catch (Exception en) {
|
||||
println(en.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
|
|
|
@ -7,7 +7,7 @@ public class MigrationTool {
|
|||
public static UI ui = null;
|
||||
public static Database db = null;
|
||||
|
||||
public static final String MIGRATIONCOMMENT = "//%$//";
|
||||
public static String MIGRATIONCOMMENT = "//%$//";
|
||||
|
||||
public static boolean printModuleInfo = false;
|
||||
public static boolean doCritic = false;
|
||||
|
|
|
@ -136,6 +136,16 @@ public final class ModuleReader {
|
|||
rd = new BufferedReader(new FileReader(mi.modulepath + File.separator + curFile));
|
||||
Common.ensureDir(mi.modulepath + File.separator + "temp" + File.separator + curFile);
|
||||
outfile = new PrintWriter(new BufferedWriter(new FileWriter(mi.modulepath + File.separator + "temp" + File.separator + curFile)));
|
||||
|
||||
/*
|
||||
if (curFile.contains(".dxs")) {
|
||||
if (mi.moduletype.contains("PEI")) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
while ((line = rd.readLine()) != null) {
|
||||
if (line.contains("#include")) {
|
||||
mtrinclude = ptninclude.matcher(line);
|
||||
|
@ -148,6 +158,7 @@ public final class ModuleReader {
|
|||
}
|
||||
outfile.flush();
|
||||
outfile.close();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue