default outputpath

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1361 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
alfred 2006-08-23 08:49:19 +00:00
parent f78797d5b7
commit ac62aa9ad8
4 changed files with 18 additions and 12 deletions

View File

@ -22,6 +22,7 @@ public final class Common {
public static final int FILE = 1; public static final int FILE = 1;
public static final int DIR = 2; public static final int DIR = 2;
public static final String strseparate = "(.*)\\\\([^\\\\]*)";
public static final Pattern ptnseparate = Pattern.compile("(.*)\\\\([^\\\\]*)"); public static final Pattern ptnseparate = Pattern.compile("(.*)\\\\([^\\\\]*)");
//-------------------------------------regex------------------------------------------// //-------------------------------------regex------------------------------------------//

View File

@ -202,7 +202,8 @@ public final class Critic {
} }
public static final void fireAt(String path) throws Exception { public static final void fireAt(String path) throws Exception {
Common.toDoAll(Common.dirCopy_(path), Critic.class.getMethod("critic", String.class), null, null, Common.FILE); //Common.toDoAll(Common.dirCopy_(path), Critic.class.getMethod("critic", String.class), null, null, Common.FILE);
Common.toDoAll(path, Critic.class.getMethod("critic", String.class), null, null, Common.FILE);
//Common.toDoAll(Common.dirCopy_(path), critic, Common.FILE); //Common.toDoAll(Common.dirCopy_(path), critic, Common.FILE);
System.out.println("Critic Done"); System.out.println("Critic Done");
} }

View File

@ -73,6 +73,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
defaultpathbox = new JCheckBox("Use Default Output Path", true); defaultpathbox = new JCheckBox("Use Default Output Path", true);
defaultpathbox.addItemListener(this); defaultpathbox.addItemListener(this);
ModuleInfo.defaultoutput = true;
JPanel modulePanel = new JPanel(); JPanel modulePanel = new JPanel();
modulePanel.add(moduleButton); modulePanel.add(moduleButton);
@ -218,16 +219,14 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
} else if (e.getSource() == criticbox) { } else if (e.getSource() == criticbox) {
if (e.getStateChange() == ItemEvent.DESELECTED) { if (e.getStateChange() == ItemEvent.DESELECTED) {
ModuleInfo.doCritic = false; ModuleInfo.doCritic = false;
System.out.println("criticbox DESELECTED");
} else if (e.getStateChange() == ItemEvent.SELECTED) { } else if (e.getStateChange() == ItemEvent.SELECTED) {
ModuleInfo.doCritic = true; ModuleInfo.doCritic = true;
System.out.println("criticbox SELECTED");
} }
} else if (e.getSource() == defaultpathbox) { } else if (e.getSource() == defaultpathbox) {
if (e.getStateChange() == ItemEvent.DESELECTED) { if (e.getStateChange() == ItemEvent.DESELECTED) {
System.out.println("defaultpathbox DESELECTED"); ModuleInfo.defaultoutput = false;
} else if (e.getStateChange() == ItemEvent.SELECTED) { } else if (e.getStateChange() == ItemEvent.SELECTED) {
System.out.println("defaultpathbox SELECTED"); ModuleInfo.defaultoutput = true;
} }
} }
} }

View File

@ -23,11 +23,15 @@ public class ModuleInfo {
ModuleInfo(String modulepath) throws Exception { ModuleInfo(String modulepath) throws Exception {
this.modulepath = modulepath; this.modulepath = modulepath;
ModuleInfo.ui.println("Choose where to place the result"); if (ModuleInfo.defaultoutput) {
if ((outputpath = ModuleInfo.ui.getFilepath()) == null) { this.outputpath = this.modulepath.replaceAll(Common.strseparate, "$1");
outputpath = modulepath; } else {
ModuleInfo.ui.println("Choose where to place the result");
if ((outputpath = ModuleInfo.ui.getFilepath()) == null) {
outputpath = modulepath;
}
ModuleInfo.ui.println("Output to: " + outputpath);
} }
ModuleInfo.ui.println(outputpath);
} }
public String modulepath = null; public String modulepath = null;
@ -67,7 +71,7 @@ public class ModuleInfo {
} }
} }
private static final boolean isModule(String path) { public static final boolean isModule(String path) {
String[] list = new File(path).list(); String[] list = new File(path).list();
for (int i = 0 ; i < list.length ; i++) { for (int i = 0 ; i < list.length ; i++) {
if (!new File(list[i]).isDirectory()) { if (!new File(list[i]).isDirectory()) {
@ -112,8 +116,8 @@ public class ModuleInfo {
ModuleInfo.ui.println("Errors Left : " + ModuleInfo.db.error); ModuleInfo.ui.println("Errors Left : " + ModuleInfo.db.error);
ModuleInfo.ui.println("Complete!"); ModuleInfo.ui.println("Complete!");
ModuleInfo.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result"); //ModuleInfo.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result");
ModuleInfo.ui.println("Your logfile was placed here: " + mi.modulepath); //ModuleInfo.ui.println("Your logfile was placed here: " + mi.modulepath);
} }
private static final void show(Set<String> hash, String show) { private static final void show(Set<String> hash, String show) {
@ -140,6 +144,7 @@ public class ModuleInfo {
public static boolean printModuleInfo = false; public static boolean printModuleInfo = false;
public static boolean doCritic = false; public static boolean doCritic = false;
public static boolean defaultoutput = false;
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
ui = FirstPanel.init(); ui = FirstPanel.init();