package com.dafreels.opentools.actions.ui; import java.util.Vector; import java.awt.CardLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Font; import java.awt.Frame; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.LayoutManager; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.ButtonGroup; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.JTable; import javax.swing.JTextPane; import javax.swing.ListSelectionModel; import javax.swing.UIManager; import javax.swing.table.DefaultTableModel; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import javax.swing.text.SimpleAttributeSet; import javax.swing.text.StyleConstants; import com.dafreels.opentools.Main; import com.dafreels.opentools.MessageWriter; import com.dafreels.vcs.command.Command; import com.dafreels.vcs.command.CommandTool; import com.dafreels.vcs.command.MessageFormatter; import com.dafreels.vcs.command.PropertyInterface; public class FileIntegrateDialog extends JDialog implements ActionListener { private static final String BRANCH_PANEL = "Branch"; private static final String INTEGRATE_PANEL = "Integrate"; private static final String INTEGRATE_PANEL_TITLE = "File Integrate Using Branchspec "; private JPanel _topPanel; private JList _branchList; private JList _fileList; private JComboBox _changeListCombo; private JTable _branchTable; private JRadioButton _toRadio; private JRadioButton _fromRadio; private JButton _backButton; private JButton _nextButton; private JButton _cancelButton; private Vector _columnNames; private String _changeListNum; public FileIntegrateDialog(Frame parent, boolean modal) { super(parent, modal); buildControls(); } protected void buildControls() { setTitle("File Integrate - Specify Branch"); getContentPane().setLayout(new GridBagLayout()); _topPanel = new JPanel(new CardLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.BOTH; gbc.weightx = 1.0; gbc.weighty = 1.0; gbc.insets = new Insets(5,5,0,5); getContentPane().add(_topPanel, gbc); JPanel panel = buildPickBranchPanel(); _topPanel.add(BRANCH_PANEL, panel); panel = buildIntegratePanel(); _topPanel.add(INTEGRATE_PANEL, panel); JSeparator sep = new JSeparator(); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(5,5,0,5); getContentPane().add(sep, gbc); JPanel buttonPanel = buildButtonPanel(); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(5,5,0,5); getContentPane().add(buttonPanel, gbc); pack(); setLocationRelativeTo(getParent()); ((CardLayout)_topPanel.getLayout()).show(_topPanel, BRANCH_PANEL); _columnNames = new Vector(3); _columnNames.add("Branch"); _columnNames.add("Date"); _columnNames.add("Description"); addWindowListener(new WindowAdapter() { public void windowOpened(WindowEvent e) { setButtonState(); fillInBranchInfo(); } }); } protected void setButtonState() { WizardJPanel panel = getCurrentPanel(); if ( panel == null ) { return; } _nextButton.setActionCommand(panel.getNextPanelName()); _backButton.setActionCommand(panel.getBackPanelName()); String cmd = _nextButton.getActionCommand(); String nextText = cmd!=null&& cmd.length()>0?"Next >":"Finish"; _nextButton.setText(nextText); cmd = _backButton.getActionCommand(); _backButton.setEnabled(cmd!= null&&cmd.length() >0 ); setTitle(panel.getWindowTitle()); return; } protected WizardJPanel getCurrentPanel() { int cnt = _topPanel.getComponentCount(); for (int i = 0; i < cnt; i++ ) { Component c = _topPanel.getComponent(i); if ( c.isVisible()) { // active panel if ( c instanceof WizardJPanel ) { return (WizardJPanel)c; } } } System.out.println("no Wizard Panel found"); return null; } protected JPanel buildPickBranchPanel() { WizardJPanel panel = new WizardJPanel(new GridBagLayout()) { public boolean isValid() { if ( !FileIntegrateDialog.this.isVisible()) { return true; } boolean valid = getSelectedBranch() != null; if (!valid) { JOptionPane.showMessageDialog(FileIntegrateDialog.this, "Please select a Branch to Integrate to" ); } return valid; } public void goingToNextPanel() { if ( isValid()) { fillInBranchViewList(); } } }; panel.setWindowTitle("File Integrate - Specify Branch"); panel.setNextPanelName(INTEGRATE_PANEL); JLabel label = new JLabel("Choose the PERFORCE Branch definition that will be used to map the source files to target files."); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); panel.add(label, gbc); label = new JLabel("Double-click any Branch in the list to examine the actual Branch mappings"); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); panel.add(label, gbc); _branchTable = new JTable(new Object[0][3], new String[]{ "Branch", "Date", "Description" }) { public Dimension getPreferredScrollableViewportSize() { Dimension d= super.getPreferredScrollableViewportSize(); d.height = 200; return d; } public boolean isCellEditable(int row, int col) { return false; } }; _branchTable.setShowHorizontalLines(false); _branchTable.setShowVerticalLines(false); _branchTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); _branchTable.setCellSelectionEnabled(false); _branchTable.setColumnSelectionAllowed(false); _branchTable.setRowSelectionAllowed(true); _branchTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.BOTH; gbc.weightx = 1.0; gbc.weighty = 1.0; gbc.insets = new Insets(5,5,0,5); panel.add(new JScrollPane(_branchTable), gbc); _branchTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if ( e.getClickCount() == 2 ) { String branch = getSelectedBranch(); if (branch == null ) { return; } displayBranchInfo(branch); } } }); return panel; } protected JPanel buildIntegratePanel() { WizardJPanel panel = new WizardJPanel(new GridBagLayout()) { public String getWindowTitle() { String branch = getSelectedBranch(); if (branch == null ) { return INTEGRATE_PANEL_TITLE; } return INTEGRATE_PANEL_TITLE+branch; } public boolean isValid() { return true; } public void goingToNextPanel() { finishIntegration(); } }; panel.setBackPanelName(BRANCH_PANEL); JLabel label = new JLabel("Branch View"); label.setDisplayedMnemonic('V'); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); panel.add(label, gbc); _branchList = new JList() { public Dimension getPreferredScrollableViewportSize() { Dimension d = super.getPreferredScrollableViewportSize(); d.height = getFixedCellHeight()*6; return d; } }; label.setLabelFor(_branchList); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.BOTH; gbc.weightx = 1.0; gbc.weighty = 1.0; gbc.gridwidth = 4; gbc.insets = new Insets(5,5,0,5); panel.add(new JScrollPane(_branchList), gbc); JPanel radioPanel = new JPanel(new GridBagLayout()); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); panel.add(radioPanel, gbc); label = new JLabel("File Specifications - Integrate"); label.setDisplayedMnemonic('S'); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); radioPanel.add(label, gbc); _toRadio = new JRadioButton("To",true); _toRadio.setMnemonic('T'); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); radioPanel.add(_toRadio, gbc); _fromRadio = new JRadioButton("From Selected Files"); _fromRadio.setMnemonic('F'); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); radioPanel.add(_fromRadio, gbc); _fileList = new JList() { public Dimension getPreferredScrollableViewportSize() { Dimension d = super.getPreferredScrollableViewportSize(); d.height = getFixedCellHeight()*6; return d; } }; label.setLabelFor(_fileList); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.BOTH; gbc.weightx = 1.0; gbc.weighty = 1.0; gbc.gridwidth = 4; gbc.insets = new Insets(5,5,0,5); panel.add(new JScrollPane(_fileList), gbc); label = new JLabel("Open File(s) under Changelist:"); label.setDisplayedMnemonic('C'); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 4; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); panel.add(label, gbc); //_changeListCombo = new JComboBox(new String[]{ "Default", "New" }); _changeListCombo = new JComboBox(new String[]{ "Default"}); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 4; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(5,5,0,5); panel.add(_changeListCombo, gbc); JButton optionsButton = new JButton("Options"); optionsButton.setMnemonic('O'); optionsButton.setEnabled(false); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 4; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); panel.add(optionsButton, gbc); JButton previewButton = new JButton("Preview"); previewButton.setMnemonic('P'); gbc = new GridBagConstraints(); gbc.gridx = 3; gbc.gridy = 4; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); panel.add(previewButton, gbc); previewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { previewIntegration(); } }); ButtonGroup bg = new ButtonGroup(); bg.add(_toRadio); bg.add(_fromRadio); return panel; } JPanel buildButtonPanel() { JPanel panel = new JPanel(new GridBagLayout()); _backButton = new JButton("< Back"); _backButton.setMnemonic('B'); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,0); panel.add(_backButton, gbc); _nextButton = new JButton("Next >"); _nextButton.setMnemonic('N'); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,0,0,5); panel.add(_nextButton, gbc); _cancelButton = new JButton("Cancel"); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); panel.add(_cancelButton, gbc); _backButton.addActionListener(this); _nextButton.addActionListener(this); _cancelButton.addActionListener(this); return panel; } public void actionPerformed(ActionEvent e) { Object src = e.getSource(); String panelName = null; if ( src == _nextButton ) { if ( !getCurrentPanel().isValid()) { System.out.println("currentPanel isn't valid"); return; } panelName = _nextButton.getActionCommand(); getCurrentPanel().goingToNextPanel(); } else if ( src == _backButton ) { panelName = _backButton.getActionCommand(); } else if ( src == _cancelButton ) { setVisible(false); } if ( panelName != null ) { ((CardLayout)_topPanel.getLayout()).show(_topPanel, panelName); setButtonState(); } } /** * run the integ command. * @param args optional args. -n is used for previewing * * @return true if the command ran successfully */ protected boolean runIntegrate(String args) { String branch = getSelectedBranch(); if ( branch == null ) { return false; } boolean noErrors = true; String endArg = (_fromRadio.isSelected()?" //...":""); String cmdStr; for (int i =0; i< _fileList.getModel().getSize(); i++ ) { cmdStr = "integ " + args+ " -b " +branch+" -s " + (_changeListNum==null?"//... ":"") + _fileList.getModel().getElementAt(i) +(_changeListNum!=null?"@"+_changeListNum+",@"+_changeListNum:"") + endArg; com.dafreels.vcs.command.Command cmd = new com.dafreels.vcs.command.Command(cmdStr); System.out.println("runIntegrate: command is ["+cmdStr+"]"); com.dafreels.vcs.command.CommandTool.runCommand(cmd, Main.m_props); if ( MessageFormatter.getErrorMessageCount() != 0 ) { noErrors = false; } MessageWriter.outputErrorMessages(MessageFormatter.getInstance()); if ( Main.m_props.showOutput() ) { MessageWriter.outputMessages(MessageFormatter.getInstance()); } } return noErrors; } /** * run the integ command */ protected void finishIntegration() { if ( runIntegrate("") ) { setVisible(false); } } /** * preview the integ command */ protected void previewIntegration() { runIntegrate("-n"); } /** * fill in the Branch table */ protected void fillInBranchInfo() { com.dafreels.vcs.command.Command cmd = new com.dafreels.vcs.command.Command("branches"); com.dafreels.vcs.command.CommandTool.runCommand(cmd, Main.m_props); MessageWriter.outputErrorMessages(MessageFormatter.getInstance()); String msg; // format is Branch <branchName> <date> '<description>' int idx; String branchName, date, description; int row = 0; Vector rows = new Vector(); Vector rowData; while ((msg = MessageFormatter.getNextMessage()) !=null ) { if ( Main.m_props.showOutput() ) { // output message } if ( !msg.startsWith("Branch")) { continue; } msg = msg.substring(7); // strip off "Branch " idx = msg.indexOf(" "); if ( idx == -1 ) { continue; } branchName = msg.substring(0,idx); msg = msg.substring(idx+1); idx = msg.indexOf(" "); if ( idx == -1 ) { continue; } date = msg.substring(0,idx); msg = msg.substring(idx+2); if ( msg.endsWith("'")) { description = msg.substring(0,msg.length()-1); } else { description = msg; } rowData = new Vector(3); rowData.add(branchName); rowData.add(date); rowData.add(description); rows.add(rowData); } DefaultTableModel newModel = new DefaultTableModel(rows, _columnNames); _branchTable.setModel(newModel); } /** * get the selected branch in the branch table * @return the selected branch or null if no branch is selected */ protected String getSelectedBranch() { int row = _branchTable.getSelectedRow(); if ( row == -1 ) { return null; } return (String)_branchTable.getValueAt(row,0); } /** * fill in the branch view list */ protected void fillInBranchViewList() { String branch = getSelectedBranch(); if ( branch == null ) { return; } com.dafreels.vcs.command.Command cmd = new com.dafreels.vcs.command. Command("branch -o "+branch ); com.dafreels.vcs.command.CommandTool.runCommand(cmd, Main.m_props); MessageWriter.outputErrorMessages(MessageFormatter.getInstance()); String msg; int idx; String branchName, date, description; int row = 0; Vector rows = new Vector(); Vector rowData; // search for line that starts with "View:" // use next line boolean useNextLine = false; DefaultListModel newModel = new DefaultListModel(); while ((msg = MessageFormatter.getNextMessage()) !=null ) { if ( useNextLine) { msg = msg.trim(); newModel.addElement(msg); break; } if ( msg.startsWith("View:")) { useNextLine = true; } } _branchList.setModel(newModel); } protected void displayBranchInfo(String branch) { com.dafreels.vcs.command.Command cmd = new com.dafreels.vcs.command.Command("branch -o "+branch); com.dafreels.vcs.command.CommandTool.runCommand(cmd, Main.m_props); MessageWriter.outputErrorMessages(MessageFormatter.getInstance()); BranchInfoDialog dialog = new BranchInfoDialog(); dialog.fillForm(MessageFormatter.getInstance()); dialog.setVisible(true); } public void setChangeListNumber(String changeListNum) { _changeListNum = changeListNum; } public void setSelectedFiles(java.util.List files) { DefaultListModel newModel = new DefaultListModel(); String depotView; for (int i = 0; i< files.size(); i++ ) { depotView = getDepotView((String)files.get(i)); if ( depotView != null) { newModel.addElement(depotView); } } _fileList.setModel(newModel); } public void setSelectedNodes(com.borland.primetime.node.Node[] nodes) { DefaultListModel newModel = new DefaultListModel(); String depotView; for (int i = 0; i< nodes.length; i++ ) { depotView = getDepotView(nodes[i].getLongDisplayName()); if ( depotView != null) { newModel.addElement(depotView); } } /* for (int i = 0; i< nodes.length; i++ ) { newModel.addElement(nodes[i].getLongDisplayName()); } */ _fileList.setModel(newModel); } /** * given a full path to a file in the local file system, return it's depot location * @param fileName the file on the local file system * @return the depot location or null if not found */ protected String getDepotView(String fileName) { Command cmd = new Command(Command.STATUS); cmd.addPath("-s"); cmd.addPath(fileName); CommandTool.runCommand(cmd, Main.m_props); MessageWriter.outputErrorMessages(MessageFormatter.getInstance()); String line; String depotFileLine = "... depotFile"; while ( (line = MessageFormatter.getNextMessage())!= null) { if ( line.startsWith(depotFileLine)) { line = line.substring(depotFileLine.length()); return line.trim(); } } return null; } public void setVisible(boolean b) { ((CardLayout)_topPanel.getLayout()).show(_topPanel, BRANCH_PANEL); super.setVisible(b); } abstract class WizardJPanel extends JPanel { private String _backPanelName = ""; private String _nextPanelName = ""; private String _windowTitle = ""; WizardJPanel(LayoutManager lm) { super(lm); } public String getBackPanelName() { return _backPanelName; } public String getNextPanelName() { return _nextPanelName; } public String getWindowTitle() { return _windowTitle; } public void setWindowTitle(String title) { _windowTitle = title; } public void setBackPanelName(String panelName) { _backPanelName = panelName; } public void setNextPanelName(String panelName) { _nextPanelName = panelName; } public abstract boolean isValid(); public void goingToNextPanel() { } } class BranchInfoDialog extends JDialog { private JTextPane _textArea; BranchInfoDialog() { super(FileIntegrateDialog.this, true); buildControls(); } protected void buildControls() { getContentPane().setLayout(new GridBagLayout()); _textArea = new JTextPane() { public Dimension getPreferredScrollableViewportSize() { Dimension d = super.getPreferredScrollableViewportSize(); d.width = 500; d.height = 200; return d; } }; _textArea.setEditable(false); _textArea.setBackground(null); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.BOTH; gbc.weightx = 1.0; gbc.weighty = 1.0; gbc.insets = new Insets(5,5,0,5); getContentPane().add(new JScrollPane(_textArea), gbc); JButton okButton = new JButton("OK"); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.gridwidth = 1; gbc.anchor = GridBagConstraints.NORTHEAST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets(5,5,0,5); getContentPane().add(okButton, gbc); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { BranchInfoDialog.this.setVisible(false); dispose(); } }); } void fillForm(MessageFormatter formatter) { String message, arg; SimpleAttributeSet attrs; PropertyInterface props = Main.m_props; DefaultListModel model = new DefaultListModel(); formatter.getNextMessage(); // throw away first line MessageWriter.outputErrorMessages(MessageFormatter.getInstance()); while( (message = formatter.getNextMessage()) != null) { if ( message.startsWith("#")) { continue; } message = message.trim(); message = message.concat("\n"); if ( message.startsWith("//")) { appendFileLine(message); } else { attrs = new SimpleAttributeSet(); StyleConstants.setForeground(attrs, UIManager.getColor("TextField.foreground")); StyleConstants.setBackground(attrs, _textArea.getBackground()); appendText(message, attrs); } //_descriptionText.append("\n"); } _textArea.setCaretPosition(0); if( !isVisible() ) { pack(); setLocationRelativeTo(getParent()); }; } protected void appendFileLine(String message) { SimpleAttributeSet attrs = new SimpleAttributeSet(); StyleConstants.setForeground(attrs, Color.blue); StyleConstants.setBackground(attrs, _textArea.getBackground()); StyleConstants.setUnderline(attrs, true); int idx = message.lastIndexOf(" "); if ( idx == -1 ) { appendText(message, attrs); } else { String file = message.substring(0, idx); appendText(file, attrs); attrs = new SimpleAttributeSet(); StyleConstants.setForeground(attrs, UIManager.getColor("TextField.foreground")); StyleConstants.setBackground(attrs, _textArea.getBackground()); appendText(message.substring(idx), attrs); } } protected void appendText(String message, SimpleAttributeSet attrs) { Font f = (Font)UIManager.get("TextField.font"); StyleConstants.setFontFamily(attrs,f.getFamily()); StyleConstants.setFontSize(attrs, f.getSize()+1); try { Document doc = _textArea.getDocument(); int len = doc.getLength(); doc.insertString(len, message, attrs); } catch (BadLocationException ex) { System.out.println(ex); } } } public static void main(String[] args) { new FileIntegrateDialog(new Frame(), false).setVisible(true); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 4090 | David Freels |
Fixed bug where paths with spaces would not work. Also checked in new code or JBuilderX. |