resize "Text View" text area to match other content viewers, reset match count on new file selection

This commit is contained in:
Dick Fickling 2012-01-19 13:44:32 -05:00
parent 118bcf2b40
commit b137b342b7
3 changed files with 13 additions and 4 deletions

View File

@ -53,8 +53,8 @@
<Component id="hitPreviousButton" min="-2" pref="23" max="-2" attributes="0"/>
<Component id="hitNextButton" min="-2" pref="23" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="287" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="293" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>

View File

@ -135,8 +135,8 @@ class ExtractedContentPanel extends javax.swing.JPanel {
.addComponent(hitCountLabel))
.addComponent(hitPreviousButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(hitNextButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE))
.addGap(0, 0, 0)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
@ -220,6 +220,14 @@ class ExtractedContentPanel extends javax.swing.JPanel {
public void updateTotalDisplay(int total) {
hitTotalLabel.setText(Integer.toString(total));
}
/**
* reset the current/total display
*/
public void resetHitDisplay() {
hitTotalLabel.setText("-");
hitCountLabel.setText("-");
}
/**
* enable previous match control

View File

@ -138,6 +138,7 @@ public class ExtractedContentViewer implements DataContentViewer {
@Override
public void resetComponent() {
setPanel(Collections.EMPTY_LIST);
panel.resetHitDisplay();
}
@Override