import javax.swing.table.TableModel;\r
\r
import org.tianocore.frameworkwizard.common.DataType;\r
+import org.tianocore.frameworkwizard.common.IFileFilter;\r
import org.tianocore.frameworkwizard.common.Log;\r
import org.tianocore.frameworkwizard.common.Tools;\r
import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigId;\r
\r
if (arg0.getSource() == jButtonOpen) {\r
JFileChooser fc = new JFileChooser();\r
- fc.setAcceptAllFileFilterUsed(true);\r
+ fc.setAcceptAllFileFilterUsed(false);\r
+ IFileFilter iff = new IFileFilter(DataType.TEXT_FILE_EXT);\r
+ fc.addChoosableFileFilter(iff);\r
fc.setCurrentDirectory(new File(toolsDir));\r
\r
int result = fc.showOpenDialog(new JPanel());\r
currentFile = fc.getSelectedFile().getPath();\r
this.setTitle("Tool Chain Configuration" + " [" + currentFile + "]");\r
} catch (IOException e) {\r
+ Log.wrn(this.currentFile + "Read Error", e.getMessage());\r
Log.err(this.currentFile + "Read Error", e.getMessage());\r
- e.printStackTrace();\r
return;\r
}\r
this.showTable();\r
\r
if (arg0.getSource() == jButtonSave) {\r
JFileChooser fc = new JFileChooser();\r
- fc.setAcceptAllFileFilterUsed(true);\r
- fc.setSelectedFile(new File(currentFile));\r
+ fc.setAcceptAllFileFilterUsed(false);\r
+ IFileFilter iff = new IFileFilter(DataType.TEXT_FILE_EXT);\r
+ fc.addChoosableFileFilter(iff);\r
+ fc.setCurrentDirectory(new File(toolsDir));\r
\r
int result = fc.showSaveDialog(new JPanel());\r
if (result == JFileChooser.APPROVE_OPTION) {\r
try {\r
vtcc.saveFile(currentFile);\r
} catch (IOException e) {\r
+ Log.wrn(this.currentFile + "Write Error", e.getMessage());\r
Log.err(this.currentFile + "Write Error", e.getMessage());\r
- e.printStackTrace();\r
return;\r
}\r
}\r
**/\r
private boolean check() {\r
if (isEmpty(this.jTextFieldName.getText())) {\r
- Log.err("Add Tool Chain", "Name couldn't be empty!");\r
+ Log.wrn("Add Tool Chain", "Name couldn't be empty!");\r
return false;\r
}\r
\r
if (isEmpty(this.jTextFieldValue.getText())) {\r
- Log.err("Add Tool Chain", "Value couldn't be empty");\r
+ Log.wrn("Add Tool Chain", "Value couldn't be empty");\r
return false;\r
}\r
return true;\r