/* Copyright 2004-2014 Jim Voris * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.qumasoft.guitools.qwin.dialog; import com.qumasoft.guitools.qwin.operation.OperationCreateArchive; import com.qumasoft.qvcslib.ArchiveAttributes; import com.qumasoft.qvcslib.CheckInCommentProperties; import com.qumasoft.qvcslib.ExtensionAttributeProperties; import com.qumasoft.qvcslib.commandargs.CreateArchiveCommandArgs; import com.qumasoft.qvcslib.MergedInfoInterface; import java.util.List; /** * Add file(s) to version control. This dialog allows the user to enter a description of the file; and allows the user to set what QVCS attributes should be used for this file(s). * * @author Jim Voris */ public class AddFileDialog extends AbstractQWinCommandDialog { private static final long serialVersionUID = -4827111759699259113L; private int checkInCommentIndex = 0; private final List selectedFiles; private final OperationCreateArchive operationCreateArchive; private final CheckInCommentProperties checkInCommentProperties; /** * Creates new form AddFileDialog. * * @param parent the parent frame. * @param files the selected files list. * @param checkInComments the check in comments. * @param operation the create archive operation that will do the work. */ public AddFileDialog(java.awt.Frame parent, List files, CheckInCommentProperties checkInComments, OperationCreateArchive operation) { super(parent, true); selectedFiles = files; operationCreateArchive = operation; initComponents(); getRootPane().setDefaultButton(okButton); checkInCommentProperties = checkInComments; descriptionOfFile.requestFocusInWindow(); String checkInComment = checkInComments.getCheckInComment(0); if (checkInComment != null) { descriptionOfFile.setText(checkInComment); descriptionOfFile.select(0, checkInComment.length()); } if (files.size() == 1) { initAttributeControls(); } setFont(); center(); } /** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form * Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { okButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); workfileLocationLabel = new javax.swing.JLabel(); workfileLocation = new javax.swing.JTextField(); workfileLocationButton = new javax.swing.JButton(); descriptionOfFileLabel = new javax.swing.JLabel(); descriptionOfFile = new javax.swing.JTextArea(); qvcsAttributesPanel = new javax.swing.JPanel(); checkLocksCheckBox = new javax.swing.JCheckBox(); deleteWorkfileCheckBox = new javax.swing.JCheckBox(); expandKeywordsCheckBox = new javax.swing.JCheckBox(); protectArchiveCheckBox = new javax.swing.JCheckBox(); computeDeltaCheckBox = new javax.swing.JCheckBox(); storeLatestRevOnlyCheckBox = new javax.swing.JCheckBox(); binaryFileCheckBox = new javax.swing.JCheckBox(); protectWorkfileCheckBox = new javax.swing.JCheckBox(); journalChangesCheckBox = new javax.swing.JCheckBox(); compressArchiveCheckBox = new javax.swing.JCheckBox(); autoMergeCheckBox = new javax.swing.JCheckBox(); checkOutImmediatelyCheckBox = new javax.swing.JCheckBox(); nextButton = new javax.swing.JButton(); prevButton = new javax.swing.JButton(); clearButton = new javax.swing.JButton(); commentPrefixLabel = new javax.swing.JLabel(); commentPrefixTextArea = new javax.swing.JTextArea(); defineArchiveAttributesCheckBox = new javax.swing.JCheckBox(); setTitle("Add File"); setResizable(false); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); okButton.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N okButton.setText(" OK "); okButton.setMaximumSize(new java.awt.Dimension(80, 25)); okButton.setMinimumSize(new java.awt.Dimension(80, 25)); okButton.setPreferredSize(new java.awt.Dimension(80, 25)); okButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okButtonActionPerformed(evt); } }); cancelButton.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N cancelButton.setText("Cancel"); cancelButton.setMaximumSize(new java.awt.Dimension(80, 25)); cancelButton.setMinimumSize(new java.awt.Dimension(80, 25)); cancelButton.setPreferredSize(new java.awt.Dimension(80, 25)); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); workfileLocationLabel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N workfileLocationLabel.setText("From the workfile"); workfileLocation.setEditable(false); workfileLocationButton.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N workfileLocationButton.setText("..."); workfileLocationButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { workfileLocationButtonActionPerformed(evt); } }); descriptionOfFileLabel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N descriptionOfFileLabel.setText("Description of this file:"); descriptionOfFile.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N descriptionOfFile.setLineWrap(true); descriptionOfFile.setRows(8); descriptionOfFile.setTabSize(4); descriptionOfFile.setWrapStyleWord(true); descriptionOfFile.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); descriptionOfFile.setMaximumSize(new java.awt.Dimension(102, 120)); descriptionOfFile.setMinimumSize(new java.awt.Dimension(102, 120)); qvcsAttributesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "QVCS Attributes: ", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 12))); // NOI18N qvcsAttributesPanel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N checkLocksCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N checkLocksCheckBox.setText("Check Locks"); checkLocksCheckBox.setEnabled(false); deleteWorkfileCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N deleteWorkfileCheckBox.setText("Delete Workfile"); deleteWorkfileCheckBox.setEnabled(false); expandKeywordsCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N expandKeywordsCheckBox.setText("Expand Keywords"); expandKeywordsCheckBox.setEnabled(false); protectArchiveCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N protectArchiveCheckBox.setText("Protect QVCS archive"); protectArchiveCheckBox.setEnabled(false); computeDeltaCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N computeDeltaCheckBox.setText("Compute Delta"); computeDeltaCheckBox.setEnabled(false); storeLatestRevOnlyCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N storeLatestRevOnlyCheckBox.setText("Store latest revision only"); storeLatestRevOnlyCheckBox.setEnabled(false); binaryFileCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N binaryFileCheckBox.setText("Binary File"); binaryFileCheckBox.setEnabled(false); protectWorkfileCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N protectWorkfileCheckBox.setText("Protect Workfile"); protectWorkfileCheckBox.setEnabled(false); journalChangesCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N journalChangesCheckBox.setText("Journal Changes"); journalChangesCheckBox.setEnabled(false); compressArchiveCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N compressArchiveCheckBox.setText("Compress Archive"); compressArchiveCheckBox.setEnabled(false); autoMergeCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N autoMergeCheckBox.setText("Auto-Merge on check-in"); autoMergeCheckBox.setEnabled(false); org.jdesktop.layout.GroupLayout qvcsAttributesPanelLayout = new org.jdesktop.layout.GroupLayout(qvcsAttributesPanel); qvcsAttributesPanel.setLayout(qvcsAttributesPanelLayout); qvcsAttributesPanelLayout.setHorizontalGroup( qvcsAttributesPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(qvcsAttributesPanelLayout.createSequentialGroup() .add(qvcsAttributesPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(qvcsAttributesPanelLayout.createSequentialGroup() .add(14, 14, 14) .add(checkLocksCheckBox) .add(68, 68, 68) .add(binaryFileCheckBox)) .add(qvcsAttributesPanelLayout.createSequentialGroup() .add(14, 14, 14) .add(deleteWorkfileCheckBox) .add(55, 55, 55) .add(protectWorkfileCheckBox)) .add(qvcsAttributesPanelLayout.createSequentialGroup() .add(14, 14, 14) .add(expandKeywordsCheckBox) .add(39, 39, 39) .add(protectArchiveCheckBox)) .add(qvcsAttributesPanelLayout.createSequentialGroup() .add(14, 14, 14) .add(journalChangesCheckBox) .add(44, 44, 44) .add(compressArchiveCheckBox)) .add(qvcsAttributesPanelLayout.createSequentialGroup() .add(14, 14, 14) .add(computeDeltaCheckBox) .add(56, 56, 56) .add(autoMergeCheckBox)) .add(qvcsAttributesPanelLayout.createSequentialGroup() .add(184, 184, 184) .add(storeLatestRevOnlyCheckBox))) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); qvcsAttributesPanelLayout.setVerticalGroup( qvcsAttributesPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(qvcsAttributesPanelLayout.createSequentialGroup() .add(10, 10, 10) .add(qvcsAttributesPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(checkLocksCheckBox) .add(binaryFileCheckBox)) .add(7, 7, 7) .add(qvcsAttributesPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(deleteWorkfileCheckBox) .add(protectWorkfileCheckBox)) .add(7, 7, 7) .add(qvcsAttributesPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(expandKeywordsCheckBox) .add(protectArchiveCheckBox)) .add(7, 7, 7) .add(qvcsAttributesPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(journalChangesCheckBox) .add(compressArchiveCheckBox)) .add(7, 7, 7) .add(qvcsAttributesPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(computeDeltaCheckBox) .add(autoMergeCheckBox)) .add(7, 7, 7) .add(storeLatestRevOnlyCheckBox)) ); checkOutImmediatelyCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N checkOutImmediatelyCheckBox.setText("Check out immediately"); nextButton.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N nextButton.setMnemonic('x'); nextButton.setText("Next"); nextButton.setToolTipText("Next CheckIn Comment"); nextButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nextButtonActionPerformed(evt); } }); prevButton.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N prevButton.setMnemonic('v'); prevButton.setText("Prev"); prevButton.setToolTipText("Previous CheckIn Comment"); prevButton.setEnabled(false); prevButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { prevButtonActionPerformed(evt); } }); clearButton.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N clearButton.setText("Clear"); clearButton.setToolTipText("Clear CheckIn Comment"); clearButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clearButtonActionPerformed(evt); } }); commentPrefixLabel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N commentPrefixLabel.setText("Define Comment prefix:"); commentPrefixTextArea.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N commentPrefixTextArea.setToolTipText("This string is used when expanding the Log keyword."); commentPrefixTextArea.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); commentPrefixTextArea.setMaximumSize(new java.awt.Dimension(2, 17)); defineArchiveAttributesCheckBox.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N defineArchiveAttributesCheckBox.setText("Define archive attributes"); defineArchiveAttributesCheckBox.setToolTipText("Enable to define archive attributes"); defineArchiveAttributesCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { defineArchiveAttributesCheckBoxActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(12, 12, 12) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(defineArchiveAttributesCheckBox) .add(checkOutImmediatelyCheckBox)) .add(54, 54, 54) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(commentPrefixLabel) .add(commentPrefixTextArea, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 140, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createSequentialGroup() .addContainerGap() .add(nextButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(prevButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(clearButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(12, 12, 12) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, descriptionOfFile, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, descriptionOfFileLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, workfileLocationLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, workfileLocation) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .add(okButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(cancelButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(org.jdesktop.layout.GroupLayout.LEADING, qvcsAttributesPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(workfileLocationButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(12, 12, 12) .add(workfileLocationLabel) .add(4, 4, 4) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(workfileLocationButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(workfileLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(2, 2, 2) .add(descriptionOfFileLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(descriptionOfFile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(clearButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(prevButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(nextButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(10, 10, 10) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(20, 20, 20) .add(defineArchiveAttributesCheckBox)) .add(checkOutImmediatelyCheckBox) .add(layout.createSequentialGroup() .add(commentPrefixLabel) .add(6, 6, 6) .add(commentPrefixTextArea, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(7, 7, 7) .add(qvcsAttributesPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(10, 10, 10) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(okButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(17, 17, 17)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void defineArchiveAttributesCheckBoxActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_defineArchiveAttributesCheckBoxActionPerformed {//GEN-HEADEREND:event_defineArchiveAttributesCheckBoxActionPerformed // Add your handling code here: boolean retVal = false; Object defineAttributes = defineArchiveAttributesCheckBox.getSelectedObjects(); if (defineAttributes != null) { enableAttributeControls(true); } else { enableAttributeControls(false); } }//GEN-LAST:event_defineArchiveAttributesCheckBoxActionPerformed private void clearButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_clearButtonActionPerformed {//GEN-HEADEREND:event_clearButtonActionPerformed // Clear the checkin comment. setFileDescription(null); descriptionOfFile.requestFocusInWindow(); }//GEN-LAST:event_clearButtonActionPerformed private void prevButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_prevButtonActionPerformed {//GEN-HEADEREND:event_prevButtonActionPerformed // Display the previous checkin comment. if (checkInCommentIndex > 0) { checkInCommentIndex--; setFileDescription(checkInCommentProperties.getCheckInComment(checkInCommentIndex)); nextButton.setEnabled(true); descriptionOfFile.requestFocusInWindow(); } if (checkInCommentIndex == 0) { // Disable the next button. prevButton.setEnabled(false); } }//GEN-LAST:event_prevButtonActionPerformed private void nextButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_nextButtonActionPerformed {//GEN-HEADEREND:event_nextButtonActionPerformed // Display the next check-in comment. int knownComments = checkInCommentProperties.getCommentCount(); if (checkInCommentIndex < (knownComments - 1)) { checkInCommentIndex++; setFileDescription(checkInCommentProperties.getCheckInComment(checkInCommentIndex)); prevButton.setEnabled(true); descriptionOfFile.requestFocusInWindow(); } if (checkInCommentIndex == (knownComments - 1)) { // Disable the next button. nextButton.setEnabled(false); } }//GEN-LAST:event_nextButtonActionPerformed private void workfileLocationButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_workfileLocationButtonActionPerformed {//GEN-HEADEREND:event_workfileLocationButtonActionPerformed setWorkfileLocation(selectFile(getWorkfileLocation(), "Add to version control:")); }//GEN-LAST:event_workfileLocationButtonActionPerformed private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_cancelButtonActionPerformed {//GEN-HEADEREND:event_cancelButtonActionPerformed closeDialog(null); }//GEN-LAST:event_cancelButtonActionPerformed private void okButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_okButtonActionPerformed {//GEN-HEADEREND:event_okButtonActionPerformed // Add your handling code here: checkInCommentProperties.addCheckInComment(descriptionOfFile.getText()); closeDialog(null); operationCreateArchive.completeOperation(selectedFiles, getCommandLineArgs()); }//GEN-LAST:event_okButtonActionPerformed /** * Closes the dialog */ private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog setVisible(false); dispose(); }//GEN-LAST:event_closeDialog @Override public void dismissDialog() { cancelButtonActionPerformed(null); } public void setWorkfileLocation(String location) { this.workfileLocation.setText(location); } public String getWorkfileLocation() { return workfileLocation.getText(); } public void setFileDescription(String changes) { descriptionOfFile.setText(changes); } public String getFileDescription() { return descriptionOfFile.getText(); } public boolean getCheckOutImmediatelyFlag() { boolean retVal = false; Object checkOutImmediately = checkOutImmediatelyCheckBox.getSelectedObjects(); if (checkOutImmediately != null) { retVal = true; } return retVal; } public boolean getUseAttributes() { boolean retVal = false; Object useAttributes = defineArchiveAttributesCheckBox.getSelectedObjects(); if (useAttributes != null) { retVal = true; } return retVal; } private void enableAttributeControls(boolean flag) { checkLocksCheckBox.setEnabled(flag); protectWorkfileCheckBox.setEnabled(flag); binaryFileCheckBox.setEnabled(flag); compressArchiveCheckBox.setEnabled(flag); journalChangesCheckBox.setEnabled(flag); deleteWorkfileCheckBox.setEnabled(flag); protectArchiveCheckBox.setEnabled(flag); expandKeywordsCheckBox.setEnabled(flag); computeDeltaCheckBox.setEnabled(flag); // TODO -- these are not implemented yet. autoMergeCheckBox.setEnabled(false); storeLatestRevOnlyCheckBox.setEnabled(false); } private boolean getAttributeValue(javax.swing.JCheckBox checkBox) { boolean retVal = false; Object object = checkBox.getSelectedObjects(); if (object != null) { retVal = true; } return retVal; } private ArchiveAttributes getAttributes() { ArchiveAttributes attributes = null; if (getUseAttributes()) { attributes = new ArchiveAttributes(); attributes.setIsAutoMerge(getAttributeValue(autoMergeCheckBox)); attributes.setIsBinaryfile(getAttributeValue(binaryFileCheckBox)); attributes.setIsCheckLock(getAttributeValue(checkLocksCheckBox)); attributes.setIsCompression(getAttributeValue(compressArchiveCheckBox)); attributes.setIsComputeDelta(getAttributeValue(computeDeltaCheckBox)); attributes.setIsDeleteWork(getAttributeValue(deleteWorkfileCheckBox)); attributes.setIsExpandKeywords(getAttributeValue(expandKeywordsCheckBox)); attributes.setIsJournalfile(getAttributeValue(journalChangesCheckBox)); attributes.setIsLatestRevOnly(getAttributeValue(storeLatestRevOnlyCheckBox)); attributes.setIsProtectArchive(getAttributeValue(protectArchiveCheckBox)); attributes.setIsProtectWorkfile(getAttributeValue(protectWorkfileCheckBox)); } return attributes; } private void initAttributeControls() { MergedInfoInterface mergedInfo = (MergedInfoInterface) selectedFiles.get(0); String workfileName = mergedInfo.getWorkfileInfo().getShortWorkfileName(); ArchiveAttributes attributes = ExtensionAttributeProperties.getInstance().getAttributes(workfileName); autoMergeCheckBox.setSelected(attributes.getIsAutoMerge()); binaryFileCheckBox.setSelected(attributes.getIsBinaryfile()); checkLocksCheckBox.setSelected(attributes.getIsCheckLock()); compressArchiveCheckBox.setSelected(attributes.getIsCompression()); computeDeltaCheckBox.setSelected(attributes.getIsComputeDelta()); deleteWorkfileCheckBox.setSelected(attributes.getIsDeleteWork()); expandKeywordsCheckBox.setSelected(attributes.getIsExpandKeywords()); journalChangesCheckBox.setSelected(attributes.getIsJournalfile()); storeLatestRevOnlyCheckBox.setSelected(attributes.getIsLatestRevOnly()); protectArchiveCheckBox.setSelected(attributes.getIsProtectArchive()); protectWorkfileCheckBox.setSelected(attributes.getIsProtectWorkfile()); } private CreateArchiveCommandArgs getCommandLineArgs() { CreateArchiveCommandArgs commandArgs = new CreateArchiveCommandArgs(); commandArgs.setArchiveDescription(getFileDescription()); commandArgs.setCommentPrefix(commentPrefixTextArea.getText()); commandArgs.setLockFlag(getCheckOutImmediatelyFlag()); commandArgs.setAttributes(getAttributes()); return commandArgs; } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JCheckBox autoMergeCheckBox; private javax.swing.JCheckBox binaryFileCheckBox; private javax.swing.JButton cancelButton; private javax.swing.JCheckBox checkLocksCheckBox; private javax.swing.JCheckBox checkOutImmediatelyCheckBox; private javax.swing.JButton clearButton; private javax.swing.JLabel commentPrefixLabel; private javax.swing.JTextArea commentPrefixTextArea; private javax.swing.JCheckBox compressArchiveCheckBox; private javax.swing.JCheckBox computeDeltaCheckBox; private javax.swing.JCheckBox defineArchiveAttributesCheckBox; private javax.swing.JCheckBox deleteWorkfileCheckBox; private javax.swing.JTextArea descriptionOfFile; private javax.swing.JLabel descriptionOfFileLabel; private javax.swing.JCheckBox expandKeywordsCheckBox; private javax.swing.JCheckBox journalChangesCheckBox; private javax.swing.JButton nextButton; private javax.swing.JButton okButton; private javax.swing.JButton prevButton; private javax.swing.JCheckBox protectArchiveCheckBox; private javax.swing.JCheckBox protectWorkfileCheckBox; private javax.swing.JPanel qvcsAttributesPanel; private javax.swing.JCheckBox storeLatestRevOnlyCheckBox; private javax.swing.JTextField workfileLocation; private javax.swing.JButton workfileLocationButton; private javax.swing.JLabel workfileLocationLabel; // End of variables declaration//GEN-END:variables }