From: <oms...@us...> - 2006-03-19 01:09:19
|
Revision: 971 Author: omschaub Date: 2006-03-18 17:09:12 -0800 (Sat, 18 Mar 2006) ViewCVS: http://svn.sourceforge.net/azcvsupdater/?rev=971&view=rev Log Message: ----------- Added output Changelog to file feature Modified Paths: -------------- trunk/AZMultiUser/lbms/tools/updater/UpdateCreatorGUI.java Modified: trunk/AZMultiUser/lbms/tools/updater/UpdateCreatorGUI.java =================================================================== --- trunk/AZMultiUser/lbms/tools/updater/UpdateCreatorGUI.java 2006-03-19 01:06:55 UTC (rev 970) +++ trunk/AZMultiUser/lbms/tools/updater/UpdateCreatorGUI.java 2006-03-19 01:09:12 UTC (rev 971) @@ -130,6 +130,7 @@ private File updateCreatorFile; private File currentDir; private Changelog log = new Changelog(); + private JButton writeChangelog; private JScrollPane chTreeScrollPane; private JButton chRemove; private JTree chTree; @@ -1079,7 +1080,7 @@ chRemove = new JButton(); jPanel3.add(chRemove); chRemove.setText("Remove Selected"); - chRemove.setBounds(35, 315, 147, 28); + chRemove.setBounds(35, 312, 147, 28); chRemove.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent arg0) { @@ -1127,7 +1128,40 @@ chTree.setPreferredSize(new java.awt.Dimension(612, 309)); //END << chTree //END << chTreeScrollPane + //START >> writeChangelog + writeChangelog = new JButton(); + jPanel3.add(writeChangelog); + writeChangelog.setText("Write Changelog to File"); + writeChangelog.setBounds(399, 313, 210, 28); + writeChangelog.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent arg0) { + final JFileChooser fc = new JFileChooser(); + fc.setName("Choose Changelog File Save Location"); + if (currentDirFile != null) + fc.setCurrentDirectory(currentDirFile); + else + fc.setCurrentDirectory(new File(".")); + int returnVal = fc.showSaveDialog(jPanel2); + if (returnVal == JFileChooser.APPROVE_OPTION) { + File changelogFile = fc.getSelectedFile(); + + try { + updateCreator.generateChanglogTxt(changelogFile); + } catch (IOException e) { + e.printStackTrace(); + } + + + + + } + + } + + }); + //END << writeChangelog + } } @@ -1149,46 +1183,8 @@ newPackage.setText("New Package"); newPackage.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { + clearAll(); - //Remake the elements - updateCreator = new UpdateCreator(); - update = updateCreator.getUpdate(); - log = new Changelog(); - currentDirFile = null; - updateCreatorFile = null; - - //Clear 1st tab - UpdateCreatorName.setText("Not Selected Yet"); - UpdateCreatorDir.setText("Not Selected Yet"); - UpdateCreatorCompressed.setSelected(false); - - UpdaterImportance.setSelectedIndex(0); - UpdaterType.setSelectedIndex(0); - updaterURL.setText(""); - updateVersion.setText(""); - - //Clear 2nd tab - currentUF = null; - fileListModel.removeAllElements(); - name.setText(""); - path.setText(""); - version.setText(""); - url.setText(""); - hash.setText(""); - TypeCombo.setSelectedIndex(0); - size.setText(""); - - //Clear 3rd Tab - chArea.setText(""); - bugNode = new DefaultMutableTreeNode("BugFixes"); - changeNode = new DefaultMutableTreeNode("Changes"); - featureNode = new DefaultMutableTreeNode("Features"); - rootNode = new DefaultMutableTreeNode("Changelog"); - rootNode.add(bugNode); - rootNode.add(changeNode); - rootNode.add(featureNode); - treeModel = new DefaultTreeModel(rootNode); - chTree.setModel(treeModel); } }); { @@ -1215,4 +1211,46 @@ } } + public void clearAll(){ + //Remake the elements + updateCreator = new UpdateCreator(); + update = updateCreator.getUpdate(); + log = new Changelog(); + currentDirFile = null; + updateCreatorFile = null; + + //Clear 1st tab + UpdateCreatorName.setText("Not Selected Yet"); + UpdateCreatorDir.setText("Not Selected Yet"); + UpdateCreatorCompressed.setSelected(false); + + UpdaterImportance.setSelectedIndex(0); + UpdaterType.setSelectedIndex(0); + updaterURL.setText(""); + updateVersion.setText(""); + + //Clear 2nd tab + currentUF = null; + fileListModel.removeAllElements(); + name.setText(""); + path.setText(""); + version.setText(""); + url.setText(""); + hash.setText(""); + TypeCombo.setSelectedIndex(0); + size.setText(""); + + //Clear 3rd Tab + chArea.setText(""); + bugNode = new DefaultMutableTreeNode("BugFixes"); + changeNode = new DefaultMutableTreeNode("Changes"); + featureNode = new DefaultMutableTreeNode("Features"); + rootNode = new DefaultMutableTreeNode("Changelog"); + rootNode.add(bugNode); + rootNode.add(changeNode); + rootNode.add(featureNode); + treeModel = new DefaultTreeModel(rootNode); + chTree.setModel(treeModel); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |