Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: johanness/jopen
base: 0a837d31ec
...
head fork: johanness/jopen
compare: fa39433766
  • 3 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
BIN  build/org-jojo.nbm
Binary file not shown
View
1  src/org/jojo/JOpenDialog.form
@@ -85,6 +85,7 @@
</Property>
</Properties>
<Events>
+ <EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="jResultListValueChanged"/>
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jResultListKeyPressed"/>
</Events>
</Component>
View
17 src/org/jojo/JOpenDialog.java
@@ -74,7 +74,12 @@ public void keyPressed(java.awt.event.KeyEvent evt) {
}
});
- jResultList.setFont(new java.awt.Font("DejaVu Sans Mono", 0, 12));
+ jResultList.setFont(new java.awt.Font("DejaVu Sans Mono", 0, 12)); // NOI18N
+ jResultList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+ public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
+ jResultListValueChanged(evt);
+ }
+ });
jResultList.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jResultListKeyPressed(evt);
@@ -97,7 +102,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addComponent(jQueryField, javax.swing.GroupLayout.DEFAULT_SIZE, 679, Short.MAX_VALUE)
+ .addComponent(jQueryField, javax.swing.GroupLayout.DEFAULT_SIZE, 689, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSelectProjectButton))
.addComponent(jResultPane, javax.swing.GroupLayout.DEFAULT_SIZE, 794, Short.MAX_VALUE))
@@ -167,6 +172,11 @@ private void jSelectProjectButtonActionPerformed(java.awt.event.ActionEvent evt)
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
this.updateTitle();
}//GEN-LAST:event_formWindowActivated
+
+ private void jResultListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jResultListValueChanged
+ this.updateTitle();
+ }//GEN-LAST:event_jResultListValueChanged
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField jQueryField;
private javax.swing.JList jResultList;
@@ -279,6 +289,9 @@ private void updateTitle() {
if (mainProjectTitle != null) {
title += " - " + mainProjectTitle;
}
+ if (jResultList.getSelectedIndices().length == 1) {
+ title += " - " + ((FileEntry)jResultList.getSelectedValue()).getAbsolutePath();
+ }
this.setTitle(title);
}
}
View
6 src/org/jojo/search/pattern/RegexSearchPattern.java
@@ -33,6 +33,12 @@ private String getRegex(String query) {
case '/':
newRegex += "\\/.*";
break;
+ case '$':
+ if (newRegex.endsWith(".*")) {
+ newRegex = newRegex.substring(0, newRegex.length() - 2);
+ }
+ newRegex += "$";
+ break;
default:
newRegex += c + ".*";
}
View
9 test/unit/src/org/jojo/search/pattern/RegexSearchPatternTest.java
@@ -27,6 +27,15 @@ public void testIsMatch() {
}
@Test
+ public void testIsMatchSupportsEOLCharacter() {
+ RegexSearchPattern instance = new RegexSearchPattern();
+ FileEntry fileEntry = new FileEntry(new File("/path/To/Some.file.extension"));
+
+ assertFalse(instance.isMatch(fileEntry, "file$"));
+ assertTrue(instance.isMatch(fileEntry, "extension$"));
+ }
+
+ @Test
public void testIsValidQuery() {
RegexSearchPattern instance = new RegexSearchPattern();
assertFalse(instance.isValidQuery(null));

No commit comments for this range

Something went wrong with that request. Please try again.